William Stein wrote:

> The justification for ConvertAll would be exactly the justification for us to
> *not* use it in Sage, i.e., for Sage unit conversion we would surely want
> something that works well in the context of sage itself, e.g., the coercion
> model, symbolic calculus, etc.

FWIW I've been working on a units package for Maxima (ezunits)
which exploits its symbolic functions to make working with units
convenient, extensive, and flexible. I claim to have gotten some
useful & interesting code at this point.

A dimensional quantity like 10 meters is represented as 10 ` m,
i.e. a Maxima expression with the operator ` and arguments 10 and m.
As usual (for the most part) Maxima carries along such expressions
when they appear in algebraic operations, which leaves the door open
for us to define results appropriate for dimensional quantities.
E.g. product of dimensional quantities => product of nondimensional
parts times product of units. Unit conversions are indicated by
the `` operator, e.g. 10 ` m `` ft => 12500/381 ` ft. Units are
converted by constructing and solving a system of linear equations
(after taking logarithms).

So far the package as it stands in CVS doesn't have anything beyond
algebra, but I was just trying some calculus operations and it looks
like integrals and derivatives should work OK. E.g. stuff like
diff(x(t) ` m, t ` s) => dx(t)/dt ` m/s,
integrate(v(t) ` m/s, t`s, a`s, b`s) => integrate(v(t), t, a, b) ` m.
I haven't worked out the details yet.

Ezunits also has some functions for dimensional analysis which were
adapted from an existing Maxima package, and also a collection of
physical constants (CODATA 2006) from NIST.

Ezunits exists in previous versions of Maxima but there will be a
substantial revision in the 5.16 release which will appear next month.

Anyway maybe this is some use or interest. Comments on the CVS
version are much appreciated.

Robert Dodier

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to