optmat.gas.models.formulas#
Published dispersion formulas, built from the source records.
A source record’s [[formulas]] entry that names a form is a model. Its
coefficients are kept as printed, as strings; a misprinted coefficient is corrected
by a corrections entry that names the term, the printed and the corrected value,
the reason and the evidence, exactly like a dataset erratum, and the printed value is
checked on loading.
The forms (lambda the vacuum wavelength, s = 1/lambda in um^-1, nu the
vacuum wavenumber in cm^-1, omega the angular frequency in atomic units):
dn_sigma2n - 1 = scale (A + sum_i B_i / (C_i - s^2)), the Peck and Bideau-Mehu form and refractiveindex.info’s formula 6.dn_wavenumber2n - 1 = scale (A + sum_i B_i / (C_i - nu^2)), the atmospheric-science form (He et al. 2021, Wilmouth & Sayres 2020).n2_sellmeiern^2 - 1 = A + sum_i B_i lambda^2 / (lambda^2 - C_i)with lambda in um (Borzsonyi et al. 2008, Ermolov et al. 2015), refractiveindex.info’s formula 2.alpha_seriesalpha = sum_k c_k omega^(2k)in atomic units, a Cauchy series of the polarizability itself (Bhatia & Drachman as quoted by Stone & Stejskal 2004).molar_refractivity_seriesA_R = sum_k a_k lambda^(-2k)in cm^3/mol with lambda in nm (Stone & Stejskal).oscillatoralpha = sum_i f_i / (E_i^2 - omega^2)in atomic units, a pseudo-spectrum (Kumar and Meath); the entry’senergy_unit(“hartree”, the default, “eV” or “rydberg”) says in what theE_iare printed.
The first three give n - 1 (or n^2 - 1) at the formula’s reference state;
the polarizability follows by inverse Lorentz-Lorenz with the density the source meant
(density: real or ideal gas). The last two are per particle and need no state.
Module Attributes
The formula forms a source record may name. |
Functions
|
Return one gas formula model, reading only its source's record. |
Return every formula model defined in the source records, by name. |
Classes
|
A published formula as a polarizability model. |
- optmat.gas.models.formulas.FORMS: Final = frozenset({'alpha_series', 'dn_sigma2', 'dn_wavenumber2', 'molar_refractivity_series', 'n2_sellmeier', 'oscillator'})#
The formula forms a source record may name.
- class optmat.gas.models.formulas.FormulaModel(gas, name, citation, wavelength_range, kind, form='', terms=<factory>, state=None, ideal=False, energy_scale=1.0, *, status='user', status_reason='', modified=(), base='', intervals=())[source]#
Bases:
ModelA published formula as a polarizability model.
- Attributes:
- formstr
One of
FORMS.- termsdict of str to tuple of float
The coefficients after corrections:
A,B,C,scalefor the refractivity forms,corafor the series.- stateState or None
The reference state of a refractivity form.
- idealbool
True if the source related its refractivity to the state with the ideal gas.
- energy_scalefloat
Hartree per printed energy unit, for the
oscillatorform.- Its overrides are the coefficients (``terms``) and the intervals.
- INPUTS: ClassVar[tuple[str, ...]] = ('intervals', 'terms')#
The parameters
with_parameters()may change.
- optmat.gas.models.formulas.published_model(name)[source]#
Return one gas formula model, reading only its source’s record.
published_models()reads every record with formulas; a lookup by name needs one.- Parameters:
- namestr
<source>/<formula>.
- Returns:
- FormulaModel
The model, the same as
published_models()holds under that name.
- Raises:
- KeyError
If no gas formula has that name.
Examples
>>> published_model("bideau_mehu_1981/sellmeier_Ar").gas.value 'Ar'
- optmat.gas.models.formulas.published_models()[source]#
Return every formula model defined in the source records, by name.
- Returns:
- dict of str to FormulaModel
The models, named
<source>/<formula>.
Examples
>>> model = published_models()["bideau_mehu_1981/sellmeier_Ar"] >>> f"{float(model.refractivity(253.7e-9)) * 1e6:.1f}" '303.2'