When I enter this in Wolfram Mathematica V12:
0 Dogs + 5 Cats
Mathematica sensibly returns this:
5 Cats
BUT, if I using the Units and Quantity features in Mathematica V12, and enter this:
0 m + 37 m/s
Or in long form:
Quantity[0, "Meters"] + Quantity[37, "Meters"/"Seconds"]
I get:
Quantity::compat: Meters/Seconds and Meters are incompatible units
I know the units are not compatible, but ZERO "Meters" is just 0 and should logically disappear from the equation just as "0 Dogs" disappears from the first example.
This bug breaks most symbol differentiation and integration.
I guess Wolfram really screwed up by not making Units part of V1 back in the 1980's, and instead added it as a glued on bag, in V12. Talk about "creeping featurism" ;-)
BTW, the only means I have found of controlling this horrible Mathematica functionality is with pages of ugly substitution rules like this:
removeUnitsOfZeroMagnitude[myExpression_] := Module[{},
myExpression /. Quantity[0, "Meters"] -> 0 /.
Quantity[0, "Meters"/"Seconds"] -> 0 /.
Quantity[0, "Meters"/"Seconds"^2] -> 0 /.
Quantity[0, "Meters"/"Seconds"^3] -> 0
]
Of course, this ugly hack makes simple one line calculations, that were so beautiful and elegant in V4, now many lines of nasty, unreadable code.
Am I doing something wrong?
Is Mathematica V4 still for sale?
Thanks,
- Joe
Example
Here is a more detailed image of the errors I am receiving in Mathematica V12 when trying to evaluate a simple integral. It seems to me in an evaluation like Times or Plus, or whatever, expressions of Units with ZERO magnitude should be removed, as one would do with simple pen and paper.
1m
+ (-1m
+37m/s
)? Zero quantity should still be a part of space it belongs to and not just disappear, this breaks a lot of math stuff. If this expression comes from some computation then most certainly this computation is wrong. $\endgroup$