On Wed, Aug 12, 2009 at 12:02 AM, Jason
Grout<jason-s...@creativetrax.com> wrote:
>
> William Stein wrote:
>> On Tue, Aug 11, 2009 at 11:30 PM, Jason
>> Grout<jason-s...@creativetrax.com> wrote:
>>> William Stein wrote:
>>>> Hi,
>>>>
>>>> I just wanted to let people know that David Ackerman -- a UW student who
>>>> took my course on Sage last quarter -- is working (funded by NSF) on
>>>> creating a "units package" for Sage right _now_.  If anybody has any
>>>> pseudo-sage code that involves units that they wished work, please post
>>>> it to this thread. What do you want units to *do*?
>>>>
>>> Is he doing something from scratch or is he working from the packages
>>> that have come up from time to time here?
>>
>> He is doing something from scratch.
>>
>> I had planned to have him work on integrating some existing package,
>> but after evaluating that approach he said it didn't seem to make
>> sense (at least he has a lot of experience using Sage, since he took
>> my class).   I didn't have an opinion one way or the other, but we
>> decided to ask -- "what is a so called units package supposed to do
>> anyways" since I honestly couldn't really tell you.  I would use one
>> to convert between Fahrenheit and Celcius, and maybe dollars and euros
>> :-).   We google around and found that Matlab didn't seem to come with
>> a units package, but there were several third party packages -- anyway
>> Sage isn't much like Matlab so looking there seemed pointless.  Then
>> we looked at Mathematica's included units package and read all the
>> documentation and examples of it.    That was enlightening, and
>> suggested doing almost precisely what Robert Dodier keeps telling us
>> to do, which is make the different units just be symbolic variables,
>> plus have some extra table somewhere of conversions (where everything
>> is kept as exact fractions), and add a few functions to do
>> conversions.  If you read the Mathematica docs you'll see that *all*
>> their units package is is:
>
>
> For some reason, I had the idea that Maple's units package was better:
>
> http://www.maplesoft.com/support/help/view.aspx?path=Units
>
> I don't have anything to back that up, other than vague intuition from
> playing with both systems a long time ago.

Thanks for posting that link.

I just read through that page and having recently read the Mathematica
page, I think Mathematica's units design seems better to me
personally.  Maple has about 10 times as many unit commands, but my
impression is that might mean worse, since it seems (to my untrained
eye) to be maybe an awkward design that requires that many commands.
I also find all of the Mathematica examples to be way more natural
than the corresponding Maple ones, personally.  For example, the first
Maple example is:

convert(4.532, 'units', 'N'/'m'^2, 'lb''ft'/('s'^2'ft'^2))

Yuck!

In Mathematica it would be basically:

Convert[4.532*Newton/Meter^2, Pound * Feet/(Second^2 * Feet^2)]

and in Sage it will be

sage: from units import newton, meter, pound, feet, second
sage: a = 4.532*newton/meter^2
sage: a.convert(pound*feet/(second^2*feet^2))

Maple is horrendous in this instance, in my humble opinion.

> I would also hope that there is a way to define my own units in terms of
> standard units, or even my own system.  For example, 100 pages is a
> book, 10 books is a shelf, 14 shelves is a bookcase, etc.

Yes, of course.

>

William

>
> It might be interesting to read the Maple docs too.
>
> Thanks,
>
> Jason
>
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

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

Reply via email to