[constants]

“msharpmath”, The Simple is the Best

[100] 030 Tutorial constants    [constants]

//————————————————————————————————————
// Physical constants
//————————————————————————————————————
// Each physical constant starts with a single ‘_’ (underline)

//————————————————————————————————————
_alpha     = 0.0072973525376                    // fine-structure const
_c0          = 2.99792458 x 10^8                  // speed of light [m/s]
_eC          = 1.602176487 x 10^-19            // elementary charge [C]
_eV       = 1.7827 x 10^-36                          // electron volt [kg]
_e0       = 8.854187817 x 10^-12               // electric const  [F/m]
_F        = 96485.33977318                          // Faraday const [C/mol]
_g         = 9.80665                                        // earth’s gravity [m/s^2]
_gc       = 32.174                                           // earth’s gravity in British unit [ft/s^2]
_G        = 6.673 x 10^-11                              // gravitational const [m^3/(kg.s^2)]
_G0      = 7.7480917004  x 10^-5             // conductance quantum [ohm^-1]
_h         = 6.62606896 x 10^-34                // Planck’s const [J.s]
_k         = 1.3806504 x 10^-23                   // Boltzmann const [J/K]
_ke       = 8.987551787368176 x 10^9      // Coulomb const [N.m^2/C^2]
_muB   = 9.27400915                                  // Bohr magneton [J/T], T=tesla
_mu0   = 1.2566370614 x 10^-6                // magnetic const [N/A^2]

_m_e   = 9.10938215 x 10^-31           // electron mass [kg]
_m_m  = 1.8835313 x 10^-28            // muon mass [kg]
_m_n   = 1.674927211 x 10^-27         // neutron mass [kg]
_m_p   = 1.672621637 x 10^-27         // proton mass [kg]
_m_t   = 3.16777 x 10^-27                   // tau mass [kg]
_m_u  = 1.660538782 x 10^-27         // atomic mass [kg]

_NA    = 6.02214179 x 10^23              // Avogadro’s const [mol^-1]
_phi0  = 2.067833667 x 10^-15         // magnetic flux quantum [Wb], weber
_R        = 8.31447247122                      // molar gass const [J/(mol.K)]
_Rinf   = 1.0973731568527 x 10^7    // Rydberg const [m^-1]
_sigma = 5.6704 x 10^-8                     // Stefan-Boltzmann const [W/(m^2.K^4)]
_Z0       = 376.73031346177                 // Impedance of vacuum [ohm]

#> _F – _NA*_eC  ; // relation check,  _F =_NA*_eC
ans =   -9.167706593871117e-010

//————————————————————————————————————
// Mathematical constants
//————————————————————————————————————

#> pi  ;  // 3.14159 26535 89793 23846 26433 83279 …
ans =         3.141592653589793

#> _e ;       // exp(1)
ans =         2.718281828459045

#> _gamma ;    // Euler-Mascheroni const
ans =        0.5772156649015329

#> _eps ;    // machine epsilon in CEMMATH    
ans =        2.22e-16

//———————————————————————————-
//  Summary of Unit constants in CEMMATH   
//———————————————————————————-
Unit constants are expressed in reference units,

[kg]  [s] [m]  [m^2]  [m^3]  [m/s]  [m/s^2]

[K] [kN]  [kJ]  [kW]  [kPa] [kN.m]   [kg/m^3]

The followings are only for named units. Other derived units are calculated by using unit constants. For example,

#> 5 * _oz/_in^3 ;       // ounce-mass per cubic inch
ans =     8649.9452

results in a conversion into [kg/m^3].

//————————————————————————————————————
_A          = 10^-10  [m]                        // Angstrom
_acre      = 4046.8564224 [m^2]     // acre,    or  _ac
_atm      = 101.32501 [kPa]                // atmosphere
_atmtec = 98.0665 [kPa]                   // atmosphere technical, kgf/cm^2
_au         = 1.496 x 10^11 [m]             // astronomical unit

_bar     = 100 [kPa]                // bar
_bbl     = 0.159 [m^3]            // barrel (petroleum),   or_barrel
_bhp    = 9.810657 [kW]       // boiler horse power
_BTU   = 1.0550559 [kJ]      // British Thermal Unit

_cal         = 0.0041868 [kJ]                         // calorie
_Cal        = 4.1868 [kJ]                                 // kilo calorie
_cc          =  10^-6 [m^3]                              // cubic centimeter,  _mL
_cm        = 0.01 [m]                                      // centimeter
_cm2      = 10^-4 [m^2]                              // square centimeter
_cm3      = 10^-6 [m^3]                               // milliliter or cubic centimeter
_cmAq   = 0.0980638 [kPa]                       // cm of water
_cmHg   = 1.3332237 [kPa]                        // cm of mercury
_cup       = 236.588 x 10^-6 [m^3]           // cup
_Cup      =  284.130625 x 10^-6 [m^3]    // cup(UK)
_c0         = 2.9979246 x 10^8  [m/s]         // speed of light

_day     = 86400 [s]               // day
_dL       = 0.0001 [m^3]       // deci-liter
_dyne   = 10^-8  [kN]           // dyne,   or   _dyn

_erg    = 10^-10 [kJ]             // erg

_floz   = 29.5735 x 10^-6 [m^3]           // fluid oz
_Floz  = 28.4130625 x 10^-6 [m^3]   // ounce(UK)
_ft       = 0.3048 [m]                               // feet
_ft2     = 0.09290304 [m^2]                // square feet
_ft3     = 0.028316846592 [m^3]       // cubic feet

_gal       = 0.00378541 [m^3]                    // gallon
_Gal       = 0.00454609 [m^3]                  // gallon (UK)
_gill       = 118.2941 x 10^-6 [m^3]          // gill
_Gill      =  142.0653125 x 10^-6 [m^3]  // gill(UK)
_GJ        = 10^6 [kJ]                         // giga Joule
_GN       = 10^6 [kN]                        // giga newton
_GPa     = 10^6 [kPa]                       // giga Pascal
_gr         = 6.479891  x 10^5 [kg]    // grain
_gram   = 0.001 [kg]                         // gram
_GW      = 10^6 [kW]                        // giga Watt
_gyr       = 31556952 [s]                    // gregorian year

_ha      = 10000 [m^2]                     // hectare
_hp      = 0.74569987 [kW]              // horse power (international)
_hPa    = 0.1 [kPa]                             // hecto Pascal
_hph    = 2684.5195 [kJ]                  // horsepower-hour,  _hp*_hr
_hpm   = 0.73549875 [kW]             // horse power (metric)
_hr       = 3600 [s]                              // hour,   or  _hour

_in        = 0.0254 [m]                                // inch
_in2      = 6.4516 x 10^-4 [m^2]             // square inch
_in3      = 16.387064 x 10^-6 [m^3]      // cubic inch
_inAq   = 0.249089 [kPa]                        // inch of water
_inHg   = 3.386389 [kPa]                        // inch of mercury

_J       = 0.001 [kJ]            // Joule
_jyr    = 31557600 [s]       // julian year

_kcal   = 4.1868 [kJ]                // kilo calorie
_kg      = 1 [kg]                           // kilogram
_kgf     = 0.00980665 [kN]     // kilogram-force
_kip     = 4.4482216 [kN]        // 1000 * _lbf
_kJ      = 1 [kJ]                           // kilo Joule
_km     = 1000 [m]                    // kilometer
_km2   = 10^6 [m^2]               // square kilometer
_km3   = 10^9 [m^3]               // cubic kilometer

_kmph = 0.27777778 [m/s]   // kilometer per hour,  or  _kmphr
_kN     = 1 [kN]                         // kilo newton
_knot   = 0.514444 [m/s]       // knot, or _kn
_kPa    = 1 [kPa]                       // kilo Pascal
_ksi      = 6894.7573 [kPa]     // 1000 * _psi
_ksf      = 47.880279 [kPa]     // 1000 * _psf

_kt        = 0.0002052 [kg]      // carat,   or  _carat
_kW     = 1 [kW]                       // kilo Watt
_kWh   = 3600 [kJ]                 //  _kW*_hr

_L      = 0.001 [m^3]                  // liter
_lb     = 0.45359237 [kg]           // pound-mass,  or  _lbm
_lbf    = 0.0044482216 [kN]     // pound-force
_ly     = 9.4607  x 10^15  [m]    // light year
_lyr    = 31622400 [s]                 // leap year

_m           = 1 [m]                           // meter
_m2         = 1 [m^2]                      // square meter
_m3         = 1 [m^3]                      // cubic meter
_mach     = 320 [m/s]                  // mach, typical value 320 m/s
_mb         = 0.1 [kPa]                    // milli bar,   or  _mbar
_mg         = 10^-6 [kg]                 // milligram
_mi          = 1609.344 [m]                                         // mile
_mi2        = 2589988.110336 [m^2]                      // square mile
_mi3        = 4.16818182544058 x 10^9 [m^3]     // cubic mile
_min        = 60 [s]                          // minute
_mJ          = 10^-6  [kJ]                // milli Joule
_MJ         = 1000 [kJ]                   // mega Joule
_mL         = 10^-6 [m^3]             // milli-liter,  _cc = _cm^3
_mm        = 0.001 [m]                  // millimeter
_mm2      = 10^-6 [m^2]             // square millimeter
_mm3      = 10^-9 [m^3]             // cubic millimeter
_mmAq   = 0.00980638 [kPa]   // mm of water
_mmHg   = 0.13332237 [kPa]    // mm of mercury,  _torr
_MN        = 1000 [kN]                 // mega newton
_MPa       = 1000 [kPa]               // mega Pascal
_mph       = 0.44704 [m/s]         // mile per hour,  _mi/_hr
_ms          = 0.001 [s]                   // milli second
_mum      = 10^-6 [m]                 // micrometer, micron
_mus        = 10^-6  [s]                  // micro second
_MW        = 1000 [kW]                // mega Watt
_mW         = 10^-6  [kW]            // milli Watt

_N      = 0.001 [kN]         // newton

_nm     = 10^-9  [m]         // nano meter
_nmi    = 1852 [m]            // nautical mile
_ns       = 10^-9  [s]           // nano second

_oz      = 0.0283495 [kg]         // ounce-mass,   or   _ozm
_ozf     = 0.000278014 [kN]   // ounce-force

_Pa     = 0.001 [kPa]                      // Pascal
_pc     = 3.0857 x 10^16  [m]       // parsec
_pdl    = 0.000138255 [kN]         // poundal
_psi    = 6.8947573 [kPa]              //   _lbf/_in^2
_psf    = 0.047880279 [kPa]        //   _lbf/_ft^2
_pt     = 473.1765 x 10^-6 [m^3]        // pint
_Pt     = 568.26125 x 10^-6 [m^3]     // pint(UK)  //_Pint
_py     = 3.30579 [m^2]                        // pyung

_qt     = 946.35296 x 10^-6 [m^3]     //   quart
_Qt     = 1136.5225 x 10^-6 [m^3]      //   quart(UK)  //_Quart

_s          = 1 [s]                         // second
_slug    = 14.5939 [kg]          // slug
_stone  = 6.3502932 [kg]    // stone

_tbsp       = 14.78676 x 10^-6  [m^3]          //  tablespoon
_Tbsp      = 14.20653125 x 10^-6 [m^3]    //  tablespoon(UK)
_therm    = 105480.4 [kJ]                      // (US)
_Therm  = 105505.59 [kJ]                     // (Europe)
_ton         = 1000 [kg]                              // ton
_Ton        = 907.1847 [kg]                       // English ton
_tonf        = 9.80665 [kN]                       // ton-force
_Tonf       = 8.8964432 [kN]                  // English ton-force
_torr         = 0.13332237 [kPa]               // torr, mmHg
_tsp          = 4.92892 x 10^-6  [m^3]            // teaspoon
_Tsp         = 3.5516328125 x 10^-6 [m^3]   // teaspoon(UK)

_W        = 0.001 [kW]          // Watt
_week   = 604800 [s]          // week
_Wh      = 3.6 [kJ]                //   _W*_hr

_yd      = 0.9144 [m]                             // yard
_yd2   = 0.83612736 [m^2]               // square yard
_yd3   = 0.764554857984 [m^3]      //  cubic yard
_yr      = 31536000 [s]                         // non-leap year

Comments are closed.