In fact my idea is a bit different, and I'll explain in a minute:
provided that the system is SI, you should get the result as a
multiplier (bigger than one) of the closest classic unit
representation
ex: meters -> nm - um - mm - m - km - ecc ecc
ex:

x1 = 10cm
x2 = 1m
x1 + x2 = 1.1m

y1 = 1V (Volt)
y2 = 0.5 V
y1 - y2 = 500 mV

z1 = 500 mA [milliAmperes]
k = 3
z1 * k = 1.5 A

Does this looks reasonable? I find this very comfortable!

Regarding imperial system, the same could be done, even though this is
just a bit tougher because of the fractional multipliers, but the
principle can stay the same.

Two optional features could be very important, in my opinion:
1) locking one object unit representation to a certain order of
magnitude and/or metric system

ex:
x1 = 1 cm
x1.lock('cm')
x2 = x1 + 1 m [x2 can inherit the lock property]
x2 = 101 cm
x2.lock('inches')
x2 = 39.76 inches
x2.unlock()
x2 = 1.01 m

PS: locking property could also be specified when instantiating an
object

2) changing the standard metric system (imperial / SI / any other) so
that by default each value is scaled as previously proposed

Any comment?

Thanks

Maurizio

On 16 Mar, 16:06, Robert Dodier <robert.dod...@gmail.com> wrote:
> Maurizio wrote:
> > Regarding the output of such expression you wrote, I agree that it
> > should give a standard unit output for each physical quantity, so by
> > presetting SI (or imperial, or anything else), it should give just
> > meters (or feets, or anything else)...
>
> I'm pretty sure that would cause more trouble than it's worth.
> Whatever the standard, there could well be nonstandard combinations
> such as centimeters per day or liters per kilometer, which should
> be preserved as such. In the US, which is an important enough
> audience to be accomodated in the design of a units package,
> mixed-up units from different standards or no standards at all are
> very common, and should be preserved as such.
> And whatever the system or lack of it, it would be annoying to
> change fractional or multiple units (inches, kilometers, etc) to
> their base units (feet, meters, etc).
>
> The point is to accomodate the user, who has a better idea about
> what they want to accomplish than the package writer.
>
> FWIW
>
> Robert Dodier
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send 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