fbe-constants.scm 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. #| -*-Scheme-*-
  2. Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
  3. 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
  4. 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
  5. Institute of Technology
  6. This file is part of MIT/GNU Scheme.
  7. MIT/GNU Scheme is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11. MIT/GNU Scheme is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with MIT/GNU Scheme; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
  18. USA.
  19. |#
  20. ;;;; Numerical constants
  21. ;;; FBE: these constants are already defined in 'kernel/numerical.scm'
  22. ;; (define-constant ':pi "\\pi" "Pi"
  23. ;; (* 4 (atan 1 1))
  24. ;; &unitless)
  25. ;; (define-constant ':2pi "2\\pi" "2*Pi"
  26. ;; (* 8 (atan 1 1))
  27. ;; &unitless)
  28. ;; (define-constant ':pi/2 "\\pi/2" "Pi/2"
  29. ;; (* 2 (atan 1 1))
  30. ;; &unitless)
  31. ;; (define-constant ':pi/4 "\\pi/4" "Pi/4"
  32. ;; (atan 1 1)
  33. ;; &unitless)
  34. ;; (define-constant ':pi/3 "\\pi/3" "Pi/3"
  35. ;; (* 4/3 (atan 1 1))
  36. ;; &unitless)
  37. ;; (define-constant ':pi/6 "\\pi/6" "Pi/6"
  38. ;; (* 2/3 (atan 1 1))
  39. ;; &unitless)
  40. ;;
  41. ;; (define-constant ':-pi "-\\pi" "-Pi"
  42. ;; (* -4 (atan 1 1))
  43. ;; &unitless)
  44. ;; (define-constant ':-2pi "-2\\pi" "-2*Pi"
  45. ;; (* -8 (atan 1 1))
  46. ;; &unitless)
  47. ;; (define-constant ':-pi/2 "-\\pi/2" "-Pi/2"
  48. ;; (* -2 (atan 1 1))
  49. ;; &unitless)
  50. ;; (define-constant ':-pi/4 "-\\pi/4" "-Pi/4"
  51. ;; (- (atan 1 1))
  52. ;; &unitless)
  53. ;; (define-constant ':-pi/3 "-\\pi/3" "-Pi/3"
  54. ;; (* -4/3 (atan 1 1))
  55. ;; &unitless)
  56. ;; (define-constant ':-pi/6 "-\\pi/6" "-Pi/6"
  57. ;; (* -2/3 (atan 1 1))
  58. ;; &unitless)
  59. ;;
  60. ;; (define-constant ':+pi "+\\pi" "+Pi"
  61. ;; (* +4 (atan 1 1))
  62. ;; &unitless)
  63. ;; (define-constant ':+2pi "+2\\pi" "+2*Pi"
  64. ;; (* +8 (atan 1 1))
  65. ;; &unitless)
  66. ;; (define-constant ':+pi/2 "+\\pi/2" "+Pi/2"
  67. ;; (* +2 (atan 1 1))
  68. ;; &unitless)
  69. ;; (define-constant ':+pi/4 "+\\pi/4" "+Pi/4"
  70. ;; (+ (atan 1 1))
  71. ;; &unitless)
  72. ;; (define-constant ':+pi/3 "+\\pi/3" "+Pi/3"
  73. ;; (* +4/3 (atan 1 1))
  74. ;; &unitless)
  75. ;; (define-constant ':+pi/6 "+\\pi/6" "+Pi/6"
  76. ;; (* +2/3 (atan 1 1))
  77. ;; &unitless)
  78. (define-constant ':gamma "\\gamma" "Euler-Macheroni-constant"
  79. 0.57721566490153286060651209008240243104215933593992
  80. &unitless)
  81. ;;;; Universal Physical Constants
  82. (define-constant ':c "c" "speed of light"
  83. 2.99792458e8
  84. (g:/ &meter &second))
  85. #|
  86. ;;; (1986)
  87. (define-constant ':G "G" "gravitational constant"
  88. 6.67259e-11
  89. (g:/ (g:* &newton (g:square &meter)) (g:square &kilogram))
  90. 128e-6)
  91. |# ;relative error
  92. ;;; CODATA 2006
  93. (define-constant ':G "G" "gravitational constant"
  94. 6.67428e-11
  95. (g:/ (g:* &newton (g:square &meter)) (g:square &kilogram))
  96. 1.0e-4)
  97. ;;; CODATA 2006
  98. (define-constant ':e "e" "elementary charge"
  99. 1.602176487e-19
  100. &coulomb
  101. 2.5e-8)
  102. ;;; CODATA 2006
  103. (define-constant ':h "h" "Planck constant"
  104. 6.62606896e-34
  105. (g:* &joule &second)
  106. 5.0e-8)
  107. ;;; CODATA 2006
  108. (define-constant ':N_A "N_A" "Avogadaro constant"
  109. 6.02214179e23
  110. (g:/ &unitless &mole)
  111. 5.0e-8)
  112. ;;; CODATA 2002
  113. (define-constant ':m_e "m_e" "electron mass"
  114. 9.1093826e-31
  115. &kilogram
  116. 1.7e-7)
  117. ;;; CODATA 2002
  118. (define-constant ':m_p "m_p" "proton mass"
  119. 1.67262171e-27
  120. &kilogram
  121. 1.7e-7)
  122. ;;; CODATA 2002
  123. (define-constant ':m_n "m_n" "neutron mass"
  124. 1.67492728e-27
  125. &kilogram
  126. 1.7e-7)
  127. ;;; CODATA 2002
  128. (define-constant ':m_u "m_u" "atomic mass unit"
  129. 1.66053886e-27
  130. &kilogram
  131. 1.7e-7)
  132. ;;; CODATA 2002
  133. (define-constant ':mu_e "\\mu_e" "electron magnetic moment"
  134. -9.28476412e-24
  135. (g:/ &joule &tesla)
  136. 8.6e-8)
  137. ;;; CODATA 2002
  138. (define-constant ':mu_p "\\mu_p" "proton magnetic moment"
  139. 1.41060671e-26
  140. (g:/ &joule &tesla)
  141. 8.7e-8)
  142. ;;; CODATA 2002
  143. (define-constant ':gamma_p "\\gamma_p" "proton gyromagnetic ratio"
  144. 2.67522205e8
  145. (g:/ &radian (g:* &tesla &second))
  146. 8.6e-8)
  147. (define-constant ':R_H "R_H" "quantum Hall resistance"
  148. 25812.8056
  149. &ohm
  150. 0.045e-6)
  151. (define-constant ':R "R" "molar gas constant"
  152. 8.314510
  153. (g:/ &joule (g:* &mole &kelvin))
  154. 8.4e-6)
  155. ;;; CODATA 2002
  156. (define-constant ':k "k" "Boltzmann constant"
  157. 1.3806505e-23
  158. (g:/ &joule &kelvin)
  159. 1.8e-6)
  160. ;;; The following are derived. Units must check.
  161. (define-constant ':h-bar "\\hbar" "Planck constant"
  162. (g:/ :h (* 2 :pi))
  163. (g:* &joule &second))
  164. (define-constant ':F "F" "Faraday constant"
  165. (g:* :N_A :e)
  166. (g:/ &coulomb &mole)
  167. 0.30e-6)
  168. (define-constant ':mu_0 "\\mu_0" "permeability of free space"
  169. (* 4e-7 :pi)
  170. (g:/ &henry &meter))
  171. (define-constant ':epsilon_0 "\\epsilon_0" "permittivity of free space"
  172. (g:/ 1
  173. (g:* :mu_0 (g:square :c)))
  174. (g:/ &farad &meter))
  175. (define-constant ':Z0 "Z_0" "impedance of free space"
  176. (g:* :mu_0 :c)
  177. &ohm)
  178. (define-constant ':alpha "\\alpha" "fine structure constant"
  179. (g:* (g:/ 1 (g:* 4 :pi :epsilon_0))
  180. (g:/ (g:square :e) (g:* :h-bar :c)))
  181. &unitless)
  182. (define-constant ':R_infinity "R_\\inf" "Rydberg constant"
  183. (g:/ (g:* :m_e :c (g:square :alpha))
  184. (g:* 2 :h))
  185. (g:/ &unitless &meter)
  186. 0.0012e-6)
  187. (define-constant ':r_e "r_e" "classical electron radius"
  188. (g:* (g:/ :h-bar (g:* :m_e :c)) :alpha)
  189. &meter
  190. 0.013e-6)
  191. (define-constant ':lambda_C "\\lambda_C" "electron Compton wavelength"
  192. (g:/ :h (g:* :m_e :c))
  193. &meter
  194. 0.089e-6)
  195. (define-constant ':a_0 "a_0" "Bohr radius"
  196. (g:/ :r_e (g:square :alpha))
  197. &meter
  198. 0.045e-6)
  199. (define-constant ':Phi_0 "\\Phi_0" "magnetic flux quantum"
  200. (g:/ :h (g:* 2 :e))
  201. &weber
  202. 0.30e-6)
  203. (define-constant ':h/2m_e "h/(2m_e)" "quantum of circulation"
  204. (g:/ :h (g:* 2 :m_e))
  205. (g:/ (g:square &meter) &second)
  206. 0.089e-6)
  207. (define-constant ':e/m_e "e/m_e" "specific electron charge"
  208. (g:/ (g:- :e) :m_e)
  209. (g:/ &coulomb &kilogram)
  210. 0.30e-6)
  211. (define-constant ':mu_B "\\mu_B" "Bohr magneton"
  212. (g:/ (g:* :e :h-bar) (g:* 2 :m_e))
  213. (g:/ &joule &tesla)
  214. 0.34e-6)
  215. (define-constant ':mu_e/mu_B "\\mu_e/\\mu_B" "electron magnetic moment ratio"
  216. (g:/ :mu_e :mu_B)
  217. &unitless
  218. 1e-11)
  219. (define-constant ':mu_N "\\mu_N" "nuclear magneton"
  220. (g:/ (g:* :e :h-bar) (g:* 2 :m_p))
  221. (g:/ &joule &tesla)
  222. 0.34e-6)
  223. (define-constant ':sigma "\\sigma" "Stefan-Boltzmann constant"
  224. (g:* (g:/ (g:square :pi) 60)
  225. (g:/ (g:expt :k 4)
  226. (g:* (g:expt :h-bar 3) (g:expt :c 2))))
  227. (g:/ &watt (g:* (g:square &meter) (g:expt &kelvin 4)))
  228. 34.0e-6)
  229. (define-constant ':sigma_T "\\sigma_T" "Thomson cross section"
  230. (g:* 8/3 :pi (g:square :r_e))
  231. (g:square &meter))
  232. ;;;; Observed and measured numbers
  233. (define background-temperature ;Cobe 1994
  234. (& 2.726 &kelvin)) ;+-.005 Kelvin
  235. ;;; Thermodynamic
  236. (define water-freezing-temperature
  237. (& 273.15 &kelvin))
  238. (define room-temperature
  239. (& 300.00 &kelvin))
  240. (define water-boiling-temperature
  241. (& 373.15 &kelvin))
  242. ;;; Earth
  243. (define earth-orbital-velocity
  244. (& 29.8e3 (g:/ &meter &second)))
  245. (define earth-mass
  246. (& 5.976e24 &kilogram))
  247. (define earth-radius
  248. (& 6371e3 &meter))
  249. (define earth-surface-area
  250. (& 5.101e14 (g:expt &meter 2)))
  251. (define earth-escape-velocity
  252. (& 11.2e3 (g:/ &meter &second)))
  253. (define earth-gravitational-acceleration
  254. (& 9.80665 (g:/ &meter (g:expt &second 2))))
  255. (define :g
  256. earth-gravitational-acceleration)
  257. (define earth-mean-density
  258. (& 5.52e3 (g:/ &kilogram (g:expt &meter 3))))
  259. ;;; This is the average amount of
  260. ;;; sunlight available at Earth on an
  261. ;;; element of surface normal to a
  262. ;;; radius from the sun. The actual
  263. ;;; power at the surface of the earth,
  264. ;;; for a panel in full sunlight, is
  265. ;;; not very different, because, in
  266. ;;; absence of clouds the atmosphere
  267. ;;; is quite transparent. The number
  268. ;;; differs from the obvious geometric
  269. ;;; number
  270. ;;; (/ sun-luminosity (* 4 :pi (square m/AU)))
  271. ;;; ;Value: 1360.454914748201
  272. ;;; because of the eccentricity of the
  273. ;;; Earth's orbit.
  274. (define earth-incident-sunlight
  275. (& 1370. (g:/ &watt (g:expt &meter 2))))
  276. (define vol@stp
  277. (& 2.24136e-2 (g:/ (g:expt &meter 3) &mole)))
  278. (define sound-speed@stp ;c_s
  279. (& 331.45 (g:/ &meter &second)))
  280. (define pressure@stp
  281. (& 101.325e3 &pascal))
  282. (define earth-surface-temperature
  283. (g:+ (& 15 &kelvin)
  284. water-freezing-temperature))
  285. ;;; Sun
  286. (define sun-mass
  287. (& 1.989e30 &kilogram))
  288. (define :m_sun sun-mass)
  289. (define sun-radius
  290. (& 6.9599e8 &meter))
  291. (define :r_sun sun-radius)
  292. (define sun-luminosity
  293. (& 3.826e26 &watt))
  294. (define :l_sun sun-luminosity)
  295. (define sun-surface-temperature
  296. (& 5770.0 &kelvin))
  297. (define sun-rotation-period
  298. (& 2.14e6 &second))
  299. ;;; The Gaussian constant
  300. (define GMsun ;=(* gravitational-constant sun-mass)
  301. (& 1.32712497e20
  302. (g:/ (g:* &newton (g:expt &meter 2)) &kilogram)))