Skip to content

Instantly share code, notes, and snippets.

@stefco
Last active May 8, 2016 04:07
Show Gist options
  • Save stefco/164d494abd5d33ae5b1d16e556fb86d8 to your computer and use it in GitHub Desktop.
Save stefco/164d494abd5d33ae5b1d16e556fb86d8 to your computer and use it in GitHub Desktop.
a buncha constants that come in handy while doin some calculations!!! use em for astrophysics or whatever, i don't care1!!!
# a buncha constants that come in handy while doin some calculations!!!
# just copy and paste this and run it in your ipython or julia interpreter,
# what are you worried about?? it's just a buncha constants, i didn't
# make em up, i'm just usin em!!!!!
alpha = 0.00729927 # fine structure constant
k = 1.38064852e-23 # boltzman constant (J/K)
keV = 8.6173324e-5 # boltzman constant (eV/K)
Na = 6.022140857e23 # avogadro constant (1/mol)
RgasJ = 8.3144598 # gas constant (J/(K mol))
atm = 1.013e5 # 1 atmosphere (N/m^2)
bar = 1e5 # 1 bar (N/m^2)
sigma = 5.670367e-8 # stefan constant (W/(m^2 K^4))
Ms = 1.98855e30 # solar mass (kg)
Ls = 3.828e26 # solar luminosity (W)
Rs = 6.957e8 # solar radius (m)
c = 2.99792458e8 # speed of light (m/s)
pi = 3.14159265359 # pi
h = 6.62607004e-34 # planck constant (Js)
heV = 4.135667662e-15 # planck constant (eVs)
hbar = 1.054571800e-34 # reduced planck constant (Js)
hbareV = 6.582119514e-16 # reduced planck constant (eVs)
hcJ = 1.98644568e-25 # h*c (Jm)
hceV = 1.23984193e-6 # h*c (eVm)
e = 1.60217662e-19 # electron charge (C)
eV = e # electron volts/joule ()
me = 9.10938356e-31 # electron mass (kg)
mp = 1.6726219e-27 # proton mass (kg)
eps0 = 8.854187817e-12 # vacuum permittivity (F/m)
Ggrav = 6.67408e-11 # newton gravitational constant (N m^2 / kg^2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment