This article describes the implementation of the Mie scattering model in Zemax. An example of using this model to simulate scattering in the atmosphere is provided.
This article is also available in Japanese.
Authored By: Sanjay Gangadhara
Introduction
This article is also available in Japanese.
Mie theory (also known as Lorenz-Mie theory or Lorenz-Mie-Debye theory) describes the analytic solution to Maxwell’s equations for scattering of light from spherical particles. The theory allows the size of the particle to be arbitrary, i.e. the solution is applicable to all ratios for the sphere radius to the wavelength. As this ratio becomes small (<< 1), the Mie model approaches the familiar results of Rayleigh scattering.
As described in the literature1, Mie theory is important for modeling atmospheric scattering in haze and clouds. The model also can be used to describe the appearance of common materials such as milk, latex paint, and biological tissue.
The Mie model has been implemented in Zemax as a bulk scattering distribution in non-sequential mode. The computation is based on the results provided in Chapter 4 and Appendix A of the text by Bohren & Huffman2. A description of the model inputs is given on the next page of this article. An example of using the Mie code to model atmospheric scattering is then provided.
Code inputs
To apply the Mie scattering distribution to a volume in non-sequential mode,select the Mie.DLL file under the Bulk Scatter tab of the object propertiesdialog box for the volume:

This DLL requires 5 inputs. Theyare:
1. Particle index. This is the (real)refractive index of the scattering particles. The refractive index of thebackground medium, i.e. the medium in which the particles are located, isdetermined by what is specified in the “Material” column for the volume. If theparticle index matches the background medium index (i.e. if the difference inindices is less than 10-6), then no scattering takes place, since inthis case the particles are indistinct from the background. If the particleindex is set to be <= 0.0, then no scattering takes place (the DLL isignored).
2. Size (microns). This is the radius (r)of the spherical particles. If the value is set to be <= 0.0, then noscattering takes place (the DLL is ignored). The maximum allowable value for thesize is based on the maximum allowable value for the normalizedsphere size (x = 2prnbackground/l), which is currently set to be 1934. If thenormalized sphere size exceeds 1934, then no scattering takes place; for suchlarge spheres, it may be more appropriate to model the spheres themselves inZemax, rather modeling the effective scattering distribution which resultsfrom the spheres.
3. Density (cm-3). Thedensity (ns) of scattering particles in the volume. If this value isset to be < 0.0, then no scattering takes place (the DLL is ignored). If thisvalue is set to be > 0.0, then this value is used – along with the scatteringcross-section (ss) calculated by the code– to determine the mean-free path for scattering in the volume: lmfp= 1/nsss. If the density isset to be = 0.0, then the mean-free path for scattering in the volume will beequal to the value specified in the “Mean Path” parameter entry. Thus, when thedensity is > 0.0, the value specified in the “Mean Path” parameter entry isignored, as long as the "Mean Path" parameter value is > 0.0; the DLL will be ignored, i.e.no scattering takes place, if the "Mean Path" parameter is set to be <=0.0.
4. Min. thresh. The scattering calculation inZemax involves integration of the probability distribution function (moredetails are provided in the article entitled “Howto Create a User-Defined Scattering Function”). The integral is usuallytaken from 0 to p in the polar direction (andfrom 0 to 2p in the azimuthal direction). However,for a peaked distribution, it is computationally inefficient to perform thisintegral over regions of angle space in which the probability is zero. Theminimum threshold value allows the user to define a smaller upper limit for thepolar integral. The upper limit is determined by the location in polar anglespace at which the probability distribution is equal to a small fraction of thepeak of the distribution; the fraction is equal to the minimum threshold value.For example if the minimum threshold value is set equal to 0.01, then the upperlimit for the polar integral will be the location at which the probabilitydistribution is equal to 0.01 times the peak probability. If the input value isset to be <= 0.0 or >= 0.5, a default value of 0.001 is used.
It isimportant to be careful when specifying this value. In general, the probabilitydistribution for larger particles is more peaked, so it may be tempting to setthe minimum threshold to a larger value. However, the angular resolution of thescattering calculations is fixed (0.1 degrees), and thus as the probabilitydistribution becomes more peaked, the drop-off in probability from one angle tothe next is steep. Therefore, to ensure that enough data points are used in theintegration, it is generally necessary to decrease the minimum threshold valuein this case.
The best way to determine the appropriate value for thisparameter is to compare the results as this parameter is varied. Start with avalue of 0.01 and then reduce the value by a factor of 10. If the results changesignificantly, continue reducing the value until the results converge. Beyondthis point, any more reduction in the value simply increases computation timewithout increasing computationaccuracy.
5. Transmission. This is an attenuationfactor which reduces the intensity for any ray which undergoes a scatteringevent. This factor allows the user to account for absorption of energy in thescattering sphere. Absorption of energy in the background medium will bedetermined by the Transmission properties for the material specified in the“Material” column of the volume (as described in the article entitled “FittingIndex Data in Zemax”).
Although the imaginary component of therefractive index for the scattering particles affects absorption – which can becharacterized by the Transmission input to the DLL – this component can alsoaffect the probability distribution for scattering. However, the probabilitydistribution is only affected if the magnitude of the imaginary component is ~10-2 or larger, which corresponds to highly absorbing particles.Thus, the effect of the imaginary component on the scattering distribution isneglected in the Mie model presented here.
Finally, the “Angle” parameteris not used by the DLL. However, if value set for the “Angle” parameter is <=0.0 or > 180.0, then no scattering takes place (the DLL isignored).
The Mie scattering distribution is characterized by twodimensionless parameters: the ratio of the refractive indices for the scatteringparticle and the background medium (m =nparticle/nbackground) and the normalized sphere size (x =2prnbackground/l) . Separate calculations of the Miedistribution must be performed for each (m,x) pair, but oncethese calculations are complete the results are stored in memory and can beused to trace any number of rays. Data for up to 10,000 pairs of (m,x)values can be stored in memory by the DLL. Once this limit is exceeded, no moreMie data can be stored, and no scattering will occur for any subsequent (m,x)pairs. For almost all applications of interest, the limit of 10,000 pairs ismore than sufficient.
An example: Scattering in the atmosphere
A simple example has been set up to illustrate use of the Mie code. The archive (.ZAR) file for this example may be downloaded from the last page of this article.
In this example, a Source Ellipse is used to model emission from the sun. The spectral distribution of this source is determined by its blackbody temperature (for more details, read the article entitled “How to Model Colored and Tristimulus Sources”):

A temperature of 5780 K was chosen as representative of the Sun’s surface3.
A Rectangular Volume object is used to simulate the atmosphere, and the observed color of the atmosphere is determined using a Detector Color object (for more details, read the article entitled “How to Measure and Optimize Color Data”). Another Detector Color object is used to provide the observed color of the Sun’s spectrum. Note that this basic example is not to scale, but simply intended to illustrate use of the Mie code for such a system.
The system is defined in two configurations. In configuration 1, the parameter inputs to the Mie DLL are specified such that the model represents the Rayleigh limit for scattering (normalized sphere size << 1):

A particle index of 1.33 is used, corresponding to the index of refraction of water. The material specified for the Rectangular Volume object is blank, i.e. the volume is made of air. Thus, this model represents scattering from water droplets in air.
The size of each droplet is 7 nm. For visible wavelengths (l between 0.4 and 0.7 mm), the normalized sphere size is therefore between 0.063 and 0.11 (<< 1, corresponding to the Rayleigh limit). The particle density is defined to provide a scattering mean-free path of approximately a few mm for this system (this data is not reported by the DLL, but was determined by internal probing of the code).
Tracing 10 million rays in this system, we find that the resulting color of the atmosphere is blue, which results from the strong (1/l4) wavelength dependence of scattering in the Rayleigh limit (see the article entitled “Bulk Scattering with the Rayleigh Model” for more details):

The color can be characterized by its chromaticity coordinates, using the NSDE operand in the merit function (for more details, read the article entitled “How to Measure and Optimize Color Data”):

Comparing these values to those generated for the solar spectrum (shown by lines 7 and 8 in the merit function), we can clearly see the shift in the color that occurs in the limit of Rayleigh scattering.
In configuration 2, the size of the scattering particles is significantly increased, to bring the system from the Rayleigh limit to the Mie domain:

The particle density has been reduced, to maintain the scattering mean-free path at ~ a few mm, as in configuration 1 (again, this data is not reported by the DLL, but was determined by internal probing of the code). The minimum threshold value has been reduced as well, to ensure that the probability distribution is adequately sampled in this large-particle limit.
Tracing 10 million rays in this configuration, we find that the color of the emission is nearly identical to that of the source spectrum:

This result is quantitatively confirmed using the NSDE operand:

The results indicate that the scattering distribution has little wavelength dependence in the Mie domain, consistent with descriptions provided in the literature4. These results explain why light near the Sun looks white (i.e. the same color as the Sun). The results also explain why clouds look white: the water droplets which make up clouds are much larger than the molecules which make up the atmosphere (these molecules were modeled as water for this simple example, but in reality would made up of nitrogen and oxygen), so the observed color does not shift when sunlight is scattered in clouds but does shift when this light is scattered in the atmosphere.
Summary
Scattering from spherical particles is described by the Mie model. This model has been implemented in Zemax as a user-defined DLL, to be used with a bulk scattering volume in non-sequential mode. The model provides an accurate description of the scattering process, for both the general case of arbitrary sphere size and when the sphere size is much smaller than the wavelength, i.e. in the Rayleigh limit.
References
1http://en.wikipedia.org/wiki/Mie_theory
2Craig F. Bohren and Donald R. Huffman, "Absorption and Scattering of Light by Small Particles", John Wiley & Sons (1983).
3http://en.wikipedia.org/wiki/Sun
4http://hyperphysics.phy-astr.gsu.edu/Hbase/atmos/blusky.html