Ask Your Question
1

How to get more uniform output from full_simplify

asked 2011-06-18 18:24:03 +0100

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.

edit retag flag offensive close merge delete

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 ( 2011-06-19 09:27:17 +0100 )edit

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

omoplata gravatar imageomoplata ( 2011-06-20 03:07:44 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-07-04 21:17:55 +0100

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.

edit flag offensive delete link more

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: 2011-06-18 18:24:03 +0100

Seen: 673 times

Last updated: Jul 04 '11