Users guide, Part I: Optics programs

1.a The Effective Medium Calculator with Magnetic Dipoles

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

Abstract

The effective medium calculator with magnetic dipoles (NEMC) is a modified version of the effective medium calculator (EMC) which allows to combine media with nonvanishing magnetic dipole moments. Therefore, materials with relative permeabilities different from 1 or conducting particles with induced magnetic dipole moments may be treated. However, only two materials may be combined. According to the original program, it is designed for a completely interactive data processing. The computed constants can be stored or used in further calculations. All computations can be controlled by eye via graphical plots.

1 Basic algorithms

The computation of the effective dielectric constants and permeabilities of media with nonvanishing magnetic dipoles bases on the scattering matrix method introduced by Chylek & Srivastava (1983). Herein, the forward and backward scattering of the inhomogeneous sample is zero when the sample is embedded in a medium with the effective constants.

S(0) = 1/2 ∑_{n=1}^{∞}(2n + 1)(a_{n} + b_{n}) = 0

S(180^{∘}) = 1/2 ∑_{n=1}^{∞}(2n + 1)((−1)^{n+1}a_{n} + (−1)^{n}b_{n}) = 0 .  (1)

For particles small compared to the wavelength only the first term of the series expansion with the scattering coefficients a_{1} and b_{1} has to be considered.

Two different types of scattering coefficients are treated in the program. Using the coefficients for separated spherical grains

a_{1} = \frac{2i}{3} \frac{ϵ− ϵ^{∗}}{ϵ+ 2ϵ^{∗}} x^{3}
b_{1} = \frac{2i}{3} \frac{μ− μ^{∗}}{μ+ 2μ^{∗}} x^{3}+ \frac{i}{5} \frac{ϵ^{∗}μ^{2}+ ϵμ^{2}− 6ϵ^{∗}μ^{∗}μ+ 4ϵ^{∗}μ^{∗}^{2}}{ϵ^{∗} (μ+ 2μ^{∗})^{2}} x^{5}  (2)

gives a Bruggeman approach for the effective medium. With the scattering coefficients for coated particles

a_{1} = \frac{2i}{3} \frac{Σ_{ϵ}(ϵ^{m}− ϵ^{∗}) + rΔ_{ϵ}(ϵ^{∗}+ 2ϵ^{m})}{Σ_{ϵ}(ϵ^{m}+ 2ϵ^{∗}) + 2rΔ_{ϵ}(ϵ^{m}− ϵ^{∗})}x^{3}
b_{1} = \frac{2i}{3} \frac{Σ_{μ}(μ^{m}− μ^{∗}) + rΔ_{μ}(μ^{∗}+ 2μ^{m})}{Σ_{μ}(μ^{m}+ 2μ^{∗}) + 2rΔ_{μ}(μ^{m}−μ^{∗})}x^{3}

+ \frac{i}{5}(1− \frac{μ^{m}}{(4ϵ^{∗})} ×(\frac{5(Σ_{μ}− 4rΔ_{μ})^{2}(μ^{m}ϵ^{m}− μ^{∗}ϵ^{∗}) − 9Σ_{μ}^{2}(μ^{m}ϵ^{m}− 5μ^{∗}ϵ^{∗})}{[Σ_{μ}(μ^{m}+ 2μ^{∗}) + 2rΔ_{μ}(μ^{m}−μ^{∗})]^{2}}

−\frac{36r^{5/3}μ^{m}[μ^{c}^{2}(ϵ^{c} + ϵ^{m}) + (4μ^{m}^{2}− 6μ^{c}μ^{m})ϵ^{m}]}{[Σ_{μ}(μ^{m}+ 2μ^{∗}) + 2rΔ_{μ}(μ^{m}−μ^{∗})]^{2}}))x^{5}

with Σ_{ϵ} = ϵ^{c}+ 2ϵ^{m} , Δ_{ϵ} = ϵ^{c}− ϵ^{m}
and Σ_{μ} = μ^{c}+ 2μ^{m} , Δ_{μ} = μ^{c}− μ^{m},  (3)

one obtains a Maxwell-Garnett approach to the effective medium. The quantities ϵ and ϵ^{∗} denote the dielectric functions and μ and μ^{∗} the relative permeabilities of the particles and the effective medium, respectively. The upper indices ^{c} and ^{m} denote the the core and the mantle material and r is the volume fraction of the cores in the core-mantle particles. The size parameter x is defined as x = 2πa/λ×\sqrt{ϵ^{∗}μ^{∗}}. Additional terms with higher orders of the size parameter are neglected.

In the Maxwell-Garnett approach for two media Eqs. (1) give

a_{1} = 0 and b_{1} = 0  (4)

where the matrix medium is taken to be the coating and the included grains are taken as core material in the scattering coefficients (Eq. (3)). The equation for a_{1} gives a quadratic equation for ϵ^{∗} which has to be solved at first. The solution with positive imaginary part is selected. The equation for b_{1} gives a quadratic equation for μ^{∗} which contains additionally x depending on the real part of μ^{∗}. Here, the equation is solved iteratively, where the size parameter in each step is computed from the μ^{∗} value from the last step. Starting μ^{∗} is 1.0, the iteration is stopped when μ^{∗} remains constant within 10^{−4}.

In the Bruggeman approach Eqs. (1) lead to

a_{1}^{(1)} + a_{1}^{(2)} = 0 and b_{1}^{(1)} + b_{1}^{(2)} = 0  (5)

when the mixture contains two media only. The first equation again represents a quadratic equation for ϵ^{∗}. With the value of ϵ^{∗} the second equation is solved for two limiting cases. The program assumes that either the permeability of both media is equal to 1 or the size of the grains is sufficiently low that the x^{5} term can be neglected. The first limit is applied when |μ − 1| + 2 · 10^{−4} < 4/30x^{2} the second in case of the inverse relation. In both cases we obtain a quadratic equation in μ^{∗}, in the second case with the additional dependence on x. Here, the equation is again solved iteratively. In all quadratic equations the appropriate root is selected to have a nonnegative imaginary part.

For the physical foundation, mathematical details, and the limits of the applicability of this approach see Ossenkopf (1990).

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 with magnetic dipoles
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. Only two media may be present in the mixture and the sum of their volume fractions 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 (like Maxwell-Garnett)     (1)
     Aggregate structure (like Bruggeman)        (2)
     Last menu                                   (3)

Here one has to chose either the Bruggeman or the Maxwell-Garnett approach. In case of the Maxwell-Garnett approach the user is asked which material shall be declared as inclusions. The other one forms the matrix material. Finally, the particle sizes have to be defined. A zero value corresponds to the neglect of the induced magnetic dipole term. To reduce the amount of computer time it is also appropriate to select a zero size for such components which have according to their dielectric functions certainly no induced magnetic dipole moment. After a confirmation of these data the basic routines are called to compute the effective dielectric functions and permeabilities 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. Optical constants and relative permeabilities are stored in separate files. For the optical constants, 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.

For the input of magnetic media, permeability files have to be given with the same name as for the optical constants except that their extension is “lmu” or “zmu”. The scaling in wavelengths or wavenumbers has to be identical to that in the file of optical constants. In the file of permeabilities the lines contain wavelength (in cm) or wavenumber (in cm^{−1}), respectively, and real and imaginary part of the relative permeability. The existence of a permeability file is not required. In the storage procedures for the data of selected materials a permeability file is always produced even if it contains only μ values of 1.0.

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 160 and 180 kB for the PC versions and 650 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 nemc to enable a correct handling of the graphics window and to start the program 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.

Uptil now, only two media can be combined. A solver for high order polynomials as it would be necessary for mixtures of more materials is not yet included.

In the Bruggeman approach, only two limiting cases are treated. The program assumes that either the permeability of both media is equal to 1 or the size of the grains is sufficiently low that the x^{5} term can be neglected. This condition has to be fulfilled by both media so that permanent and induced magnetic dipole moments cannot be combined.

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, READMUFILE, SAVECNST, SAVEMU-FILE, NAMECHEC, NAMEPERM)

The file operations treat always one material which may be given as optical constants or dielectric functions and relative permeabilities versus wavelength (in cm) or wavenumber (in cm^{−1}). Optical constants and permeabilities are stored in separate files. 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. For the files of optical constants the following extensions mean: lnk - wavelength n k znk - wavenumber n k lee - wavelength ϵ′ ϵ′′. zee - wavenumber ϵ′ ϵ′′. All files with other extensions are rejected. The file extensions for the permeability files are generated automatically. The are “lmu” or “zmu” according to the wavelength scaling in the file of optical constants. Beside the wavelength or wavenumber, the data lines contain the real and imaginary part of the relative permeability. For the file input the wavelength points in the files for optical constants and permeabilities have to aggree. In the file output, this condition is always fulfilled.

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 and permeabilities 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 READMUFILE and SAVEMUFILE use only one field of material constants. They ask for a filename, call NAMECHEC and NAMEPERM and transform the data between the internal representation as wavelength, n, k, μ′, and μ” and the format for storage detemrmined by the NAMECHEC result. 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. NAMEPERM determines the name of the permeability file from the file name for optical constants and the NAMECHEC result.

6.3 Graphics (GRAPHIC, PLOT, GRAPHMIN)

The graphics routines allow to show the optical constants and permeabilities of up to four materials. For each material n, k, μ′, and μ” will be plotted versus wavlength (in cm). To avoid confusion in graphs with several materials every set is plotted in a separate diagram. 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, k, μ′, and μ” and calls the subroutine PLOT four 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. For the computation, every mixture has to consist of 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 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, CHKPARM, EMGT, EBGT)

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 and the sizes of the particles composing the mixture have to be defined. 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. It calls CHKPARM to test whether the wavelength points are defined and whether the sum of volume fractions is 1. EMGT is the routine for the Maxwell-Garnett computation. At first, the quadratic equation for ϵ^{∗} arising from the electric dipole moments is set up and solved. The solution with positive imaginary part is selected. With this value of ϵ^{∗}, the equation for μ^{∗} from the magnetic dipole moments can be constructed. It is a quadratic equation for μ^{∗} which contains additionally x depending on the real part of μ^{∗}. The equation is solved iteratively, where the size parameter x in each step is computed from the μ^{∗} value from the last step. Starting with μ^{∗} = 1.0, the iteration is stopped when μ^{∗} remains constant within 10^{−4}.

EBRGT contains the Bruggeman computation. As in EMGT, the quadratic equation for ϵ^{∗} arising from the electric dipole moments is set up and solved at first. The solution with positive imaginary part is selected. With the value of ϵ^{∗} the equation for μ^{∗} is solved for two limiting cases. Depending on the ratio between |μ − 1| + 2 · 10^{−4} and 4/30x^{2} it is either assumed that the permeability of both media is equal to 1 or that the size of the grains is sufficiently low that the induced magnetic dipole can be neglected and μ^{∗} does not longer depend on x. In both cases a quadratic equation in μ^{∗} is set up, in the second case with the additional dependence on x. Here, the equation is again solved iteratively. In all quadratic equations the appropriate root is selected to have a nonnegative imaginary part.

6.7 Used data structures and the data exchange between different parts

The main data fields for wavelength, optical constants and permeabilities of 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 the material names, minimum and maximum wavelength, number of wavelength points, and volume fractions. The 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. All real data are declared as real*4 according to the accuracy intended to obtain for the data of the effective media.

The COMMON block OPTCST in the routines cloned from the original effective medium calculator (emccloned.for) contains less data than this COMMON block in the other routines since the original routines do not use the permeability fields. As the permeability fields are only appended to the other fields in this block and the access in the original routines is restricted to the first fields, the different block lengths have no influence on the data exchange.

7 Source files

The following files contain the sources for the different routines:

nemc.for: EFFMED, GRAPHIC

niofcts.for: READCNST, SAVECNST, READMUFILE, SAVEMUFILE, NAMEPERM

ncalcmenu.for: CALCMENU, VALUEMUAT, EMGT, EBGT emccloned.for: HEADMENU, INITDATA, NAMECHEC, PARMMENU, INITCN, ADDCOM, REM-

COM, FCHANGE, SEARCH, WAVEMENU, WAVETAKE, WAVESCAL, ZSCALE, CHCK-PARM, PLOT

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

All routines within emccloned.for are completely identical to the routines with the same names in EMC.

8 References

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

Chylek P., Srivastava V. 1983, Phys. Rev. B 27, 5098

Ossenkopf V. 1991, A&A 251, 210

Ossenkopf V. 1991, A&A 251, 210 Erratum