For many tasks ezUnits works just like magic:
(%i7) load("ezunits")$
sqrt((1`Ohm)*(1`Ohm));
(%o7) 1 ` Ohm
If the square ohms inside the root are expressed differently there seems to be no obvious
way to make ezUnits cope with that, though:
(%i4) sqrt((1`Ohm)*(1`Ohm+(1`V)/(1`A)));
(%o4) sqrt((1 ` Ohm)*(1 ` V/A+1 ` Ohm))
(%i5) %``Ohm;
(%o5) sqrt((1 ` Ohm)*(1 ` V/A+1 ` Ohm)) `` Ohm
Originally reported as ezUnits and unit conversions in function arguments to the maxima-discuss mailing list.
Ticket moved from /p/maxima/bugs/3942/
I've created an initial attempt to implement a function,
add_compatible_units
, to handle the situation described here. See the foldermore_ezunits
in: https://github.com/maxima-project-on-github/maxima-packages/tree/master/robert-dodierAs it stands,
add_compatible_units
could benefit from a stronger way to infer to what common unit terms should be converted, or else (or in addition) a way to hint the common unit. In the absence of that stuff, I think I'm more comfortable withadd_compatible_units
being in the external projectmaxima-packages
.