When adding the bugs header to the question "Kelvin per Kelvin Difference" I was confused by the fact that I cannot determine for sure whether the described bug is fixed in version 10.2 or not: from the one hand the code in the question now produces what was expected by the OP, but from the other hand the underlying problem described in the answer by Xerxes (which has 16 upvotes and no contradictory comments or answers) is still here.
I always felt suspicious the fact that we have two different unit systems for temperature in Mathematica: temperature and temperature difference. The corresponding Documentation page where the motivation for introducing them seems to be explained does not convince me and I feel that the developers just "thrown the baby out with the bathwater" and introduction of these two unit systems creates more difficulties than adds benefits.
Could one provide an explanation why actually introducing of temperature difference units is necessary? What are benefits and drawbacks in practice?
And in the context of the referenced question: does Boltzmann Constant should be defined via "Kelvins"
or "KelvinsDifference"
in Mathematica?
I expect well-reasoned answers, not just opinions.
My conclusions from the discussion in the comments
The temperature difference units should NEVER arise automatically in Mathematica when performing physically reasonable arithmetic operations with physical units. If you get such units in the output you are doing something wrong or encounter a bug.
The temperature difference units actually are not intended for what we know in physics as calculations with quantities, their purpose is very simple and utilitarian: just to allow the conversions between Celsius, Fahrenheit and Kelvins in the way shown on the linked Documentation page. So Boltzmann Constant must be defined via "Kelvins"
(as it takes place to be) and Xerxes' complain about bug is incorrect: no physical constant should be defined via "KelvinsDifference"
because this unit is a special-purpose unit with very narrow field of applications and is not intended to be used as a base unit.
The temperature difference units were introduced for resolving ambiguous cases of conversion between Celsius, Fahrenheit and Kelvins which are described on the linked Documentation page. One can notice that the "KelvinsDifference"
unit is not strictly necessary for this purpose (the same can be achieved with only "Kelvins"
). The reason for introduction of "KelvinsDifference"
seems to be an attempt to unify the language. The fact that we have this unit proves that all the temperature difference units are artificial and were introduced with single-purpose goal to allow transparent conversion between temperature units. They do not play well with other parts of the Wolfram's "system-wide units" system and cause confusion when one tries to use the units system for performing the convenient in physics calculations with quantities (what is a different matter than just the conversion between temperature units!). The immediately obvious inconsistently can be illustrated using the classical example of calculation of efficiency of the Carnot cycle:
Suppose that we wish to calculate the efficiency of the Carnot cycle starting from the known temperature difference $ΔT$ between the hot reservoir and and the cold reservoir expressed via
°F
units and known temperature of the hot reservoir $T_H$ expressed via°F
units using the proper formula: $η=ΔT/T_H$. The straightforward and conceptually correct implementation of this formula for the case of°F
units in Mathematica is as follows:η[TH_, ΔT_] := UnitConvert[Quantity[ΔT, "DegreesFahrenheitDifference"]]/ UnitConvert[Quantity[TH, "DegreesFahrenheit"]]
what returns the "kelvins difference per kelvin" units which do not make sense.
UnitConvert[Quantity[1, "DegreesFahrenheit"]]
gives "256K", while1/UnitConvert[Quantity[1, "1/DegreesFahrenheit"]]
treats the quantity is a difference and gives5/9K
. (ButKelvin
notKelvinDifference
which is really what it is) Without resorting to some knowledge of physics there is no evident reason why a different formula should apply in the two cases. $\endgroup$