Fitting index data in OpticStudio

This article explains what to do if the material you wish to design with is not built in to OpticStudio. It covers the OpticStudio Glass Fitting Tool and Transmission Data definition.

Authored By Sanjay Gangadhara


Article Attachments


Fitting of index data in OpticStudio will be demonstrated in this article using the Glass Fitting Tool, located under Libraries...Materials Tools...Glass Fitting.

Dispersion Coefficients

OpticStudio includes catalog information for hundreds of glasses from more than 30 vendors (such as Schott, Corning, Ohara, and Chengdu) around the world. In addition to these vendor specific catalogs, OpticStudio includes data which has been compiled from published sources, such as Laikin’s Lens Design.

Calcite, for example, is one of the many materials in OpticStudio by which the data was obtained by a published source (Handbook of Optics Vol. II). The sources of each material in these catalogs (INFRARED, BIREFRINGENT, and MISC) are documented in the chapter of the OpticStudio Help System entitled "Using Material Catalogs".

Given that there are hundreds of glasses from various vendors and documented sources, it is often the case that the materials you are designing with are included in OpticStudio’s Material Catalog database. These glasses are “built-in” to OpticStudio. If the materials you wish to use are not included in OpticStudio, you can take various approaches to modeling them in OpticStudio.

Most commonly, data regarding a specific glass is provided in the form of coefficients corresponding to a specific glass dispersion formula. Some examples of commonly recognized formulas are the Schott formula, the Sellmeier formulas 1-5, the Herzberger formula, and the Conrady formula. OpticStudio supports 11 different dispersion formulas, from which the coefficients for the selected formula can be entered into OpticStudio to properly model the dispersion.

Let’s focus our attention on the Material Catalog in OpticStudio, which may be opened by clicking Libraries...Material Catalog from the ribbon bar. Note that as different dispersion formulas are selected from the "Formula" pull-down menu, the coefficients which appear in the Glass Catalog dialog box change accordingly:




Sometimes, the dispersion data available for the glass you wish to model is not provided in terms of coefficients from a dispersion formula. Instead, you may only have a particular set of wavelength-index pairs made available to you by a vendor or other source. That’s okay. You can still use the tools within OpticStudio to “fit” the data for you.


Using the Glass Fitting Tool

For a given set of dispersion data, OpticStudio can fit the data to any one of four dispersion formulas:  the Schott, Herzberger, Conrady, or Sellmeier 1. For a complete definition of each of these formulas, please refer to the OpticStudio Help System section at The Libraries Tab...Optical Materials Group...Using Material Catalogs...The Glass Dispersion Formulas.

Basically, OpticStudio will calculate the coefficients of the chosen formula which best fits your data set. These coefficients are then stored into the glass catalog for your new glass, and are used to calculate the index of refraction for any given wavelength.

How is this done? Using the Glass Fitting Tool, which can be accessed by selecting Libraries...Materials Tools...Glass Fitting from the main menu:




Selecting this feature will activate the Glass Fitting Tool dialog box:




Data given in terms of wavelength-index pairs are provided to the Glass Fitting tool via an ASCII text file, which must have the following format:



λ1  n1

λ2  n2

where T0 is the temperature (in degrees C) and P0 is the pressure (in atmospheres) at which the data were measured, and λ is in microns. The name of the text file containing these data must have a .IND extension, and this file must be located in the {Zemax}\Glasscat directory. More information about the file format may be found in the OpticStudio Help System at The Libraries Tab...Optical Materials Group...Materials Tools...Glass Fitting. While there is no upper limit to the number of data points that may be provided in the file, at least three points are required to get a fit to the Conrady dispersion formula, and six or more (and preferably twelve to fifteen) points are required to get a fit to the Schott, Herzberger, or Sellmeier 1 dispersion formulas.


Fitting the Data and Creating a New Glass

An example of a properly formatted ASCII file containing data for BK7 glass (BK7.IND) may be found in the ZIP file located at the top of this article. This file contains data that was taken at 20 degrees C and 1 atmosphere:




After saving the file (BK7.IND) in the folder '\Documents\Zemax\GLASSCAT' this data can be used with the Glass Fitting Tool to create a new glass, which can be added to any one of the existing user-defined glass catalogs (we do not allow new glasses to be added to any of the glass catalogs provided with the OpticStudio installation; those catalogs get overwritten every time a new version of OpticStudio is installed, and thus any user-defined glasses added to these catalogs would be deleted during each upgrade of OpticStudio!). For example, we can create a new version of BK7 called BK7_NEW and add it to the MYMISC catalog:



We will fit this data to the Sellmeier 1 dispersion formula, as this is the same formula used to characterize BK7 in the Schott catalog. The fit is performed by hitting the “OK” button. Whether or not a new glass is created, a text output window will be generated which shows the results of the fit:


text output


Values for the best-fit dispersion coefficients are shown at the top of this window, followed by values for the maximum and RMS fit error. The RMS error is the RMS fit error between the given data and the index data generated using the resulting fit coefficients. The maximum error, on the other hand, is the largest error between the fit and any one data point. Both of these numbers can be compared to the magnitude of the index of refraction, which is a dimensionless parameter.

A table of data is then presented in the text output window. The first two columns of this table represent the input data. The third column shows values for the index obtained at each input wavelength using the best-fit dispersion coefficients, and the last column shows the difference between the input and fitted values for the index at each wavelength. The results indicate a very good fit of the data to the Sellmeier 1 dispersion formula over a wide range of wavelengths (0.3 to 2.5 microns). However, it is generally recommended that the input data be fit to each of the models in turn, to see which gives the lowest errors.

If the input data had been provided at a pressure different from 1 atmosphere, both the wavelength and index data would have first been converted to relative values at 1 atmosphere. This step is performed by OpticStudio prior to fitting the data, and is done so that the dispersion coefficients generated by the Glass Fitting Tool will always describe the glass at atmospheric pressure, regardless of what pressure the data were measured at. More information on how the input data are converted to relative values may be found in the Knowledgebase article "How to fit temperature-dependent index data to the OpticStudio thermal model".

If it had been specified in the Glass Fitting Tool that a new glass should be added to one of the existing user-defined catalogs once the fitting was complete – as it was in this case to “MYMISC.AGF” – now if we open the Materials Catalog Tool and go to the user-defined catalog MYMISC, we will find that a glass named BK7_NEW will appear under the “Glass” field:




Note that the formula selected during the fitting is shown under “Formula”, and that the dispersion coefficients which characterize this glass match the values provided in the fitting text output window. Also note that the minimum and maximum wavelengths correspond to the inputted data range (with a 1 nanometer buffer on either end), and that values for the d-light index (Nd) and Abbe number (Vd) agree (within round-off error) with the corresponding values for the glass N-BK7 that is listed in the Schott catalog.

The other parameters for this glass may be edited accordingly in the Materials Catalog dialog, including the thermal coefficients, density, cost, stain resistance, acid resistance, etc. If data for the thermal dependence of the index is also available, the Glass Fitting Tool can be used to determine the best-fit thermal coefficients for the glass as well. More information on this may be found in the Knowledgebase article "How to fit temperature-dependent index data to the OpticStudio thermal model".


Defining Transmission Data

In addition to fitting index data, it is also important to define the transmission properties of the glass in OpticStudio, if any exist. OpticStudio models the transmitted intensity user Beer’s Law:



where a is the absorption coefficient and t is the path length through the glass. The parameter a generally depends upon wavelength and has units of inverse length.

To modify or set the transmission data for a glass, select the “Transmission” button near the bottom right hand corner of the Materials Catalog dialog:


Materials Catalog dialog


Selecting the “Transmission” button invokes the Transmission Data dialog, which includes a spreadsheet of 3 different columns:  Wavelength, Transmission, and Thickness. Wavelengths are always entered in micrometers, and thicknesses are entered in millimeters, regardless of the system Lens Units.




Multiple data points may be defined in the transmission data editor. Internally, OpticStudio converts the data to transmission “per mm,” and interpolates between the defined wavelengths. If a ray is being traced at a wavelength outside of the wavelengths defined in the Transmission Data editor, then the data for the closest wavelength is used. Otherwise, OpticStudio performs a linear interpolation between data points defined.

Note that if transmission data has been omitted, then OpticStudio assumes the internal transmission for a material is 1.0 at all wavelengths. It is very important to verify the transmission data to ensure the most accurate results.


Was this article helpful?
3 out of 3 found this helpful



Article is closed for comments.