Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMU and g/mol are not dimensionally compatible?? #651

Closed
ejmeitz opened this issue May 25, 2023 · 1 comment
Closed

AMU and g/mol are not dimensionally compatible?? #651

ejmeitz opened this issue May 25, 2023 · 1 comment

Comments

@ejmeitz
Copy link
Contributor

ejmeitz commented May 25, 2023

I have some masses in atomic mass units and energy units that are kcal/mol. For some reason Unitful won't let me uconvert() atomic mass units into g/mol even though they are equivalent (e.g. mass of Carbon is 12.011 u or g/mol). This prevents the per mol quantity from canceling with the energy and its breaks everything.

Is there some way around this?

@sostock
Copy link
Collaborator

sostock commented Jun 1, 2023

u is a unit of mass and g/mol is a unit of molar mass. These are different dimensions, so one cannot be converted to the other. Also, since 20 May 2019, 1 u and 1 g/mol are not exactly equivalent (see below).

To get an approximate result, you can multiply the mass by the avogadro constant before converting to g/mol:

julia> uconvert(u"g/mol", 1u"u*Na")
0.9999999996544214 g mol^-1

The reason that this is not exactly 1 g/mol is the following:

This package follows the latest version of the SI unit system. Since the 2019 redefinition of the base SI units, the molar mass of a substance in g/mol and the mass of one of its molecules in u have slightly different values.

In short, before 2019, the Avogadro constant was an inexact measurement and the molar mass constant was defined to be exactly 1 g/mol. In 2019, the Avogadro constant was defined to be exact (because its value forms the basis for one of the SI base units, the mol) and as a result, the molar mass constant is no longer exact.

For more information, see the following links:

https://en.wikipedia.org/wiki/Dalton_(unit)#2019_redefinition_of_the_SI_base_units
https://en.wikipedia.org/wiki/2019_redefinition_of_the_SI_base_units#Mole
https://en.wikipedia.org/wiki/Molar_mass_constant

@sostock sostock closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants