Codata
CamiXon.Codata — TypeCodataObject to hold the natural constants from CODATA. It is best created with the function castCodata
The fields are:
.∆νCs: Cs hyperfine transition frequency (::Value).c: speed of light in vacuum (::Value).h: Planck constant (::Value).ħ: Planck constant - reduced (::Value).e: elementary charge (::Value).kB: Boltzmann constant (::Value).NA: Avogadro constant (::Value).Kcd: Luminous efficacy (::Value).me: electron rest mass (::Value).R∞: Rydberg constant (::Value).Ry: Rydberg frequency (::Value).Eh: Hartree a.u. (::Value).α: fine-structure constant (::Value).μ0: magnetic permitivity of vacuum (::Value).ε0: electric permitivity of vacuum (::Value).KJ: Josephson constant (::Value).RK: Von Klitzing constant (::Value).R: Molar gas constant (::Value).u: unified atomic mass unit (::Value).matE: unit conversion matrix (Matrix{Float64})
Example:
julia> codata = castCodata(2022);
julia> codata.μ0
Value(1.2566370612696005e-6, "N A⁻²")
julia> codata.μ0.val
1.2566370612696005e-6castCodata
CamiXon.castCodata — MethodcastCodata(year::Int)Method to create the Codata object
Example:
julia> codata = castCodata(2022);
julia> strValue.([codata.∆νCs,codata.c,codata.h])
3-element Vector{String}:
"9192631770 Hz"
"299792458 m s⁻¹"
"6.62607e-34 J Hz⁻¹"listCodata
CamiXon.listCodata — MethodlistCodata(codata::Codata)Method to list the fields of Codata by their symbolic name
Example:
julia> julia> codata = castCodata(2018);
julia> listCodata(codata)
∆νCs = 9192631770 Hz - ¹³³Cs hyperfine transition frequency
c = 299792458 m s⁻¹ - speed of light in vacuum
h = 6.62607e-34 J Hz⁻¹ - Planck constant
ħ = 1.05457e-34 J s - Planck constant (reduced)
e = 1.60218e-19 C - elementary charge
kB = 1.38065e-23 J K⁻¹ - Boltzmann constant
NA = 6.02214e23 mol⁻¹ - Avogadro constant
Kcd = 683 lm W⁻¹ - Luminous efficacy
mₑ = 9.10938e-31 kg - electron mass
mₚ = 1.67262e-27 kg - proton mass
R∞ = 1.09737e7 m⁻¹ - Rydberg constant
Ry = 3.28984e15 Hz - Rydberg frequency
Eₕ = 4.35974e-18 J - Hartree atomic unit
α = 0.00729735 - fine-structure constant
a0 = 5.29177e-11 m - Bohr radius
μB = 9.27401e-24 J T⁻¹ - Bohr magneton
μN = 5.05078e-27 J T⁻¹ - nuclear magneton
μ₀ = 1.25664e-6 N A⁻² - magnetic permitivity of vacuum
ε₀ = 8.85419e-12 F m⁻¹ - electric permitivity of vacuum
KJ = 4.83598e14 Hz V⁻¹ - Josephson constant
RK = 25812.8 Ω - Von Klitzing constant
R = 8.31446 J mol⁻¹K⁻¹ - Molar gas constant
u = 1.66054e-27 kg - unified atomic mass unitValue
CamiXon.Value — TypeValue(val::Real, unit::String)Object to hold a real numerical value together with a unit specifier.
The fields are:
.val: numerical value (::Real).unit: unit specifier (::String)
Example:
julia> f = Value(1,"Hz")
Value(1, "Hz")
julia> f.val
1
julia> f.unit
"Hz"strValue
CamiXon.strValue — MethodstrValue(f::Value)String expression for a Value object in :compact => true representation
Example:
julia> f = Value(1,"Hz")
Value(1, "Hz")
julia> strValue(f)
"1 Hz"NamedValue
CamiXon.NamedValue — TypeNamedValue(val::Value, name::String, comment::String)Object to hold a Value together with its symbolic name and a short description
The fields are:
.val: Value (::Value).name: symbolic name (::String).comment: description (::String)
Named Value object The object NamedValue is best created using castNamedValue.
Example:
julia> f = Value(1,"Hz")
Value(1, "Hz")
julia> f = castNamedValue(f, name="frequency", comment="comment")
NamedValue(Value(1, "Hz"), "frequency", "comment")
julia> f.name
"frequency"castNamedValue
CamiXon.castNamedValue — MethodcastNamedValue(val::Value; name=" ", comment=" ")Method to create a NamedValue object
Example
julia> v = Value(1.602176634e-19, "C");
julia> nv = castNamedValue(v; name="e");
julia> nv.name * " = " * strValue(nv.val)
"e = 1.60218e-19 C"Unit conversion
CamiXon.convertUnit — MethodconvertUnit(val, codata; unitIn="Hartree", unitOut="xHz")Unit conversion between μHz,⋯ EHz, Hartree, Rydberg, J eV, cm-1, m-1, K, mK μK
default input: Hartree
default output: xHz ∈ {μHz, mHz, Hz, kHz, MHz, GHz, THz, PHz, EHz}
Example:
julia> codata = castCodata(2018);
julia> convertUnit(1, codata; unitIn="Hz", unitOut="J")
Value(6.62607015e-34, "J")
julia> convertUnit(1, codata; unitIn="Hartree", unitOut="Hz")
Value(6.579683920501762e15, "Hz")
julia> f = convertUnit(1, codata) # default input (Hartree) and output (xHz);
julia> strf = strValue(f)
"6.57968 PHz"Calibration report
CamiXon.calibrationReport — MethodcalibrationReport(E, Ecal, codata::Codata; unitIn="Hartree", msg=true)Comparison of energy E with calibration value Ecal
default input: Hartree
Example:
julia> codata = castCodata(2022)
julia> calibrationReport(1.1, 1.0, codata; unitIn="Hartree")
calibration report (Float64):
Ecal = 1 Hartree
E = 1.1000000000000001 Hartree
absolute accuracy: ΔE = 0.1 Hartree (657.968 THz)
relative accuracy: ΔE/E = 0.0909091