AnIML / techniques

AnIML Technique Definitions
17 stars 7 forks source link

Incorrect definition of unit degF #10

Closed ghost closed 4 years ago

ghost commented 4 years ago

The unit "degrees Fahrenheit / degF" is defined as

<!ENTITY degF "<Unit label='&#176;F'><SIUnit factor='1.8' offset='434.07'>K</SIUnit></Unit>">

in animl_unit_entities.dtd.

This definition would result in a conversion

F = 1.8 * K + 434.07

which is incorrect.

Actually, the conversion would be

F = 1.8 * K - 459.67

resulting in a definition

<!ENTITY degF "<Unit label='&#176;F'><SIUnit factor='1.8' offset='-459.67'>K</SIUnit></Unit>">

Please doublecheck and fix if appropriate.

ghost commented 4 years ago

Since we are converting from Kelvin to Fahrenheit, shouldn't the formula be:

F = (K - 273.15) * 1.8 + 32

https://www.nist.gov/pml/weights-and-measures/si-units-temperature

ghost commented 4 years ago

Well I can't find an obvious difference here as your equation and mine are the same:

F = (K - 273.15) * 1.8 + 32
F = 1.8 * K - 273.15 * 1.8 + 32
F = 1.8 * K - 459.67

I justed used the expanded form so that factor and offset can directly seen in the equation. Anything I am misssing here?

ghost commented 4 years ago

Fixed in https://github.com/AnIML/techniques/commit/fbdfbd5a69310bd86256536f0cd3cfa3aa2a2290