CoCalc Shared Filesdenemeler / speed_of_light.sagews
Author: Mesut KarakoĆ§
Views : 6
%md


Million = 10^6
unit_joule = sage.symbolic.units.convert(units.energy.joule, units.energy.ev)
unit_akb = sage.symbolic.units.convert(units.mass.amu, units.mass.kilogram)
speed_of_light = 299792458*units.length.meter/units.time.second #m/s
# E = mc^2
Emc2 = unit_akb * speed_of_light^2
Emc2joule = sage.symbolic.units.convert(unit_akb * speed_of_light^2, units.energy.joule)
Emc2MeV = sage.symbolic.units.convert(Emc2joule, units.energy.ev)

print "1 joule =", unit_joule
print "1 akb = ", unit_akb
print "E= 1 akb * c^2 = %s = %s"%(Emc2, Emc2joule)
print "E= 1 akb * c^2 = ", Emc2MeV
print "c^2 = E/1 akb = %.15f MeV/akb"%(float(str(Emc2MeV)[:-3])/Million) # eV/akb

1 joule = 6.24150636309403e18*ev 1 akb = (1.66053878200000e-27)*kilogram E= 1 akb * c^2 = (1.49241782981583e-10)*kilogram*meter^2/second^2 = (1.49241782981583e-10)*joule E= 1 akb * c^2 = 9.31493538119047e8*ev c^2 = E/1 akb = 931.493538119047003 MeV/akb

# $c^2 = E/1 akb = 931.493538119047003$ MeV/akb