Function Repository Resource:

MoistAirRefractiveIndex

Source Notebook

Compute the refractive index of moist air

Contributed by: Julián Laverde

ResourceFunction["MoistAirRefractiveIndex"][assoc]

returns the refractive index of moist air for the condition specified in the association assoc.

Details

ResourceFunction["MoistAirRefractiveIndex"] returns the refractive index of moist air, corresponding to the selected temperature and pressure at the given wavelength.
The refractive index is the ratio between the speed of light in medium to speed in a vacuum.
Available elements in assoc and their default values are shown below:
"Wavelength"0.6 μmincident light wavelength
"Temperature"23°Ctemperature of the moist air
"Pressure"1 barpressure of the moist air
"RelativeHumidity"50%relative humidity of the moist air
"CarbonDioxideLevel"370 ppmCO2 level of the moist air
ResourceFunction["MoistAirRefractiveIndex"][] gives a value for the standard conditions shown as defaults above.
The value for "Wavelength" can be any quantity whose physical dimension is "LengthUnit". If given only as a number, the default unit of wavelength is micrometers. The valid ranges of wavelength are from 0.3 μm to 5.2 μm, from 7.5 μm to 14.1 μm and from 16 μm to 24 μm.
The value for "Temperature" can be any quantity whose physical dimension is "TemperatureUnit". If given only as a number, the default unit of temperature is degrees Celsius.
The value of "Pressure" can be any quantity whose physical dimension is "PressureUnit". If given only as a number, the default unit of pressure is bars.
The value of "RelativeHumidity" can be any quantity whose unit is Percent. If given only as a number, the default unit of relative humidity is Percent.
There are two available ranges for "Pressure", "RelativeHumidity" and "Temperature" depending on the wavelength of the incident light.
The available ranges for 0.3 μm wavelength < 1.3 μm are:
"Temperature"from -60°C to 100°C
"Pressure"from 0.8 bars to 1.2 bars
"RelativeHumidity"from 0% to 100%
The available ranges for 1.3 μm wavelength 5.2 μm, 7.5 μm wavelength 14.1 μm and 16 μm wavelength 24 μm are:
"Temperature"from 10°C to 26.85°C
"Pressure"from 0.5 bars to 1.223 bars
"RelativeHumidity"from 5% to 60%
The value of "CarbonDioxideLevel" can be any parts-per notation quantity. If given only as a number, the default unit of carbon dioxide level is "PartsPerMillion". The valid range of carbon dioxide level is from 100 ppm to 500ppm.

Examples

Basic Examples (2) 

Compute a refractive index for standard conditions:

In[1]:=
ResourceFunction["MoistAirRefractiveIndex"][]
Out[1]=

Find the refractive index for a specified wavelength, temperature, pressure, relative humidity and carbon dioxide level:

In[2]:=
ResourceFunction[
 "MoistAirRefractiveIndex"][<|
  "Wavelength" -> Quantity[300, "Nanometers"], "Temperature" -> Quantity[5, "DegreesCelsius"], "Pressure" -> Quantity[1, "Bars"], "RelativeHumidity" -> Quantity[80, "Percent"], "CarbonDioxideLevel" -> Quantity[470, "PartsPerMillion"]|>]
Out[2]=

Scope (1) 

If the units of the input are not specified, it takes the default units:

In[3]:=
ResourceFunction["MoistAirRefractiveIndex"][<|"Wavelength" -> 0.3|>]
Out[3]=

Properties and Relations (1) 

Use Quantity to specify the units of the inputs:

In[4]:=
ResourceFunction[
 "MoistAirRefractiveIndex"][<|
  "Wavelength" -> Quantity[300, "Nanometers"], "Temperature" -> Quantity[5, "DegreesCelsius"], "Pressure" -> Quantity[1, "Bars"], "RelativeHumidity" -> Quantity[80, "Percent"], "CarbonDioxideLevel" -> Quantity[470, "PartsPerMillion"]|>]
Out[4]=

Possible Issues (1) 

The units of the inputs must be valid length, temperature, pressure, percent or parts-per units:

In[5]:=
ResourceFunction[
 "MoistAirRefractiveIndex"][<|
  "Wavelength" -> Quantity[2300, "Nanometers"], "Pressure" -> Quantity[10, "Amperes"]|>]
Out[5]=

Neat Examples (1) 

The function can be supplied to any suitable visualization function:

In[6]:=
Labeled[LogPlot[
  ResourceFunction[
   "MoistAirRefractiveIndex"][<|"Wavelength" -> x|>], {x, 0.380, 0.750}], Sequence[{"wavelength (nm)", "refractive index"}, {Bottom,
    Left}, RotateLabel -> True]]
Out[6]=

Publisher

WolframSpecialProjects

Version History

  • 1.0.0 – 08 January 2021

Source Metadata

Related Resources

License Information