JuliaPhysics / PhysicalConstants.jl

Collection of fundamental physical constants with uncertainties. It supports arbitrary-precision constants
https://juliaphysics.github.io/PhysicalConstants.jl/stable/
Other
102 stars 15 forks source link

Add all constants of CODATA2014 #4

Open Paalon opened 6 years ago

Paalon commented 6 years ago

module CODATA2014 lacks many constants https://physics.nist.gov/cuu/Constants/Table/allascii.txt They should be included.

giordano commented 6 years ago

Yeah, my goal is to eventually include all constants, but first I'd like to sort out how to best serve users (see issues #1 and #2)

caseykneale commented 4 years ago

One of my favorite constants that shows up from time to time is the impedance of free space :). Z0 = 119.91698326550797 * pi Units are in Ohms :)

8me commented 4 years ago

Is this issue still followed up?

giordano commented 4 years ago

Not really because I don't think I found a good way to automatically dump the entire list of constants, but you're definitely welcome to contribute your favourite ones! Feel free to ask for help in case you need it :wink:

8me commented 4 years ago

I think an automatic dump is not really necessary, because it's a fixed list which doesn't change on a daily basis. Once the values are defined the maintenance effort updating it to a new CODATA list should be manageable. I think you will go for it with a PR the next few days ;-)

8me commented 4 years ago

I tried to define the vacuum impedance as @derived_constant, which looks like: derived_constant(VacuumImpedance, Z_0, "Characteristic impedance of vacuum", 376.730_313_666_853_5, ustrip(big(µ_0) * big(c_0)), Ω, measurement(µ_0)*measurement(c_0), measurement(BigFloat, µ_0)*measurement(BigFloat, c_0), "CODATA 2018") but I always get an error w.r.t. to the uncertainties (5.696056702e-8 != 5.6960567020000004e-8). Can you help me out, where my definition fails? Thanks!

giordano commented 4 years ago

I've added Z_0 to CODATA 2018 in https://github.com/JuliaPhysics/PhysicalConstants.jl/commit/03abe02aca18c0d38c64a3c33b9fd025a86dc891 (not sure why I didn't include it initially :thinking:). Note that CODATA 2018 doesn't define it as a derived constant: https://physics.nist.gov/cgi-bin/cuu/Value?z0

8me commented 4 years ago

Ok, thank you! I just thought this should be a derived constant, because it is defined as μ_0*c (which definition is also given in the CODATA18 table at pdf.