Users guide, Part I: Optics programs

1. The Effective Medium Calculator

V. Ossenkopf, MPG AG “Dust in Star-Forming Regions” Jena

Abstract

The effective medium calculator (EMC) is an interactive program for manipulating optical constants of different materials with special attention to their combination by effective medium theories. Up to six media may be mixed using the Bruggeman or Maxwell-Garnett approach for arbitrary shapes of the components. The computed constants can be stored or used in further calculations. All computations can be controlled by eye via graphical plots.

1 Basic algorithms

Two different approaches are implemented in the program. The Maxwell-Garnett approach uses the T-matrix representation for all components in a mixture of materials embedded in a bulk medium ϵ_{m}:

ϵ^{∗} = ϵ_{m} + \frac{⟨T ⟩}{1 + ⟨GT ⟩}  (1)

with ⟨T ⟩ = ∑_{i} f_{i}T_{i}  (2)

⟨GT ⟩ = ∑_{i} f_{i}(1 − T_{i}/(ϵ_{i} − ϵ_{m}))  (3)

and T_{i} = α_{i}/V_{i} × ϵ_{m}  (4)

where α_{i} are the polarizabilities of the subgrains (e.g. α_{i} = V_{i}×(ϵ_{i}−ϵ_{m})/[ϵ_{m}+(ϵ_{i}−ϵ_{m})L_{i}] for ellipsoids). The T-matrices of spheres, infinite needles and platelets, and spherical core-mantle particles, all in Raleigh limit, are directly available. The T-matrices of other particles may be computed giving their depolarization factors. The computation of the effective dielectric constants is then straight forward for all wavelengths. For mathematical details see Ossenkopf (1990).

In the Bruggeman approach the equation ⟨T ⟩ = 0 is solved for ϵ_{m} = ϵ^{∗} which represents the effective medium in this case. The T-matrices of all components are splitted up into a nominator and a denominator term, the denominators of each component is multiplied with the nominator of all other components so that a high-order polynomial is formed. All roots of this polynomial are searched for by a complex Newton-Raphson method combined with a sequential decrease of the polynomial’s degree. A large part of the roots may be excluded because of negative imaginary parts of the resulting dielectric functions. The most appropriate of the remaining roots is selected by the criterion of the lowest distance from a simple average of the dielectric functions of the materials involved:

ϵ_{av} = \frac{1}{2} (∑_{i} f_{i}ϵ_{i} + \frac{1}{∑_{i} f_{i}/ϵ_{i}} ) .  (5)

This selection method fails for very large (|ϵ| > 1000) dielectric functions.

2 User interface

The program is designed for a completely interactive data processing. All parts contain menus which show the operations available in each status of the program. The menus follow a hierarchical structure. A step back to the next upper menu is always possible. Some points in a menu can only be reached after the definition of starting parameters. In case of operations for single materials the selection of a ”0.” material leads back to the last menu. All materials and menu functions are represented by integer numbers.

2.1 Menu structure

Main menu:

                           Effective media calculator
Material 1 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 2 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 3 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 4 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 5 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 6 :             0.000E+00 <lambda< 0.000E+00     fraction:0.000
Material 7 :  Vacuum     0.000E+00 <lambda< infinite      fraction:0.000

     (1) Read optical constants                       (2) Save optical constants
     (3) Calculation / Modification menu              (4) Graphic
     (5) Quit

This menu allows to call the basic routines for the file input and output of optical data and the graphics interface which permits to visualize the optical constants n and k depending on the wavelength λ for each of the materials or at most 4 together. The calculation/modification menu leads to the part where the structure of a composite material will be defined.

Parameter modification:

     (1) Add new component                            (2) Remove component
     (3) Change volume fractions                      (4) Select wavelengths modus
     (5) Calculate new effective constants            (6) Main menu

In this menu one can add or remove components and change their volume fractions. The sum of all volume fractions in the mixture has to be 1 when calling the menu for the calculation of the effective constants. Furthermore, on has to define at which wavelength points the new optical constants are to be computed. This selection is done in the wavelength modus menu:

Wavelengths modus:

     Use a given wavelengths scale (1)                 (2) Main menu
     Use a linear scaling :        (3) in wavelengths  (4) in wavenumbers
     Use a logarithmic scaling :   (5) in wavelengths  (6) in wavenumbers

Here, one can select the best wavelength scaling for the new material. In case of linearily or logarithmically equidistant points one can chose the starting point and the stepwidth. It turned out to be appropriate for most cases to have a standard file containing a convenient wavelength scale which is passed to the new material.

When the composition and the wavelength scale for the mixture are defined, one can enter the menu for the calculation of the new effective constants.

Effective media theories:

                                   Seperated grains            Aggregate structure
                                   (like Maxwell-Garnett)      (like Bruggeman)
     Spheres,needles,platelets  :         (1)                          (2)
     Arbitrary shapes           :         (3)                          (4)
     Last menu                  :         (5)

In this menu, the main decision is to chose either the Bruggeman or the Maxwell-Garnett approach. The functions for spheres, needles, and platelets are in fact a subset of the possibilities in the routines for arbitrary shapes but they are historically their precursors and optimized for the reduced shape set. After the selection of the general approach one enters automatically the shape selection for each component.

Shape selection:

     (1) Spheres                            (2) Needles
     (3) Platelets                          (4) Coated spheres
     (5) Coatings                           (6) Other shape
     (7) Embedding material

The set of shapes available may be a subset of this menu depending on the selection in the previous menu. In case of the Maxwell-Garnett approach one material has to be declared as embedding medium, in case of the usage of coated spheres another material must form the coating. Selecting the menu point Other shape one can directly enter a depolarization coefficient for the component. After a confirmation of these data the basic routines are called to compute the effective dielectric functions which are stored for the material declared as mixture.

2.2 Data files

All data files treated as input or output of the program have the same structure. They are ASCII files containing lines with three numbers separated by blanks. Every line represents one wavelength point. The files have to consist of at least 2 lines. Four different file types are recognized automatically according to their file extensions. The first letter of a file extension states whether the first column contains wavelengths (in cm) (letter “l”) or wavenumbers (in cm^{−1}) (letter “z”). The next two letters stand for the content of the second and third column. An “nk” states that they have to be considered as optical constants n and k and “ee” leads to an interpretation of the data as real and imaginary part of the dielectric function ϵ′ and ϵ′′. All files with other extensions are rejected by the program.

3 System requirements

The program is written in standard FORTRAN 77 so that it can be compiled on all machines providing an f77 compiler. Due to the lack of standardized graphics routines an adaption to the graphics libraries available on different machines is necessary. This adaption has to be done in the minimal graphics library of the program (GRAPHMIN) which provides all necessary graphics routines based on simple functions as line drawing or label setting. Furthermore, this file contains the system dependent definition of SMLPAUSE which provides a delay of 3 seconds used to underline different warning messages. There are no system dependent functions and subroutines outside of GRAPHMIN ! You might only want to change the path delimiter symbol in NAMECHEC for the DOS version from ‘/’ to ‘álthough this is not necessary.

Uptil now, there exist versions of GRAPHMIN using the IBM Professional Fortran graphics library for PCs, the Microsoft Fortran graphics library for PCs and the Mongo graphics subroutines for SUNs and VAXes. The programs based on the MONGO graphics functions may be executed within gterm (SunView) or within xterm (XWindows, OpenWindows). These terminal programs have to be able to create a Tektronix4101 graphics window and to close it after the graphics channel is closed.

The program does not use large data arrays so that the storage requirement is mainly dependent on the compiler efficiency and the graphics routines linked. The running size is between 170 and 200 kB for the PC versions and 680 kB for the SUN versions.

4 Local particularities - Jena

All PC versions available on the net are compiled to use a numerical coprocessor. On machines without physical coprocessor it may be emulated by Franke or other software coprocessors. On the SUNs the gterm should be called with the options gterm -G -Gopen show -Gclose blank emc to enable a correct handling of the graphics window and to start the Effective Medium Calculator directly. The xterm available on the Alpha machines does not close the graphics window after its release so that it has to be closed by hand.

5 Limitations and bugs

In this version the number of wavelengths to be treated for each material is restricted to 256. At most six materials, including vacuum, can be mixed to form a seventh one. The files containing the optical data of the different materials have to follow the conventions for names and structures discussed above. Different file structures may cause abnormal program termination.

In the Bruggeman approach the selection of the correct root of the polynomial is not guaranteed for materials with very large (|ϵ| > 1000) dielectric functions. In case of high order polynomials for materials with very large dielectric functions it may happen that the method for finding the complex roots does not converge so that the program does not terminate. Uptil now an exception handling for this case is not yet implemented.

6 Description of the different parts of the program

6.1 Main program (EFFMED, HEADMENU, INITDATA)

These routines provide the outer surface of the program. They show the most important parameters of all sets of optical constants loaded into the program, initialize the data at the start of the program and set up the main menu for the data handling.

HEADMENU is the routine showing the parameters of all materials loaded. It is called by all selection menus so that they contain always a survey on the most recent parameters. INITDATA resets the wavelength ranges and filling factors of all materials at the program start. EFFMED contains the main menu allowing the selection of the file operation, graphics and computational functions.

6.2 File operations (READCNST, READFILE, SAVECNST, SAVEFILE, NAMECHEC)

The file operations treat always one material which may be given as optical constants or dielectric functions versus wavelength (in cm) or wavenumber (in cm^{−1}). The files have to consist of lines containing three ASCII numbers separated by blanks. The name of a data file is used to denote the material in the menus. The extension determines which kind of data shall be written to the file or how the data lines in the file have to be interpreted: lnk - wavelength n k znk - wavenumber n k lee - wavelength ϵ′ ϵ′′. zee - wavenumber ϵ′ ϵ′′. All files with other extensions are rejected.

The read and write of data files contains two steps. READCNST and SAVECNST are interface procedures that ask for the component to be saved, that select the optical constants of this component from the field of constants, that extract the minimum and maximum wavelength from the data, and that organize the data in an ascending order with wavelength. The routines READFILE and SAVEFILE use only one field of optical constants. They ask for a filename and transform the data depending on the NAMECHEC result into wavelength and n and k or the format required for storage. They are the procedures reading and writing the data on the disks. NAMECHEC analyses the filename given by the user, removes the path from it and extracts its extension which is translated into the NAMECHEC result.

6.3 Graphics (GRAPHIC, PLOT, GRAPHMIN)

The graphics routines allow to show the sets of optical constants of up to four materials. Only the internal representation of the data as wavelength (in cm) and optical constants n and k will be plotted. To avoid confusion in graphs with several materials n and k are plotted in separate diagrams. According to experience with plots of optical data, the scales in one direction are chosen to be logarithimally when the data span a range of more than the factor 80. Otherwise, the program uses a linear scale.

GRAPHIC is an interface routine that asks for the materials to be plotted, selects their constants n and k and calls the subroutine PLOT two times to plot these quantities. PLOT uses the basic graphics functions provided by GRAPHMIN to set up the plot. After an initialization of the graphics area and the set up of the coordinate system the data given to PLOT are shown as linegraphs. The routine waits for an ⟨Enter⟩ (⟨Return⟩) of the user to show the second graph or to return to the main menu. GRAPHMIN contains the graphics routines: GRINIT initializes the graphics window and sets up the coordinate system with the kind of axis scaling chosen by the calling program, GRDRAW plots linegraphs for single functions, GRAXIS produces the axis labels and uses GRPRINT, GRCLOSE closes the graphics window, WAIT stops program execution until the user presses ⟨Enter⟩ and SMLPAUSE produces a three seconds pause.

6.4 Parameter changes (PARMMENU, INITCN, ADDCOMP, REMCOMP, FCHANGE, SEARCH)

This menu and the subroutines provide the tools to set up the parameters for the mixture. Components may be added and removed. Their volume fractions may be changed. The wavelength scale selection and the calculation menu can be called. Every mixture has to consist of at least two materials and the sum of their volume fractions has to be 1. Otherwise, no entry to the calculation menu is possible.

PARMMENU is the menu to call these functions. INITCN resets all parameters for the mixture material when PARMMENU is called. ADDCOM and REMCOM add or remove a component, respectively. They both use SEARCH to look whether the component is already present in the mixture or not. FCHANGE asks for the volume fraction of the materials and computes the total volume fraction of all materials in the mixture.

6.5 Wavelength scale (WAVEMENU, WAVETAKE, WAVESCAL, ZSCAL)

Before computing the effective dielectric constants of an inhomogeneous material, the wavelength points have to be determined where the computation is to be done. One can chose between an equidistant scale in wavelengths or wavenumbers, logarithmic scales and a system of wavelength points given by an arbitrary material loaded into the program. The possible wavelength range is always limited to the minimum range which is covered by all components in the mixture. Consequently, the wavelength scale selection has to be redone when changing the materials involved. The effective medium computation cannot be called without a valid wavelength scale.

WAVEMENU is the selection menu to chose the five different treatments. WAVETAKE asks for the material which wavelength scale is to be used for the mixture, removes points which are outsided of the interval covered by all materials in the mixture and assigns this wavelength scale to the mixture material. WAVESCAL asks the user whether to take a linear or logarithmic scale in wavelength, determines the lowest possible starting point and asks for the starting point to be used and the stepwidth. The program controls that the number of wavelength points covering the whole interval is not above 256. Then, the array of wavelength points of the mixture material is filled with these values. ZSCALE does the same except for wavenumbers instead of wavelengths.

6.6 Effective medium computation (CALCMENU, MGT, BGT, UNIVBG, UNIVMG, SHAPEMG, SHAPEBG, UNISHAPE, UNIMGSH, POLY-NOM, CPLXNLST)

This complex contains the real effective medium computational routines. One has to chose whether the Maxwell-Garnett or the Bruggeman approach is to be applied. Furthermore, the shapes of the different components have to be established. Finally, the effective constants are computed and assigned to the mixture material.

CALCMENU is the menu for the selection of the theory to be applied. The main criterion is to chose either the Maxwell-Garnett or the Bruggeman approach. One of the shape selection routines SHAPEMG, SHAPEBG, UNISHAPE, or UNIMGSH is called which allows the selection of the material shapes in the mixture possible in each approach. The shape numbers are transmitted to the corresponding computational programs MGT, BGT, UNIVBG, UNIVMG. The simple Maxwell-Garnett program MGT can treat four configuarations: spheres, needles, platelets, and the embedding medium. The simple Bruggeman program BGT treats three configuarations: spheres, needles, and platelets. The extended Maxwell-Garnett program UNIVMG can handle spheres, needles, platelets, core-mantle particles, grains with arbitrary depolarization factors, and the embedding medium. The extended Bruggeman UNIVBG can handle spheres, needles, platelets, core-mantle particles, and grains with arbitrary depolarization factors. In fact, MGT and BGT are the older versions of UNIVMG and UNIVBG with reduced set of shapes and less general but slightly faster computation of the T-matrices. The Maxwell-Garnett programs compute the T-matrices of all materials within the embedding medium, sum them up and calculate the effective constants for the whole mixture straight forward. The Bruggeman programs also compute the T-matrices of the different materials but since they depend on the seeked effective constants ϵ^{∗} they are not given as numbers but as coefficients in the powers of ϵ^{∗} separated for the nominator and denominator of the T-matrices. Since the sum of all T-matrices has to be zero, the denominator polynomial of all materials is multiplied by the nominator polynomial of all other materials.

This is done by POLMULT which computes the new polynomial coefficients from the coefficients of two polynomials. Finally, the sum of the polynomials of all materials is computed and CPLXNST tries to find all its roots. A large part of the roots may be excluded because of negative imaginary parts of the resulting dielectric functions. The most appropriate of the remaining roots is selected by the criterion of the lowest distance from an average of the dielectric functions of the materials involved.

6.7 Used data structures and the data exchange between different parts

The main data fields for wavelength, n and k for all materials form the central COMMON block which is accessed by most routines. Moreover, there are COMMON blocks for all datas shown in the menus as material names, minimum and maximum wavelength, number of wavelength points, and volume fractions. Their COMMON blocks are OPTCST, FNAMES, MINMAX, ANZ and FRACT. These quantities remain static during the run of the program unless the user changes them explicitiely. The data exchange concerning all other quantities is resricted to single materials or particular quantities and is performed via parameters in subroutine calls. This especially concerns the shapes of the components in a mixture and the full path names of the material files. All real data are declared as real*4 according to the accuracy intended to obtain for the data of the effective media.

7 Source files

The following files contain the sources for the different routines:

emc.for: EFFMED, HEADMENU, INITDATA

iofcts.for: READCNST, SAVECNST, READFILE, SAVEFILE, NAMECHEC

graphic.for: GRAPHIC, PLOT

graphmin.for: GRINIT, GRDRAW, GRAXIS, GRPRINT, GRCLOSE, WAIT, COORD, SMLPAUSE

parmmenu.for: PARMMENU, INITCN, ADDCOM, REMCOM, FCHANGE, SEARCH

wavemenu.for: WAVEMENU, WAVETAKE, WAVESCAL, ZSCALE

calcmenu.for: CALCMENU, CHCKPARM, VALUEAT, MGT, SHAPEMG, BGT, SHAPEBG

univemt.for: UNIBG, UNISHAPE, UNIMG, UNISHMG

polynom.for: POLMULT, CPLXNST

8 References

Bohren C.F., Huffman D.R., 1983, Absorption and Scattering of Light by Small Particles, Wiley, New York

Ossenkopf V. 1990, Diploma thesis, Friedrich-Schiller-Universität Jena

Ossenkopf V. 1991, A&A 251, 210