UnitSystems.jl
Physical unit systems (Metric, English, Natural, Planck, etc...)
Install / Use
/learn @chakravala/UnitSystems.jlREADME
UnitSystems.jl
Physical unit systems (Metric, English, Natural, etc...)
In 2019 the SI2019 standardization was completed, based on the 7 physics dimensions specific to the Metric system. That is actually an inadequate and insufficient unit system standard, as it is mathematically impossible to unify all historical units with this standard. In 2020, Michael Reed set out to work around that impossibility with a new project called UnitSystems.jl, which ended up completely solving the problem with a brand new 11 dimensional Unified System of Quantities (USQ) for physics.
In aggregate, the UnitSystem data generated here constitutes a new universal standardization for dimensional analysis, which generalizes upon previous historical systems up to the 2019 redefinition and unifies them in a common Universe.
This enables a more precise and generalized standardization than the 2019 redefinition, which was comparatively limited in scope.
Specified default UnitSystem values are to be taken as a newly defined mutually-compatible recommended standard, verified to be consistent and coherent.
A UnitSystem can only be useful as a measuring standard if it can be scientifically reproduced, so the data here has been implemented in several important scientific programming languages (initially in the Julia language but also Wolfram language and Rust langauge) as well as presented abstractly in terms of dimensional formulas.
In fact there is nothing transcendental about dimensions; the ultimate principle is precisely expressible (in Newton's terminology) as one of similitude, exact or approximate, to be tested by the rule that mere change in the magnitudes of the ordered scheme of units of measurement that is employed must not affect sensibly the forms of the equations that are the adequate expression of the underlying relations of the problem. (J.L., 1914)
Specifications for dimensional units are in the UnitSystems.jl and Similitude.jl and MeasureSystems.jl repositories.
The three packages are designed so that they can be interchanged with compatibility.
On its own UnitSystems is the fastest package, while Similitude (provides Quantity type) and MeasureSystems (introduces Measurements.jl uncertainty) build additional features on top of UnitSystems base defintions.
Additionally, in the UnitSystems repository there is an equivalent Wolfram language paclet Kernel and also an unmaintained Rust src implementation.
Defaults are shared: Metric, SI2019, CODATA, Conventional, International, InternationalMean, MetricTurn, MetricGradian, MetricDegree, MetricArcminute, MetricArcsecond, Engineering, Gravitational, FPS, IPS, British, English, Survey, Gauss, LorentzHeaviside, EMU, ESU, IAU, IAUE, IAUJ, Hubble, Cosmological, CosmologicalQuantum, Meridian, Nautical, MPH, KKH, MTS, FFF, Planck, PlanckGauss, Stoney, Hartree, Rydberg, Schrodinger, Electronic, Natural, NaturalGauss, QCD, QCDGauss, QCDoriginal.
julia> using UnitSystems # or Similitude or MeasureSystems
An optional environment variable ENV["SIMILITUDE"] induces UnitSystems.similitude() to return true, giving flexibility for building dependencies whenever it is desirable to toggle usage between UnitSystems (default) and Similitude (requires environment variable specification). For example, in MeasureSystems and Geophysics this option is used to increase flexibility with variety in local compilation workflow.
A UnitSystem is a consistent set of dimensional values selected to accomodate a particular use case or standardization.
It is possible to convert derived physical quantities from any UnitSystem specification into any other using accurate values.
Eleven fundamental constants kB, ħ, 𝘤, μ₀, mₑ, Mᵤ, Kcd, θ, λ, αL, g₀ are used to govern a specific unit system consistent scaling.
These are the constants boltzmann, planckreduced, lightspeed, vacuumpermeability, electronmass, molarmass, luminousefficacy, angle, rationalization, lorentz, and gravity.
Different choices of natural units or physical measurements result in a variety of unit systems for many purposes.
Main documentation is at https://geophysics.crucialflow.com/dev/unitsystems
Historically, older electromagnetic unit systems also relied on a rationalization constant λ and a lorentz force proportionality constant αL.
In most unit systems these extra constants have a value of 1 unless specified.
UnitSystem{kB, ħ, 𝘤, μ₀, mₑ, Mᵤ, (Kcd, θ, λ, αL, g₀, ...)}
Fundamental constants of physics are: kB Boltzmann's constant, ħ reduced Planck's constant, 𝘤 speed of light, μ₀ vacuum permeability, mₑ electron rest mass, Mᵤ molar mass, Kcd luminous efficacy, θ angle measure, λ Gauss rationalization, αL Lorentz's constant, and g₀ gravitational force reference.
Primarily the Metric SI unit system is used in addition to the historic English engineering unit system.
These constants induce derived values for avogadro, boltzmann, molargas, planck, planckreduced, lightspeed, planckmass, dalton, protonmass, electronmass, newton, einstein, vacuumpermeability, vacuumpermittivity, electrostatic, and
additional constants molarmass, luminousefficacy, gravity, angle, turn, spat, stefan, radiationdensity, magnetostatic, lorentz, biotsavart, rationalization, vacuumimpedance, elementarycharge, magneton, conductancequantum, faraday, magneticfluxquantum, josephson, klitzing, hartree, rydberg, bohr.
Physics constant documentation is at https://units.crucialflow.com/constants
Standardized unit/derived quantities are hyperfine, loschmidt, wienwavelength, wienfrequency, mechanicalheat, eddington, solarmass, jupitermass, earthmass, lunarmass, earthradius, greatcircle, radarmile, hubble, cosmological, radian, steradian, degree, squaredegree, gradian, arcminute, arcsecond, second, minute, hour, day, gaussianmonth, siderealmonth, synodicmonth, year, gaussianyear, siderealyear, jovianyear, angstrom, inch, foot, surveyfoot, yard, meter, earthmeter, mile, statutemile, meridianmile, admiraltymile, nauticalmile, lunardistance, astronomicalunit, jupiterdistance, lightyear, parsec, bubnoff, ips, fps, fpm, ms, kmh, mph, knot, mps, barn, hectare, acre, surveyacre, liter, gallon, quart, pint, cup, fluidounce, teaspoon, tablespoon, grain, gram, earthgram, kilogram, tonne, ton, pound, ounce, slug, slinch, hyl, dyne, newton, poundal, poundforce, kilopond, psi, pascal, bar, barye, technicalatmosphere, atmosphere, inchmercury, torr, electronvolt, erg, joule, footpound, calorie, kilocalorie, meancalorie, earthcalorie, thermalunit, gasgallon, tontnt, watt, horsepower, horsepowerwatt, horsepowermetric, electricalhorsepower, tonsrefrigeration, boilerhorsepower, coulomb, earthcoulomb, ampere, volt, henry, ohm, siemens, farad, weber, tesla, abcoulomb, abampere, abvolt, abhenry, abohm, abmho, abfarad, maxwell, gauss, oersted, gilbert, statcoulomb, statampere, statvolt, stathenry, statohm, statmho, statfarad, statweber, stattesla, kelvin, rankine, celsius, fahrenheit, sealevel, boiling, mole, earthmole, poundmole, slugmole, slinchmole, katal, amagat, lumen, candela, lux, phot, footcandle, nit, apostilb, stilb, lambert, footlambert, bril, neper, bel, decibel, hertz, apm, rpm, kayser, diopter, gforce, galileo, eotvos, darcy, poise, reyn, stokes, rayl, mpge, langley, jansky, solarflux, curie, gray, roentgen, rem.
Standard physics units are at https://units.crucialflow.com/units
Additional reference UnitSystem variants: EMU, ESU, Gauss, LorentzHeaviside, SI2019, SI1976, CODATA, Conventional, International, InternationalMean, Engineering, Gravitational, IAU, IAUE, IAUJ, FPS, IPS, British, Survey, Hubble, Cosmological, CosmologicalQuantum, Meridian, Nautical, MPH, KKH, MTS, FFF; and natural atomic units based on gravitational coupling and finestructure constant (Planck, PlanckGauss, Stoney, Hartree, Rydberg, Schrodinger, Electronic, Natural, NaturalGauss, QCD, QCDGauss, and QCDoriginal).
Unit conversion documentation is at https://units.crucialflow.com/convert
Derived Unit conversions:
Mechanics: angle, solidangle, time, angulartime, length, angularlength, area, angulararea, volume, wavenumber, angularwavenumber, fuelefficiency, numberdensity, frequency, angularfrequency, frequencydrift, stagnance, speed, acceleration, jerk, snap, crackle, pop, volumeflow, etendue, photonintensity, photonirradiance, photonradiance,
inertia, mass, massflow, lineardensity, `ar
