# Kelvin per Kelvin Difference

I'm trying to use Mathematica units more often, but I've run into the following problem:

    (*Define some unitful constants*)
q = UnitConvert[Quantity["elementary charge"]];
k = UnitConvert[Quantity["Boltzmann Constant"]];
T = Quantity[300, "Kelvin"];
V = Quantity[5, "Volt"];
(*Do a simple calculation*)
UnitConvert[(q V)/(k T)]


The above code outputs

    Quantity[193.409, ("Kelvins")/("KelvinsDifference")]


which really should just be 193.409, since the units cancel, but Mathematica insists on a distinction between absolute temperature and temperature differences. I understand that such a distinction is useful in conversions, but the above is quite a nuisance.

Is there a way to prevent this? I'd rather not have to put in QuantityMagnitude calls every time I need to cancel some Kelvins.

Thanks!

-

This appears to be a bug. The dimensions of the Boltzmann constant are incorrect. In fact, all the physical constants I checked have TemperatureUnit where they should have TemperatureDifferenceUnit. You should only have to make a substitution when making calls to physical constants in Quantity:

q = UnitConvert[Quantity["elementary charge"]];
k = (UnitConvert[Quantity["Boltzmann Constant"]] /.
"Kelvins" -> "KelvinsDifference");
T = Quantity[300, "Kelvin"];
V = Quantity[5, "Volt"];
UnitConvert[(q V)/(k T)]
(* 193.409 *)


EDIT: Alternatively, since Quantity seems to be calling away to Alpha, you could do

k = UnitConvert[Quantity["Boltzmann Constant (energy per temperature difference)"]]

-
Thanks! I agree: it makes a lot more sense for those to be TemperatureDifferenceUnit. And your fix solves my problem! –  Sam Bader Mar 7 '13 at 1:29