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. – swish Nov 29 '20 at 15:59Quantity[0|0., ___] :> 0– Bob Hanlon Nov 29 '20 at 16:12Integrate[v t, Quantity[t, "Seconds"]]. So maybe define your time ast = Quantity[\[FormalT], "Seconds"]– swish Nov 29 '20 at 16:17Integrate["0 m/s^2", t] = "0 m/s^2"and"0 m/s^2" Integrate[1, t] = t("0 m/s^2")is problematic. Since I think this only happens when integrating a constant of 0, you can pull it out of the integral:a Integrate[1, t, t], or use explicit integration limits as workarounds. – MassDefect Nov 29 '20 at 20:16\[Integral]\[Integral]Quantity[0.,"Meters"/"Seconds"^2]\[DifferentialD]t\[DifferentialD]tversus\[Integral]\[Integral]HoldForm[Quantity[0.,"Meters"/"Seconds"^2]]\[DifferentialD]t\[DifferentialD]t. In the first integral, thet^2term disappears. This missing term causes the Quantity mismatches. – creidhne Nov 29 '20 at 22:06HoldFormwithr0,v0anda, andReleaseHoldafter the integral solves the problem. – creidhne Nov 29 '20 at 22:17Quantity[]as much as possible but this seems ok, no?: https://i.stack.imgur.com/0e7B4.png – Michael E2 Nov 30 '20 at 18:15Convertcommand. I only use the newer versions if I am copying someone else's examples. You can browse the infocenter for all kinds of stuff that still works, although a lot doesn't. – Bill Watts Dec 05 '20 at 00:03