I’m having some trouble with mathematics involving the Quantity object. The notebook I give below describes what is happening in a minimal example:
Am I misunderstanding something about the Quantity object or its application? To me, the outputs of (a) and (b) should be identical because the units are equivalent, and it seems like the language is aware of this (from the last line of the notebook). I’d appreciate any input on this, especially if I’m misunderstanding how Quantity should work in equations! I am using Mathematica 13.0.1.0 on Linux. Thanks in advance!
Thank you for the quick response. I encountered this issue in a notebook that does not use ReplaceAll, so there must be some other rule for the order of evaluation that I’m not aware of. I was able to work around this by replacing someQuantity[someValue, someUnits] with UnitConvert[someQuantity[someValue, someUnits], baseUnits]; everything seems to work as expected with this change.
the system has to interpret the string “volt” to find the canonical unit "Volts". If you just use "Volts" from the start then computations will be faster, even if only a small amount.
Thank you for trying to reproduce the issue, and for your comment about the unit names. I think your example illustrates this well and shows that the issue is more universal. I have included it, along with an equivalent line where a division by Quantity[1, "Kilometers"] is performed and the correct output is given, in a message to Wolfram Technical Support.