Re: [sage-support] Units Package Simplification in Exponentiation/Powers

2011-03-22 Thread D. S. McNeil
 sage: (a^3)^(1/3)
 5*(meter^3)^(1/3)

 does not produce the expected units of meter.  Is there a means to
 force further simplification?

You could try

sage: m = units.length.meter
sage: assume(m  0)
sage: (5*m)^3
125*meter^3
sage: ((5*m)^3)^(1/3)
5*(meter^3)^(1/3)
sage: simplify(((5*m)^3)^(1/3))
5*meter



Doug, who likes his Yankee friends but insists that 'meter' is a
device which measures ;-)

--
Department of Earth Sciences
University of Hong Kong

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


[sage-support] Units Package Simplification in Exponentiation/Powers

2011-03-21 Thread Mark
I'm trying to use the Sage units package and cannot get expected
simplifications with things more complicated than +, -, /, *.  For
example:


sage: a=5*units.length.meter
sage: sqrt(a^2)
5*sqrt(meter^2)

even though I would expect units of simply meter.  If I try to
convert the result to units.length.meter, I receive ValueError:
Incompatible Units.  Similarly

sage: (a^3)^(1/3)
5*(meter^3)^(1/3)

does not produce the expected units of meter.  Is there a means to
force further simplification?

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