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

Wrong energy conversion #182

Open
rogiervandongen opened this issue Mar 15, 2022 · 1 comment
Open

Wrong energy conversion #182

rogiervandongen opened this issue Mar 15, 2022 · 1 comment
Assignees
Labels

Comments

@rogiervandongen
Copy link

Hi there,

I've found that the conversions in the Energy Unit is far from correct.

First off, I'd like to explicitly denote the Calorie unit is not a unit with one exact definition and highly depends on what definition you're using.
There is a massive difference between nutritional, thermochemical, IT and (verying) atmospheric calories.

Since you're using 4184 as a conversion factor, I'm assuming your implementation is for the Thermochemical calorie unit.

Then still, this factor is off by 1000 (which micht be explained with the confusing way of indicating cals when kcals are what's really meant).

According to many resources (but quoting wikipedia here):
(a) The 'Thermochemical calorie' was defined by Rossini simply as 4.1833 international joules in order to avoid the difficulties associated with uncertainties about the heat capacity of water. It was later redefined as 4.1840 J exactly.

It may just as well be that more classes in the namespace for Energy units suffer from similar conversion issues, but this I found to be particularly disturbing.
If/when fixed, it's also highly advisable to make an explicit note which specific calorie definition is meant.

@jordanbrauer
Copy link
Owner

Hi @rogiervandongen ! I appreciate the detailed explanation, thank you for looking into this.

To confirm your assumption about which calorie unit is described by Calorie, the answer is yes, the code is in reference to the thermochemical calorie.

If/when fixed, it's also highly advisable to make an explicit note which specific calorie definition is meant.

Since you seem to have some strong knowledge in this area of units (no pun intended), I would be more than happy to review a PR from you. :) "If/when" is entirely up to you, mate. From what I gather in your description of the problem you encountered, the fix might be

  • some adjustments to one or more energy unit base values;
  • possibly rename the calorie unit to better communicate what it measures;
  • add additional energy units?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants