The problem is that you cannot check the units of your result in
general, as you have to make sure that the values you enter do not
lead to a cancellation. This is non-trivial for more complicated
expressions. I agree, it is not a bug in terms of coding but the
concept is not suitable for this purpose. Could you add your thoughts
to the sage-devel thread I started? It would be nice to add this
functionality to sage in one way or another.

Cheers
Stan

On Aug 2, 5:17 pm, Maarten Derickx <[email protected]>
wrote:
> I thought a bit longer about it, and I actually think it's not really a big
> bug. It think the way the units system is meant to be used is like this:
>
> sage: var("H_l, h_c,T_a,T_l")
> (H_l, h_c, T_a, T_l)
> sage:
> sol=solve([H_l*units.energy.calorie/units.length.centimeter^2/units.time.minute
> == h_c*((T_a - T_l)*units.temperature.kelvin)],h_c)
> sage: sol
> [h_c == H_l*calorie/(T_a*centimeter^2*kelvin*minute -
> T_l*centimeter^2*kelvin*minute)]
>
> The interpretation of this should be that 2*units.length.meter should be
> read as 2 * (1 meter) etc. This interpretation works very well if you have
> to convert explicit values. Note that you indeed cannot divide by 1 kelvin -
> 1 kelvin = 0 kelvin. The framework will give sensible answers if you fill in
> distinct values for T_a and T_l.
>
> sage: sol[0](T_l=1,T_a=2,H_l=3)
> h_c == 3*calorie/(centimeter^2*kelvin*minute)

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to