using units in Maxima?



On 2/1/06, Ronald Crummett <rcrummett at uidaho.edu> wrote:

> I have a project in a communication circuits class, in which our
> instructor wants us to use a program (he suggested Mathcad and Matlab
> but I want to try to do it in Maxima) to calculate several values for
> a transistor.  In his example, done in Mathcad, he includes units with
> his value assignments and calculations.  It it possible to do such a
> thing in Maxima?  If so, how?  Thanks.

There are several units packages for Maxima.
You can see my attempt here:
http://cvs.sf.net/viewcvs.py/maxima/maxima/share/contrib/ezunits/

Quantities with units are indicated with a backtick ` :

  [ x : 100 ` N, y : foo ` m, z : 3 ` m^2 ];

The units aren't declared; it is understood that the stuff on
the right of backtick is the unit, and on the left is the quantity.

Units are carried through arithmetic operations:

  x * y;  => 100*foo ` m*N

  x / z;  => 100/3 ` N/m^2

  y^3;  => foo^3 ` m^3

There's more -- see the test script rtestezunits.mac for examples.

This package doesn't know what to do with functions
such as integrate or diff. At some point I'll figure out what
to do with those.

Maybe you can let me know what kinds of operations
are needed for your assignment.

hth
Robert Dodier