PhysConst
A collection of fundamental physical constants in various unit systems for MATLAB.
Install / Use
/learn @heriantolim/PhysConstREADME
PhysConst
A collection of fundamental physical constants in various unit systems for MATLAB.
Licensing
This software is licensed under the GNU General Public License (version 3).
Tested On
- MATLAB R2013b - R2018a
Syntax
v=Constant.NameOfConstant returns the value of the named constant in the default unit system. See the list of physical constant names. For examples:
v=Constant.ElementaryChargereturns the value of the elementary charge, e;v=Constant.LightSpeedreturns the value of the speed of light, c.
Default Unit System
By default, the values are returned in the SI units. To set a different unit system as default, do one of the following:
- Make a variable assignment:
UnitSystem='UnitSystemCode';, whereUnitSystemCoderefers to the unit system to be used. See the list of unit system codes. - Define an anonymous function:
UnitSystem=@()'UnitSystemCode';. - Create a function named
UnitSystemin the current working directory or elsewhere. The function takes no input arguments and returns a string specifying the unit system code.
v=Constant.UnitSystemCode.NameOfConstant returns the value of the named constant in the specified unit system, regardless of the default unit system. For examples:
v=Constant.SI.ElementaryChargereturns the value of the elementary charge, e, in the SI units (=1.602176565);v=Constant.P.LightSpeedreturns the value of the speed of light, c, in the Planck units (=1).
Uncertainties
[v,u]=Constant.NameOfConstant and [v,u]=Constant.UnitSystemCode.NameOfConstant additionally return the uncertainty of the named constant.
List of Unit System Codes
HA: Hartree Atomic UnitsP: Planck UnitsQCD: Quantum Chromodynamics UnitsRA: Rydberg Atomic UnitsS: Stoney UnitsSI: International System of Units
List of Physical Constant Names
AtomicMass: atomic mass unit, m<sub>u</sub>AvogadroNumber: Avogadro's number, N<sub>A</sub>BohrMagneton: Bohr magneton, μ<sub>B</sub>BohrRadius: Bohr radius, a<sub>0</sub>Boltzmann: Boltzmann constant, k<sub>B</sub>ConductanceQuantum: conductance quantum, G<sub>0</sub>Coulomb: Coulomb constant, k<sub>e</sub>ElectronMass: electron mass, m<sub>e</sub>ElementaryCharge: elementary charge, eFaraday: Faraday constant, FFermiCoupling: Fermi coupling constant, G<sub>F</sub>/(ħc)<sup>3</sup>FineStructure: fine-structure constant, αFluxQuantum: magnetic flux quantum, Φ<sub>0</sub>Gravitational: Newtonian constant of gravitation, GHartreeEnergy: Hartree energy, E<sub>h</sub>LightSpeed: speed of light, cLoschmidt: Loschmidt's number, n<sub>0</sub>NuclearMagneton: nuclear magneton, μ<sub>N</sub>Planck: Planck constant, hProtonMass: proton mass, m<sub>p</sub>ReducedPlanck: reduced Planck constant, ħRydberg: Rydberg constant, R<sub>∞</sub>StefanBoltzmann: Steffan-Boltzmann constant, σVacuumImpedeance: vacuum impedance, Z<sub>0</sub>VacuumPermeability: vacuum permeability, μ<sub>0</sub>VacuumPermittivity: vacuum permittivity, ε<sub>0</sub>WienDisplacement: Wien displacement law constant, b
