Menu

#162 ezUnits Missing unit conversion in function arguments

None
open
nobody
None
5
2022-02-18
2022-02-18
No

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.

Discussion

  • Robert Dodier

    Robert Dodier - 2022-02-18

    Ticket moved from /p/maxima/bugs/3942/

     
  • Robert Dodier

    Robert Dodier - 2022-02-18

    I've created an initial attempt to implement a function, add_compatible_units, to handle the situation described here. See the folder more_ezunits in: https://github.com/maxima-project-on-github/maxima-packages/tree/master/robert-dodier

    As 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 with add_compatible_units being in the external project maxima-packages.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.