Today I came across the following behavior:
Quantity[x, "Minutes"/"Minutes"]^-1
(* Quantity[1/x, (1/#1 &)[("Minutes")/("Minutes")]] *)
It seems that Mathematica inverts both the unit and magnitude, but since Quantity
has HoldRest
, the unit does not evaluate further. This only seems to occur when taking a power of a dimensionless Quantity
where at least one of the units cancels:
Quantity[a, "Meters" "Seconds"/"Minutes"/"Meters"]^2
exhibits this behavior, but
Quantity[a, "Meters" "Seconds"/"Minutes"/"Inches"]^2
and
Quantity[a, "Meters" "Seconds"/"Minutes"]^2
do not.
I feel like Mathematica should be able to handle this situation correctly. Should I report this?
(This is not actually a problem for me. I discovered this by accident when evaluating "100 km / 1200 m/min" as natural language input: Mathematica interprets "m/min" as "Minutes"/"Minute"
).
(Mathematica 10.0.1.0, Windows 8.1 64-bit)
Quantity[a, "Meters" "Seconds"/"Minutes"/"Meters"]^2
==
Quantity[a^2/3600, "PureUnities"]
. AUnitSimplify
on the result of the second givesQuantity[(62500*a^2)/145161, "PureUnities"]
. The last ends up asQuantity[a^2/3600, "Meters"^2]
. I seems that it is fixed in 10.1 but that shouldn't stop you reporting for 10.0.1. $\endgroup$ – Edmund Apr 22 '15 at 1:52