Hello all,
is there a way to simplify
(x**2)**(3*numbers.One()/2)
to
x**3
?
It is not that important for me but the expressions would look cleaner.
Thanks,
Bastian.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send em
Hello Bastian,
this simplification is valid only for positive x in general (try x = -1).
In [1]: x = Symbol("x", positive=True)
In [2]: (x**2)**(3*numbers.One()/2)
Out[2]:
3
x
for real x, it simplifies to absolute value
In [3]: x = Symbol("x", real=True)
In [4]: (x**2)**(3*numbers.One()/2)
Ou
Hello Stepan,
thanks for the quick and good answer.
Greetings,
Bastian.
Stepan Roucka wrote:
> Hello Bastian,
> this simplification is valid only for positive x in general (try x = -1).
>
> In [1]: x = Symbol("x", positive=True)
>
> In [2]: (x**2)**(3*numbers.One()/2)
> Out[2]:
> 3
> x
>
> f
Bastian,
Please start new threads, rather than hitting "Reply" in your mail
client and just changing the subject line. The message ids and
history information are still in the reply which messes up threading
for folks who read online, or for surfers after the fact. Reference
this very thread as
Mathematically speaking, another way to think about it is this:
sqrt(x**2) != x (same reasoning, try x < 0)
A little more generically:
sqrt(x**2) == norm(x) ("2 norm of x")
You may (not) be interested in this wikipedia article:
http://en.wikipedia.org/wiki/Norm_(mathematics)
--
You received
Kevin Hunter wrote:
> Bastian,
>
> Please start new threads, rather than hitting "Reply" in your mail
> client and just changing the subject line. The message ids and
> history information are still in the reply which messes up threading
> for folks who read online, or for surfers after the fact.
Hello,
I have just started to use sympy.
I am trying to use euler rotation matrix
R(a, b, g) to transform a tensor (say, T_p
3x3 matrix) from its principal frame of
reference to lab frame of reference.
http://en.wikipedia.org/wiki/Euler_angles
basically doing,
T_lf = R(a,b,g) * T_p * R(a,b