On Sun, Jul 20, 2008 at 8:36 PM, Robert Dodier <[EMAIL PROTECTED]> wrote: > > 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. >
Since you've clearly been thinking of this from a developer's perspective, and maybe even spending a lot of time writing code, is there any chance you could just dump some of your design thoughts in an email here? As a frame of reference, the last time *I* personally thought a lot about units was when I was taking a physics course in 1992, so you can imagine that I'm actually pretty clueless about what people really want. Some questions: (1) Are the list of all units one uses pretty standard? Is there a table, say in Wikipedia, with pretty much all of them? Or do people make up new units in the course of their work or research? Obviously I know about converting between fahrenheit and celcius or between Euros and Dollars -- both are "units" computations for me, where of course the Euro/Dollar FX rate varies every second, which is kind of amusing. (2) Are there *any* difficult algorithms that involve units or is this mostly a notational and representation problem plus some algebra and simplification? (3) Does Maxima, Maple, Mathematica, Matlab or Axiom do anything particularly cool, surprising or clever involving units? -- William --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---