# 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](https://github.com/heriantolim/PhysConst#list-of-physical-constant-names). For examples: - `v=Constant.ElementaryCharge` returns the value of the elementary charge, *e*; - `v=Constant.LightSpeed` returns the value of the speed of light, *c*. ### Default Unit System By default, the values are returned in the [SI](https://en.wikipedia.org/wiki/International_System_of_Units) units. To set a different unit system as default, do one of the following: - Make a variable assignment: `UnitSystem='UnitSystemCode';`, where `UnitSystemCode` refers to the unit system to be used. See the [list of unit system codes](https://github.com/heriantolim/PhysConst#list-of-unit-system-codes). - Define an anonymous function: `UnitSystem=@()'UnitSystemCode';`. - Create a function named `UnitSystem` in 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.ElementaryCharge` returns the value of the elementary charge, *e*, in the SI units (=1.602176565); - `v=Constant.P.LightSpeed` returns 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 Units - `P`: Planck Units - `QCD`: Quantum Chromodynamics Units - `RA`: Rydberg Atomic Units - `S`: Stoney Units - `SI`: International System of Units ## List of Physical Constant Names - `AtomicMass`: atomic mass unit, *m*u - `AvogadroNumber`: Avogadro's number, *N*A - `BohrMagneton`: Bohr magneton, *μ*B - `BohrRadius`: Bohr radius, *a*0 - `Boltzmann`: Boltzmann constant, *k*B - `ConductanceQuantum`: conductance quantum, *G*0 - `Coulomb`: Coulomb constant, *k*e - `ElectronMass`: electron mass, *m*e - `ElementaryCharge`: elementary charge, *e* - `Faraday`: Faraday constant, *F* - `FermiCoupling`: Fermi coupling constant, *G*F/(*ħc*)3 - `FineStructure`: fine-structure constant, *α* - `FluxQuantum`: magnetic flux quantum, Φ0 - `Gravitational`: Newtonian constant of gravitation, *G* - `HartreeEnergy`: Hartree energy, *E*h - `LightSpeed`: speed of light, *c* - `Loschmidt`: Loschmidt's number, *n*0 - `NuclearMagneton`: nuclear magneton, *μ*N - `Planck`: Planck constant, *h* - `ProtonMass`: proton mass, *m*p - `ReducedPlanck`: reduced Planck constant, *ħ* - `Rydberg`: Rydberg constant, *R* - `StefanBoltzmann`: Steffan-Boltzmann constant, *σ* - `VacuumImpedeance`: vacuum impedance, *Z*0 - `VacuumPermeability`: vacuum permeability, *μ*0 - `VacuumPermittivity`: vacuum permittivity, *ε*0 - `WienDisplacement`: Wien displacement law constant, *b*