Processing math: 0%

First time here? Check out the FAQ!

Ask Your Question
1

How to get more uniform output from full_simplify

asked 13 years ago

omoplata gravatar image

I do this,

sage: var('x1,t1,x2,t2,u,c',domain=RR);assume(u>0);assume(c>0);assume(c>u);
(x1, t1, x2, t2, u, c)
sage: T1 = (t1-((u*x1)/(c^2)))/sqrt(1-((u^2)/(c^2)))
sage: T2 = (t2-((u*x2)/(c^2)))/sqrt(1-((u^2)/(c^2)))
sage: dT = T2-T1
sage: view(dT.full_simplify())

And I get,

\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{\sqrt{c - u} \sqrt{c + u} {\left(c^{2} t_{1} - c^{2} t_{2} - u x_{1} + u x_{2}\right)}}{c^{3} - c u^{2}}

I put this expression in which is supposed to be the same,

sage: s = ((t2-t1)-((u/(c^2))*(x2-x1)))/sqrt(1-((u^2)/(c^2)))
sage: view(s.full_simplify())

And get this,

\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{c^{2} t_{1} - c^{2} t_{2} - u x_{1} + u x_{2}}{\sqrt{c - u} \sqrt{c + u} c}

It is not immediately apparent to me that dT and s are the same. But they are both equal as can be seen by,

sage: (s-dT).full_simplify()
0

This is something minor, but is there something I can do to get a simplified expression which is more uniform every time I use full_simplify()?

Thanks.

Preview: (hide)

Comments

I don't know it this provides any comfort, but in maple and mathematica as well "simplify" does not give the same output for equivalent inputs, and simplify(A-B) is usually needed to see whether two expressions are equivalent. It might be argued that choosing a canonic representative to every class of equivalent symbolic expressions is far from being a trivial problem...

parzan gravatar imageparzan ( 13 years ago )

Thanks for the comment. Yeah, practically it's not that important. But I was just wondering if it was impossible.

omoplata gravatar imageomoplata ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 13 years ago

Jason Grout gravatar image

As mentioned in the comment, it's probably not practical to try to always give consistent output from simplify, at least automatically.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 700 times

Last updated: Jul 04 '11