Built-in Constants
Igor
for example:
Common name: Euler-Mascheroni gamma
Suggested name: kGammaEuler
Value: 0.5772156649015328606065
Units: None
Reference: http://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant
Please respond by posting to this thread so that everyone can see the list as it is being compiled.
A.G.
WaveMetrics, Inc.
Common Name: Magnetic Constant \mu_0
Suggested Name: kMu0
Value: (Pi * 4e-7) [exact]
Units: N / (A^2)
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?mu0|search_for=universal_in!
Common Name: Electric Constant \epsilon_0
Suggested Name: kEpsilon0
Value: 8.854 187 817... x 10-12 [exact]
Units: F/m
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?ep0#mid
Common Name: elementary charge e
Suggested Name: kqe
Value: 1.602 176 487 x 10-19
Units: C
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?e|search_for=elecmag_in!
March 1, 2011 at 02:39 pm - Permalink
Possible Name: Mol
Value: 6.02214078 x 10^23
Units: molecules/Mole
Reference: http://en.wikipedia.org/wiki/Mole_(unit)
Mac #513
March 1, 2011 at 03:31 pm - Permalink
Suggested name: kmassneutron
Value:1.674 927 211e-27
Units: kg
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?mn
Common name: mass of proton
Suggested name: kmassproton
Value:1.672 621 637e-26
Units: kg
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?mp
Common name: Plancks Constant
Suggested name: kPlanck
Value:6.626 068 96e-34
Units: Js
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?mp
Common name: Speed of light in vacuum
Suggested name: kLightSpeed
Value:299 792 45
Units: m/s
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?c
Common name: Avogadro
Suggested name: kAvogadro
Value:6.022 141 79e23
Units:
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?c
Common Name: Plancks constant divided by mass of neutron
Suggested name: kPlanckOverMassNeutron
Value:6.626e-34/1.674927211e-27
Units: Js/kg
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?c
Common Name: classical electron radius
Suggested name: kElectronRadius
Value:2.817 940 2894 e-15
Units: m
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?re|search_for=Classical+elect…
Also need Boltzmann, ideal gas constant, etc
For ease of importing check out:
http://physics.nist.gov/cuu/Constants/Table/allascii.txt
I vote for static constants in an includable procedure file, accessible by a module name. Or by a function e.g. PhysConstant(0|1|3|4, etc)
March 1, 2011 at 03:09 pm - Permalink
Professor of Chemistry
University of Wisconsin Oshkosh
http://www.uwosh.edu/facstaff/gutow
Rather than list the ones I use most commonly, I would also second including the list from the NIST standards site. I periodically import an update of this for my own use. Unfortunately this text listing does not include common symbols.
http://physics.nist.gov/cuu/Constants/Table/allascii.txt
If you go to the following page and select "table (pdf)" and then click on the button for "Extensive listings" you will get a .pdf file with all the constants and their preferred symbols. I recommend these be translated as follows:
Xy would be translated to an Igor constant name as X_y. Infinity symbols could be two little o's next to each other as in R_oo.
The link is: http://physics.nist.gov/cuu/Constants/index.html
I recommend this as an optional package with some sort of easy table to select constant names from. Maybe have them appear in a popup in the "Compose Expression" dialog.
My two cents.
Jonathan
March 1, 2011 at 03:26 pm - Permalink
Harald Stark
March 1, 2011 at 04:53 pm - Permalink
Common Name: Vacuum Impedance
Suggested Name: kZ0
Value: 119.916982 * Pi [exact]
Value: 376.730 313 461 77 [numeric]
Units: Ohm
Reference: http://en.wikipedia.org/wiki/Impedance_of_free_space
March 2, 2011 at 03:27 am - Permalink
Mac's comment: "Better, Newer" value in the wikipedia link above - difference is 0.000 001 01e23
I like the includable procedures file idea as well
March 2, 2011 at 07:19 am - Permalink
The earlier comment about units is appropriate. I do not have a good solution, but for the mac users, There is a very nice unit converter dashboard widget that understands mass energy-mass equivalence and atomic units at http://www.cberthod.homepage.bluewin.ch/vuc/widget.html
It even knows that c = 9.7156e-21 parsec/ps!
Common name: Si lattice parameter
Suggested name: aSi_A
Value:5.43102064
Units: Angstrom
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?asil
Common name: hc in keV Angstroms
Suggested name: hc_keVA
Value:12.39841856
Units: keV Angstrom
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?hev, http://physics.nist.gov/cgi-bin/cuu/Value?c
Common name: hc in keV nm
Suggested name: hc_keVA
Value:1.239841856
Units: keV nm
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?hev, http://physics.nist.gov/cgi-bin/cuu/Value?c
Common name: Thomson radius
Suggested name: re_m
Value:2.8179402894e-15
Units: m
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?sigmae, sigmae = 8*PI/3 * re^2
Common name: Thomson radius
Suggested name: re_A
Value:2.8179402894e-5
Units: Angstrom
Reference: http://physics.nist.gov/cgi-bin/cuu/Value?sigmae, sigmae = 8*PI/3 * re^2
March 2, 2011 at 10:13 am - Permalink
Nomenclature ... see below
Units: SI
Values: all atomic masses
Nomenclature ... see below
Units: g/mol
Proper implementation of the constants is a by far a more important factor for me. I personally would like access to the constants through (user-immutable -- they cannot muck them up on their own) structures, as below.
#include "Atomic Masses" // WaveMetrics Provided
Function IdealGasCalc(n,ToC,V)
variable n, ToC, V
STRUCTURE ScientificConstants SC
variable T = ToC + SC.TK0C.value // SC.TK0C.value --> 273.15
return (n*SC.Rg.value*T/V) // you could also then have SC.Rg.units return the string units for the value
end
p1moleat25C1m3 = IdealGasCalc(1,25,1)
Function MolarMassCalc(elements,coef)
wave/T elements
wave coef
STRUCTURE AtomicMasses AM
variable ic, nt, itsM = 0
nt = ItemsInList(elements)
for (ic=0;ic<nt;ic+=1)
itsM += coef[ic]*AM.$(elements[ic]).value // this nomenclature is supposed to access the proper sub-member
endfor
return itsM
end
M_methane = MolarMassCalc("C;H;",{1,4})
Having a functional way for users to be able to translate ASCII (tab-delimited, XML ....) tables of constants into immutable "#include" structures (containing symbol, value, unit layouts) and check for existence of terms would be a big help ...
#include "Crystallography" // User Generated
Function Strain(stress,mtrl)
variable stress
string mtrl
STRUCTURE MaterialsProperties MP
if (existsTerm(MP.$(mtrl))==0))
DoAlert "Your material is not in the database"
return 0
endif
return (stress/MP.$(mtrl).E)
end
Function CubicUnitCellVolume(mtrl)
string mtrl
STRUCTURE CubicLatticeParameters LP
if (existsTerm(LP.$(mtrl))==0))
DoAlert "Your material is not in the database of cubic materials"
return 0
endif
return (LP.$(mtrl).ao.value^3)
end
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
March 2, 2011 at 10:31 am - Permalink