Procedures Details | <Prev Next> |
General mathematical expressions can be used in
several contexts, such as expressing constraints in least squares
fitting, and Custom
Population Functions, Custom
Width Functions, Custom
Transition Functions, Lineshape
Functions or Custom
Lineshape Functions. Each context has some specific
variables introduced, but the same logic is otherwise used for all
expressions:
Species.LinearMolecule.Ground.v=0.B
To find the name of a parameter, right click on it in the constants window and select "Show Full Name". Depending on the context, parts of the parameter name can be omitted if no ambiguity is introduced as to the parameter concerned, so for the above:
orGround.v=0.B
would typically also work (though B on its own would only work if there was only one state).Quotes might be needed around the parameter name if it contains special characters, as in:v=0.B
"NH3.NH3.s.<0-|J+-^6|0->.Value".
The later will have a value of 0 ir 1.v=0.B.StdDev
v=0.B.Float
int(a) |
Integer part of a; number is closer
to zero than a (or equal to a). |
frac(a) |
a - int(a) |
% |
modulus operator: a % b = frac(a/b)*b |
mod(a,b) |
a % b except if a < 0
in which case b-frac(|a|/b)*b is used. |
a xor b |
bitwise exclusive or of a and b |
pi |
3.14159... |
min(a,b,c...) |
The minimum value of all the arguments |
max(a,b,c...) | The maximum value of all the arguments |
poly(x,a0,a1,a2...) | a0+a1.x+a2.x2+... |
lor(x,w) |
Lorenztian function with FWHM w and unit area = w/[2π(x2+w2/4)] |
gau(x,g) |
Gaussian function with FWHM g and unit area = w/π½ exp(-w2x2) where w = 2ln(2)½/g |
voigt(x,l,g) |
Voigt profile at offset x from the
line centre. l is the FWHM of the Lorenztian
component, g of the Gaussian. The area is unity. |
air(s) |
Air wavelength/nm given vacuum wavenumber s/cm-1.
The refractive index is taken from from B Edlen, Metrologia,
2, 71 (1966). |
vac(l) |
Vacuum wavenumber/cm-1 given air
wavelength in nm. |
atan2(x,y) |
atan(x/y), but with a -π...π result
range. |
threej(j1,m1,j2,m2,j3,m3) |
Wigner 3-j function |
cg(j1,m1,j2,m2,j3,m3) |
Clebsch-Gordan coefficient = (-1)j1-j2+m3(2j3+1)½threej(j1,m1,j2,m2,j3,-m3) |
sixj(j1,j2,j3,j4,j5,j6) |
Wigner 6-j function |
ninej(j11,j12,j13,j21,j22,j23,j31,j32,j33) |
Wigner 9-j function |
a0 |
Bohr radius/m |
c |
Speed of light |
ee |
Charge on the electron |
ep |
Permittivity of a vacuum |
ge |
g value for an electron |
gg |
Gravitational Constant |
f |
Faraday Constant |
k |
Boltzmann Constant |
l |
Avogadro's Number |
r |
Gas Constant |
h |
Planck constant |
hc |
h/2π |
me |
mass of electron |
mn |
mass of neutron |
mp |
mass of proton |
mub |
Bohr magneton |
mun |
nuclear magneton |
rydberg |
Rydberg constant/m-1 |
u |
Atomic mass unit/kg |
A nDebug flag is available in each object that uses an expression. If non zero, that the values of all the variables and the value of the function on each evaluation will be written to the log window. The value specifies the number of times this is done; use View, Clear Cache to reset the count if necessary. Negative values have special interpretation: