On this wiki page, temperature conversion is presented clearly. For example.

enter image description here

It also warns that we should take care of temperature difference conversion which is a different conversion as

It is critical to remember that converting units of temperature differences (also referred to as temperature deltas) is not the same as converting absolute temperature values, and different formulae must be used.

To correctly convert a delta temperature from ​​Fahrenheit to ​Celsius​ you have to use the formula ΔT°F = 9/5 ΔT°C.

To correctly convert a delta temperature from Celsius to Kelvin​, it is 1:1 (ΔT°C = ΔK).

In version 13.1

Quantity[1., 1/"DegreesCelsius"] // UnitConvert
Quantity[1., 1/"DegreesFahrenheit"] // UnitConvert
Quantity[1., "DegreesCelsius"] // UnitConvert
Quantity[1., "DegreesFahrenheit"] // UnitConvert



which is pretty good. It automatically recognize that if DegreesCelsius or DegreesFahrenheit is denominator, then it must mean temperature difference.

But in version 13.2 and later, same input gives

During evaluation of In[1014]:= Quantity::ctunit: Compound unit given with absolute 1/(DegreesCelsius); converting to Kelvins.
Out[1014]= 274.15/K
During evaluation of In[1014]:= Quantity::ctunit: Compound unit given with absolute 1/(DegreesFahrenheit); converting to Kelvins.
Out[1015]= 255.928/K
Out[1016]= 274.15K
Out[1017]= 255.928K
a = Quantity[1., 1/"DegreesCelsius"]

I think the first two are nonsense.

Actually, you do not need to specifically use UnitConvert. In 13.2, if you run Quantity[1., 1/"DegreesCelsius"], MMA automatically throw message and convert to Kelvins for you!

Maybe MMA just want us to use temperature difference unit more precisely. But I do not see any improper when DegreesCelsius is denominator. According to this wiki page,

The degree Celsius (symbol: °C) can refer to a specific temperature on the Celsius scale or a unit to indicate a difference or range between two temperatures

and anyway, in 13.1, MMA is doing correct. What MMA does in 13.2 seems buggy to me.

How to restore 13.1 behavior when dealing with temperature quantities in 13.2?

  • $\begingroup$ is there a unit called 1/"DegreesCelsius"? May be they fixed this in V 13.3? $\endgroup$
    – Nasser
    Jul 8, 2023 at 9:20
  • 1
    $\begingroup$ Look at "DegreesFahrenheitDifference". Also reference.wolfram.com/language/tutorial/TemperatureUnits.html $\endgroup$
    – lericr
    Jul 8, 2023 at 10:10
  • $\begingroup$ There's a related opinion from 2015 that discusses the distinction between temperatures units and temperature differences at Is it reasonable to have both TemperatureUnit and TemperatureDifferenceUnit?. MMA 13.2 makes the distinction in that: "The Wolfram Language quantity framework distinguishes DegreesCelsius as a unit of temperature from DegreesCelsiusDifference as a unit of temperature difference." $\endgroup$
    – creidhne
    Jul 8, 2023 at 10:31
  • $\begingroup$ @Nasser Why is there no 1/"DegreesCelsius"? What about acceleration Quantity[1, "m"/"s"^2]? $\endgroup$
    – matheorem
    Jul 8, 2023 at 13:12
  • 1
    $\begingroup$ Yes, I understand you're talking about the difference with 13.2. My position is that this issue is essentally fixed in 13.2, and so the behavior in 13.1 is no longer considered "good". The idea of a unit of 1/DegreesCelsius just doesn't really make much sense. The 13.2 behavior guards against semantically meaningless computations. $\endgroup$
    – lericr
    Jul 8, 2023 at 17:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.