Temperature Units

There are two closely related (RefLink[UnitDimensions, paclet:ref/UnitDimensions]) related to temperature in the Wolfram System: absolute temperature units and temperature difference units.

Absolute Temperature versus Temperature Difference

(RefLink[Quantity, paclet:ref/Quantity]) expressions that have (RefLink[UnitDimensions, paclet:ref/UnitDimensions]) with "TemperatureUnit" represent an absolute temperature, while those with dimensions of "TemperatureDifferenceUnit" represent the difference between absolute temperatures. It is important to know that the two are related, but not directly interchangeable.

Unit conversion and multiplication are non-commutative operations for absolute temperatures, which means conversion and then multiplication will not necessarily result in the same result as multiplication and then conversion. Here is an example.

UnitConvert[Quantity[3., "DegreesFahrenheit"] *2,"Kelvins"]

UnitConvert[Quantity[3., "DegreesFahrenheit"],"Kelvins"]*2

Temperature difference units, however, can be freely multiplied and converted:

UnitConvert[Quantity[3., "DegreesFahrenheitDifference"],"KelvinsDifference"]*2

UnitConvert[Quantity[3., "DegreesFahrenheitDifference"]*2,"KelvinsDifference"]

Adding Temperatures

(RefLink[Plus, paclet:ref/Plus]) will operate on the sum of temperature units and temperature difference units, and on the sum of temperature difference units, but not always on the sum of just temperature units.

Calculate the sum of an absolute temperature and a temperature difference:

Quantity[3,"DegreesFahrenheit"]+Quantity[2,"DegreesFahrenheitDifference"]

Calculate the sum of two temperature differences:

Quantity[3,"DegreesFahrenheitDifference"]+Quantity[2,"DegreesCelsiusDifference"]

A sum cannot generally be calculated for two different absolute temperatures:

Quantity[3,"DegreesFahrenheit"]+Quantity[2,"DegreesCelsius"]

However, the sum of two measures of absolute temperature, with the same unit, can be calculated:

Quantity[3,"DegreesFahrenheit"]+Quantity[2,"DegreesFahrenheit"]

A sum can also be calculated for two different absolute temperatures, if both are SI measures (i.e. have a base of kelvins):

Quantity[3,"Kilokelvins"]+Quantity[4,"Kelvins"]

Multiplying Temperatures

Multiplication and unit conversions are non-commutative for absolute temperatures.

UnitConvert[Quantity[3., "DegreesCelsius"] *18.2,"Kelvins"]

UnitConvert[Quantity[3., "DegreesCelsius"],"Kelvins"]*18.2

Because of this non-commutative trait, multiplication of different absolute temperatures may not evaluate.

Quantity[1.4,"DegreesCelsius"]/Quantity[8,"DegreesFahrenheit"]

When working with absolute temperatures, it is imperative to first standardize the units, to allow for proper unit conversions.

UnitConvert[Quantity[1.4,"DegreesCelsius"],"Kelvins"]/UnitConvert[Quantity[8,"DegreesFahrenheit"],"Kelvins"]

The single-argument form of (RefLink[UnitConvert, paclet:ref/UnitConvert]) will convert any temperature to kelvins:

f[t_]:=Quantity["MolarGasConstant"]*UnitConvert[t]

f[Quantity[18,"DegreesCelsius"]]

f[Quantity[18,"Kelvins"]]