Path: | rdoc/const.rdoc |
Last Update: | Sun Nov 14 14:53:48 -0800 2010 |
The GSL physical constants are defined as Ruby constants under the modules
For example, the GSL C constant GSL_CONST_MKSA_SPEED_OF_LIGHT is represented by a Ruby constant,
GSL_CONST_MKSA_SPEED_OF_LIGHT ---> GSL::CONST::MKSA::SPEED_OF_LIGHT
The following lists a part of the constants. Most of the constants are defined both in the modules GSL::CONST::MKSA and GSL::CONST::CGSM. See also the GSL reference
Contents:
The speed of light in vacuum, c.
The permeability of free space, \mu (not defined in GSL::CONST::CGSM).
The permittivity of free space, \epsilon_0 (not defined in GSL::CONST::CGSM).
Planck‘s constant, h.
Planck‘s constant divided by 2\pi, \hbar.
Avogadro‘s number
The molar charge of 1 Faraday.
The Boltzmann constant, k.
The Stefan-Boltzmann constant, \sigma.
The molar gas constant, R_0.
The standard gas volume, V_0.
The magnetic field of 1 Gauss.
The length of 1 astronomical unit (mean earth-sun distance), AU.
The gravitational constant, G.
The distance of 1 light-year, ly.
The distance of 1 parsec, pc.
The standard gravitational acceleration on Earth, g.
The mass of the Sun.
The charge of the electron, e.
The charge of the electron, e, in esu unit (not defined in GSL::CONST::MKSA).
The energy of 1 electron volt, eV.
The unified atomic mass, amu.
The mass of the electron, m_e.
The mass of the muon, m_\mu.
The mass of the proton, m_p.
The mass of the proton, m_n.
The electromagnetic fine structure constant alpha.
The Rydberg constant, Ry, in units of energy. This is related to the Rydberg inverse wavelength R by Ry = h c R.
The Thomson cross section of photon scattering by electrons.
The Bohr radius, a_0.
The length of 1 angstrom.
The area of 1 barn.
The Bohr Magneton, mu_B.
The Nuclear Magneton, mu_N.
The absolute value of the magnetic moment of the electron, mu_e. The physical magnetic moment of the electron is negative.
The magnetic moment of the proton, mu_p.
The number of seconds in 1 minute.
The number of seconds in 1 hour.
The number of seconds in 1 day.
The number of seconds in 1 week.
The length of 1 inch.
The length of 1 foot.
The length of 1 yard.
The length of 1 mile.
The length of 1 mil (1/1000th of an inch).
The length of 1 nautical mile.
The length of 1 fathom.
The speed of 1 knot.
The length of 1 printer‘s point (1/72 inch).
The length of 1 TeX point (1/72.27 inch).
The area of 1 acre.
The volume of 1 liter.
The volume of 1 US gallon.
The volume of 1 Canadian gallon.
The volume of 1 UK gallon.
The volume of 1 quart.
The volume of 1 pint.
The mass of 1 pound.
The mass of 1 ounce.
The mass of 1 ton.
The mass of 1 metric ton (1000 kg).
The mass of 1 UK ton.
The mass of 1 troy ounce.
The mass of 1 carat.
The force of 1 gram weight.
The force of 1 pound weight.
The force of 1 kilopound weight.
The force of 1 poundal.
The energy of 1 calorie.
The energy of 1 British Thermal Unit, btu.
The energy of 1 Therm.
The power of 1 horsepower.
The pressure of 1 bar.
The pressure of 1 standard atmosphere.
The pressure of 1 torr.
The pressure of 1 meter of mercury.
The pressure of 1 inch of mercury.
The pressure of 1 inch of water.
The pressure of 1 pound per square inch.
The dynamic viscosity of 1 poise.
The kinematic viscosity of 1 stokes.
The luminance of 1 stilb.
The luminous flux of 1 lumen.
The illuminance of 1 lux.
The illuminance of 1 phot.
The illuminance of 1 footcandle.
The luminance of 1 lambert.
The luminance of 1 footlambert.
The activity of 1 curie.
The exposure of 1 roentgen.
The absorbed dose of 1 rad.
The SI unit of force, 1 Newton.
he force of 1 Dyne = 10^-5 Newton.
The SI unit of energy, 1 Joule.
The energy 1 erg = 10^-7 Joule.
10^24
10^21
10^18
10^15
10^12
10^9
10^6
10^3
10^-3
10^-6
10^-9
10^-12
10^-15
10^-18
10^-21
10^-24
The following program demonstrates the use of the physical constants in a calculation. In this case, the goal is to calculate the range of light-travel times from Earth to Mars.
require("gsl") include GSL::CONST::MKSA puts("In MKSA unit") c = SPEED_OF_LIGHT; au = ASTRONOMICAL_UNIT; minutes = MINUTE; # distance stored in meters r_earth = 1.00 * au; r_mars = 1.52 * au; t_min = (r_mars - r_earth) / c; t_max = (r_mars + r_earth) / c; printf("light travel time from Earth to Mars:\n"); printf("c = %e [m/s]\n", c) printf("AU = %e [m]\n", au) printf("minutes = %e [s]\n", minutes) printf("minimum = %.1f minutes\n", t_min / minutes); printf("maximum = %.1f minutes\n\n", t_max / minutes);