hgrecco / pint

Operate and manipulate physical quantities in Python
http://pint.readthedocs.org/
Other
2.37k stars 466 forks source link

ISO British Thermal Units #858

Closed crusaderky closed 4 years ago

crusaderky commented 5 years ago

Wikipedia mentions that Btu, according to ISO 31-4, is equal to 1055.06 (https://en.wikipedia.org/wiki/British_thermal_unit). Pint instead states 1055.056 (commit: https://github.com/hgrecco/pint/commit/3ad5c2bb24ca92cb69353af9a84458da9bebc8f3 by @Jellby). Browsing the ISO website, I understand that the latest authoritative document is ISO 80000-5:2019 (https://www.iso.org/standard/64976.html), which however is behind a paywall. -_-

Can anybody with access figure out which one is right so that either pint or wikipedia can be fixed?

Jellby commented 5 years ago

I don't remember which source i used, but if you google "btu iso 1055.056" you find quite a few sources. That's of course not authoritative.

The older version ISO 80000-5:2017 apparently says:

1 Btu = 788.169 ft・lbf ≈ 1 055.056 J

(https://ja.wikipedia.org/wiki/ISO_80000-5).

The WP page was changed from 1055.056 to 1055.06 in 2017 (https://en.wikipedia.org/w/index.php?title=British_thermal_unit&type=revision&diff=759128875&oldid=759076233). It seems the "new" value is based on a table in some printed book (https://books.google.se/books?id=-ZveBwAAQBAJ&pg=PA19-IA35&redir_esc=y#v=onepage&q&f=false). I actually doubt this should be taken as the authoritative definition of Btu(ISO) and (without access to the latest actual ISO standard) I'd vote for changing the WP, and maybe change the pint definition to 788.169 ft*lbf too.

crusaderky commented 5 years ago

Well that's even more confusing...

>>> ureg("788.169 ft*lbf").to("joule")
1068.6136765184112 joule
Jellby commented 5 years ago

I guess it should be 778.169.

hgrecco commented 5 years ago

BTW, my we should enforce the policy that all definitions must be referenced to some external source. Just adding a comment above a definition or section would suffice.

Jellby commented 5 years ago

I guess it should be 778.169.

But 778.169 ft*lbf = 1055.055497... J, and the rounding should have been 1055.055, so I guess that's not the exact definition.

On the other hand, 1055.056 J = 778.16937... ft*lbf, so the rounding works if one says:

1 Btu? = 1 055.056 J ≈ 778.169 ft・lbf

Moreover, 1055.06 J = 778.1723... ft*lbf, if it helps matching the sources...

crusaderky commented 4 years ago

Closing - based on the assumption that anybody who needs to deal with BTUs professionally will most likely have his company's own definition handy (whatever it is).