Does any one know why calculation of the refractive index vs the temperature is different between the two softwares?
I’m not asking for glasses that have different parameters, (the reason is obvious) but for glasses which have same parameters and ways of calculation. Results are the same across the spectrum but not when the temperature changes.
You can try almost any Schott glasses as parameters are given by the vendor for both softwares.
It’s a bit frustrating. 😀
Best answer by MichaelH
Hey John,
Are you also asking on CodeV’s forum? I don’t really know how CodeV implements it, but Zemax is actually more than just the 3 equations listed in the Help File.
And the steps are:
Scale the wavelength to air at the reference temperature of the glass and a pressure of 1.0 atmospheres.
Compute the relative index of the glass at the reference temperature from the dispersion formula.
Compute the index of air at the reference temperature of the glass.
Compute the absolute index of the glass (relative to vacuum) at the reference temperature of the glass.
Compute the change in absolute index of refraction of the glass at the surface temperature.
Compute the index of air at the system temperature and pressure
Compute the index of the glass relative to the air at the system temperature and pressure
It’s a pretty complex algorithm to convert from relative index (air = 1.0) to absolute index (air = 1.0003) in order to use Schott’s formula. When you go through all the equations in detail, Zemax is correct.
From my understanding with my colleagues who primarily design in CodeV, they always rely on the thermal analysis of Zemax. It’s a small population sample, but from a handful of people who use both, Zemax is more trusted.
First, I’m not an expert user of CodeV; However, I checked the reported refractive index for N-BK7 in both Zemax and CodeV at the same wavelength with and without the environmental factors on at the reference temperature for N-BK7 (20 Deg). My assumption is that this value can be checked against the Sellmeier formula used for calculating the index, i.e, that the change in index will be 0 at the reference wavelength. Zemax reports the same index of refraction to arbitrary precision. CodeV deviates. If I change the evaluated temperature by 2 Deg up in CodeV (from 20 Deg to 22 Deg) I can recover the correct answer. I don’t know why CodeV does this or if it is a bug or something subtle in how to implement the reference temperature etc.; however, I do think that Zemax is reliable in this case.
Are you also asking on CodeV’s forum? I don’t really know how CodeV implements it, but Zemax is actually more than just the 3 equations listed in the Help File.
And the steps are:
Scale the wavelength to air at the reference temperature of the glass and a pressure of 1.0 atmospheres.
Compute the relative index of the glass at the reference temperature from the dispersion formula.
Compute the index of air at the reference temperature of the glass.
Compute the absolute index of the glass (relative to vacuum) at the reference temperature of the glass.
Compute the change in absolute index of refraction of the glass at the surface temperature.
Compute the index of air at the system temperature and pressure
Compute the index of the glass relative to the air at the system temperature and pressure
It’s a pretty complex algorithm to convert from relative index (air = 1.0) to absolute index (air = 1.0003) in order to use Schott’s formula. When you go through all the equations in detail, Zemax is correct.
From my understanding with my colleagues who primarily design in CodeV, they always rely on the thermal analysis of Zemax. It’s a small population sample, but from a handful of people who use both, Zemax is more trusted.
The results seem to agree well, I feel this python snippet makes the steps clearer and easier to debug:
# Expected values taken from https://support.zemax.com/hc/en-us/articles/1500005576002-How-OpticStudio-calculates-refractive-index-at-arbitrary-temperatures-and-pressures# and are suffixed with "_exp"# inputs
lmbda_mum = .55
T0_degC = 20
P0_atm = 1# S stands for System
TS_degC = 30
PS_atm = 2defn_air_units(lmbda_mum, rel_P, T_degC):# from Zemax doc The Setup Tab > System Group (the Setup Tab) > System# Explorer > Environment > Index of Refraction Computation # and This formula for the index of air is from F. Kohlrausch, Praktische # Physik, 1968, Vol 1, page 408# https://support.zemax.com/hc/en-us/articles/1500005576002-How-OpticStudio# -calculates-refractive-index-at-arbitrary-temperatures-and-pressures
n_ref = (
1 + (6432.8 + 2949810 * lmbda_mum**2 /(146*lmbda_mum**2-1) +
25540*lmbda_mum**2/(41*lmbda_mum**2-1)) * 1e-8
)
n_air = 1 + (n_ref - 1) * rel_P / (1.0 + (T_degC-15)*3.4785e-3)
return n_air
# Compute the index of air at the reference temperature of the glass.
n_air_P0_T0_exp = 1.00027308
print(n_air_P0_T0_exp, n_air_units(lmbda_mum, P0_atm, T0_degC))
# Compute the index of air at the system temperature and pressure
n_air_PS_TS_exp = 1.00052810
print(n_air_PS_TS_exp, n_air_units(lmbda_mum, PS_atm, TS_degC))
# Scale the wavelength to air at the reference temperature of the glass and a# pressure of 1.0 atmospheres.
lmbda_rel_exp = .55014022
print(lmbda_rel_exp,
lmbda_mum * n_air_units(lmbda_mum, PS_atm, TS_degC) / n_air_units(lmbda_mum, P0_atm, T0_degC))
# Compute the relative index of the glass at the reference temperature from# the dispersion formula. dispersion coefficients/formula for Schott.AGF # catalog, for N-BK7 glass
K1=1.03961212
L1=6.00069867e-3
K2=2.31792344e-1
L2=2.00179144e-2
K3=1.01046945
L3=1.03560653e2defsellmeier1(lmbda, K1, K2, K3, L1, L2, L3):# from Zemax's doc at# The Libraries Tab > Optical Materials Group > Using Material Catalogs# > The Glass Dispersion Formulas > The Sellmeier 1 Formula
n2m1 = K1*lmbda**2/(lmbda**2-L1) + K2*lmbda**2/(lmbda**2-L2) + K3*lmbda**2/(lmbda**2-L3)
return (n2m1+1)**0.5
n_BK7_at_lmbda_rel_exp = 1.51851533
print(n_BK7_at_lmbda_rel_exp, sellmeier1(lmbda_rel_exp, K1, K2, K3, L1, L2, L3))
# Compute the absolute index of the glass (relative to vacuum) at the reference# temperature of the glass.
n_BK7_abs_T0_P0_exp = 1.51893001
print(n_BK7_abs_T0_P0_exp, n_BK7_at_lmbda_rel_exp * n_air_P0_T0_exp)
# Compute the change in absolute index of refraction of the glass at the # surface temperature.
D0=1.86e-6
D1=1.31e-8
D2=-1.37e-11
E0=4.34e-7
E1=6.27e-10
Ltk=1.7e-1
Temp=20
DT = TS_degC - Temp
S_tk = np.sign(Ltk)
Delta_n_abs = (
(n_BK7_at_lmbda_rel_exp**2-1)/(2*n_BK7_at_lmbda_rel_exp) *
(D0*DT + D1 * DT**2 +D2 * DT**3 + (E0*DT+E1*DT**2)/(lmbda_rel_exp**2 - S_tk*Ltk**2))
)
Delta_n_abs_exp = 0.00001547
print(Delta_n_abs_exp, Delta_n_abs)
# The absolute index of the glass at the glass temperature and “pressure”# (= system pressure) is determined from:
n_abs_= n_BK7_abs_T0_P0_exp + Delta_n_abs
n_abs_exp = 1.51894548
print(n_abs_exp, n_abs_)
# The relative index at T and P is then calculated by dividing the absolute # index by nair(Ps,Ts)
n_rel = n_abs_exp / n_air_PS_TS_exp
n_rel_exp = 1.51814375
print(n_rel_exp, n_rel)
When reading the help file section: Index of Refraction Computation, I found this part confusing:
Is P really dimensionless, in which case how is it calculated? My understanding was that relative pressure is the pressure minus the ambient pressure (units are still [pressure] units). From @mocquin’s script, I gather it is more like the absolute pressure. At the same time, if P=0 we get n_air=1, which is the refractive index of air at a relative pressure of 0atm (whatever the absolute pressure might be). Can someone clarify this aspect for me please?
+1 on the lack of clarity in the definition of P in the doc’s equation :)
My understanding is that P in the equation of the doc is actually:
P_system / 1 atm
where P_system is the absolute system pressure.
Hence the example in the KB is at P=2atm, which gives rel_P=2 and is coherent in terms of value and units. As a consequence, if you specify the value in atmosphere unit, P is both the pressure, and the relative pressure, because
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.