Maple Units package



On Friday 25 March 2005 04:55 pm, Eike Welk wrote:
> I have been playing with Maple's units package a little.
>
> I want to use the units package to write differential equations
> where the variables are in convenient units and leave the tedious
> unit conversions to Maple. I haven't really done this yet because
> my current simulation program is already written entirely in SI
> base units. ( m^3 even if I simulate in the range of liters)
>
>
> My impression of Maxima's units package:
> ----------------------------------------------
> Good:
> - Units have an own namespace without too much typing.
> This refers to the "standard" units environment. I find the
> "natural" environment where units appear in the global namespace
> impractical.
>
> >3*Unit(cm/h);
>
>                   1/120000*Unit([m/s])

Hmm.  Can you tell me when this would be better than something like 
3*cm/h?  I assume there is some utility but this would most likely 
not be trivial (is it even possible to have different namespaces in 
Maxima using such a mechanism?) and I would need to understand the 
desirability of it in order to do it right.  That might have to be 
one of those "down the road" things.

> - Easy creation of more specialized units. (Alternative
> description: supports the usual notation of chemists.)
>
> >m_mol_O2 = 2*16 * Unit(g(O2)/mol(O2));
>
>              m_mol_O2 = 4/125*Unit([kg(O2)/mol(O2)])

Hmm.  I take it you are refering to the inclusion of O2 to keep 
track of specific elements?  That might require some thought.

> - Systems of base units can be created and manipulated. You can
> tell the system to always convert volumes to liters. (I think)

That, at least, should be readily doable in Maxima.

> - (Partial) integration into the rest of Maple. Many functions,
> most notably int() and diff(), know of units.

Can you give an example of what it means for them to "know" about 
units?  How are they treated differently?

> -----------------------------------------------------------------
>---- Bad:
> - Only partial integration into the rest of Maple. The plot()
> function for example does unfortunately not know of units.

What features were you hoping for/expecting?  I must confess I'm not 
sure what about units would be special in a plot.

> - Instead much energy was spent on many exotic units eg.: US dry
> barrels (there are hundreds of them). This is surely an
> anglo-saxon speciality.

My take on those is if someone needs them, they can add them.  I'm 
not opposed to including them, but it is not high on my priority 
list.

> - The program gets easylie confused with expressions where only
> some terms contain units eg.:
>      e_2 := s = 1/2*a*t^2+1/12*Unit([m/s])*t+20*Unit([cm])
> It is impossible to simplify such an expression. It would be nice
> if there were a way to tell the program that "t" is a time, "a"
> is an acceleration, and "s" is a distance. (And a sensible way to
> display this.)

I think that can be partially addressed in Maxima.  By simplify, do 
you mean combine like terms or group by quantity?  Or alternately, 
what would you like to simplify the above expression to?

> - You can however substitute the symbols by a purely numeric
> symbol
>
> multiplied by the correct units. e.g.:
> >e_3:=subs([t=t_min*Unit(min), s=s_cm*Unit(cm),
> >a=a_cmmin*Unit(cm/min^2)], e_2);
>
>   e_3 := s_cm*Unit([cm]) =
>     1/720000*a_cmmin*Unit([m/s^2]) * t_min^2*Unit([min])^2
>     + 1/12*Unit([m/s])*t_min*Unit([min])
>     + 20*Unit([cm])
> I find this rather unelegant but it works. After a simplification
> all desired conversion factors are there, but the units are gone.
>
> >e_4:=simplify( solve(e_3,s_cm));
>
>      e_4 := 1/2*a_cmMin2*t_min^2+500*t_min+20

I'll have to think about this one a bit.

> I hope this is at least kind of helpfull for you. I find the work
> on Maxima very valuable since Maple and Mathematica are insanely
> expensive. If the RWTH would not have a site license for Maple
> I'd use Maxima too.

Yes, very helpful.  The only way Maxima will gain users is to be 
useful to people, so real world feedback is always a good idea.

Thanks much,
CY


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/