NOTES:
The physical constants are implemented under names derived from their descriptions by replacing spaces with underscores. Additionally, they also have short names, these are:
- atomic mass unit : amu
- astronomical unit : AU
- Boltzmann constant : k, k_B
- constant of gravitation : G
- electric constant : epsilon_0
- electron mass : m_e
- elementary charge : e_
- magnetic ocnstant : mu_0
- mass of jupiter : m_J
- mass of sun : m_0
- Planck constant : h_
- reduced Planck constant : h_bar
- Planck length : l_P
- Planck mass : m_P
- Planck temperature : T_P
- Planck time : t_P
- speed of light : c
- standard gravity : g_n
- standard atmosphere : atm
Note the trailing underscores on the elementary charge and on the Planck constant. These are to avoid confusion with the mathematical constant e and the symbol for hour, h, respectively. Keep in mind that some short names can easily be overwritten by accident (e.g. c).
Some other units whose implementation names may be unintuitive are
- nautical mile : nmile
- imperial gallon : impGal (also: gallon)
- US gallon : usGal
- imperial fluid ounce : impFlOz
- US fluid ounce : usFlOz
For a list of all pre-defined units see Quantity.all_unit_names at runtime.
Additionally, the SI prefixes are implemented as numbers using their long names:
yotta, zetta, exa, peta, tera, giga, mega, kilo, hecto, deca, deci, centi, milli, micro, nano, pico, femto, atto, zepto, yocto
Most of the values for units and constants are from NIST, see
AUTHORS:
- David Bate (2008): initial version
- Miriam Backens (2009): added some more constants
EXAMPLES:
sage: from sage.dimpy import *
sage: AU == astronomical_unit
True
sage: k
1.3806504e-23 m^2 kg s^-2 K^-1
sage: usGal
USGal
sage: c**2 * (mu_0 * epsilon_0)
1.0
sage: barn * mega*parsec
0.0030857 l