Right after the release of the new CODATA2018 set of recommended values, a new version of PhysicalConstants.jl
is about to come (just waiting for the PR to be merged in the General register), featuring the new dataset:
ulia> using PhysicalConstants.CODATA2018
julia> PlanckConstant
Planck constant (h)
Value = 6.62607015e-34 J s
Standard uncertainty = (exact)
Relative standard uncertainty = (exact)
Reference = CODATA 2018
julia> VacuumMagneticPermeability
Vacuum magnetic permeability (μ_0)
Value = 1.25663706212e-6 N A^-2
Standard uncertainty = 1.9e-16 N A^-2
Relative standard uncertainty = 1.5e-10
Reference = CODATA 2018
The new dataset can be used alongside the old one, but if you load both you have to qualify the constants that have the same name (note that a couple of constants changed their name, because their name changed in the official CODATA list of values, you can find the list of all variables in the README.md
):
julia> using PhysicalConstants.CODATA2014
WARNING: using CODATA2014.PlanckConstant in module Main conflicts with an existing identifier.
julia> CODATA2014.PlanckConstant
Planck constant (h)
Value = 6.62607004e-34 J s
Standard uncertainty = 8.1e-42 J s
Relative standard uncertainty = 1.2e-8
Reference = CODATA 2014
julia> MagneticConstant
Magnetic constant (μ_0)
Value = 1.2566370614359173e-6 N A^-2
Standard uncertainty = (exact)
Relative standard uncertainty = (exact)
Reference = CODATA 2014
An interesting variable is the Wien wavelength displacement law constant that now is defined to be exact, but whose value depends on the zero of a non algebraic function. The excellent Roots.jl
is used to compute the zero when the constant is converted to arbitrary precision:
julia> big(CODATA2018.WienWavelengthDisplacementLawConstant)
0.002897771955185172661478605448092884726801628303071854440630774014015910656760728 K m
It’s interesting to see how the relative uncertainties of the constants changed from one set to the other one:
julia> using PhysicalConstants, Unitful, Measurements
julia> import Measurements: value, uncertainty
julia> for dataset in (PhysicalConstants.CODATA2014, PhysicalConstants.CODATA2018)
constants = names(dataset)
println("## ", nameof(dataset), "\n")
for constant in constants
c = getfield(dataset, constant)
if c isa PhysicalConstants.PhysicalConstant
println(rpad(string(constant) * ": ", 39), uncertainty(measurement(c)) / value(measurement(c)))
end
end
println("\n")
end
## CODATA2014
AtomicMassConstant: 1.2044281717098324e-8
AvogadroConstant: 1.2287988899161014e-8
BohrMagneton: 6.146208601983096e-9
BohrRadius: 2.2676713505493936e-10
BoltzmannConstant: 5.721948696979012e-7
CharacteristicImpedanceOfVacuum: 0.0
ElectricConstant: 0.0
ElectronMass: 1.2075460350908751e-8
ElementaryCharge: 6.116678943365593e-9
FineStructureConstant: 2.3296119853486266e-10
MagneticConstant: 0.0
MolarGasConstant: 5.773074998811107e-7
NeutronMass: 1.2537856333242981e-8
NewtonianConstantOfGravitation: 4.64483494354278e-5
PlanckConstant: 1.2224440658040493e-8
PlanckConstantOver2pi: 1.2224440658040493e-8
ProtonMass: 1.2555138746605121e-8
RydbergConstant: 5.92323582859768e-12
SpeedOfLightInVacuum: 0.0
StandardAccelerationOfGravitation: 0.0
StandardAtmosphere: 0.0
StefanBoltzmannConstant: 2.292620565829337e-6
ThomsonCrossSection: 1.367915290986615e-9
WienWavelengthDisplacementLawConstant: 5.866574292278045e-7
## CODATA2018
AtomicMassConstant: 3.0110703810405613e-10
AvogadroConstant: 0.0
BohrMagneton: 3.019190163003642e-10
BohrRadius: 1.511780899700616e-10
BoltzmannConstant: 0.0
ElectronMass: 3.0737534961217373e-10
ElementaryCharge: 0.0
FineStructureConstant: 1.5073959899206537e-10
MolarGasConstant: 0.0
NeutronMass: 5.671887297281165e-10
NewtonianConstantOfGravitation: 2.2474266964325848e-5
PlanckConstant: 0.0
ProtonMass: 3.0491050773439597e-10
ReducedPlanckConstant: 0.0
RydbergConstant: 1.9136608062230136e-12
SpeedOfLightInVacuum: 0.0
StandardAccelerationOfGravitation: 0.0
StandardAtmosphere: 0.0
StefanBoltzmannConstant: 0.0
ThomsonCrossSection: 9.019221676713751e-10
VacuumElectricPermittivity: 1.468231787584925e-10
VacuumMagneticPermeability: 1.511971958549925e-10
WienFrequencyDisplacementLawConstant: 0.0
WienWavelengthDisplacementLawConstant: 0.0