jwscook / IonCyclotronEmissionDoubletSplitting

3 stars 1 forks source link

Electronmass with UnitSystems #1

Open chakravala opened 2 years ago

chakravala commented 2 years ago

I recommend using UnitSystems to get the most consistent physical constants available:

julia> using UnitSystems

julia> electronmass(Metric)
9.109383701558256e-31

julia> protonmass(Metric)
1.6726219236940502e-27

julia> mā‚‘
9.109383701558256e-31

julia> Ī¼ā‚šā‚‘
1836.152673432705

Or alternatively, if you also want Quantity metadata, using Similitude

julia> using Similitude

julia> electronmass(Metric)
š˜©ā‹…š˜¤ā»Ā¹Rāˆžā‹…Ī±ā»Ā²2 = 9.109383701558251e-31 [kg] Metric

julia> protonmass(Metric)
š˜©ā‹…š˜¤ā»Ā¹Rāˆžā‹…Ī±ā»Ā²Ī¼ā‚‘įµ¤ā»Ā¹Ī¼ā‚šįµ¤ā‹…2 = 1.6726219236940495e-27 [kg] Metric

However, UnitSystems is a much more lightweight due to only relying on Float64 algebra instead of abstract Group algebra.

jwscook commented 2 years ago

Thanks, this would be an improvement. I was aware of Unitful.jl, which is a bit bloaty imo, but I didn't know about this one.