MATLAB Answers

result of simplify function

2 views (last 30 days)
Huang Meng
Huang Meng on 24 Mar 2011
Hi:
I am trying to use simplify() function.
If I define t1= sym('x+1/y+1/(x*y)=3'); t2=simplify(t1); then is it equivalent to t2=simplify('x+1/y+1/(x*y)-3')?
Thanks

Answers (1)

Walter Roberson
Walter Roberson on 24 Mar 2011
No. The first one creates a symbolic equation that is then simplified. The second one creates a symbolic expression that is then simplified.
The first one would come out like, (x^2*y+x+1)/(x*y) = 3 The second one would come out like, (x^2*y+x+1-3*x*y)/(x*y)
If you are looking for solve() instead of simplify(), then it is over here
  3 Comments
Walter Roberson
Walter Roberson on 24 Mar 2011
[Trying that again!]
Sorry, I'm working on theory here; theory and knowledge of a pretty similar computer program. I do not have the Symbolic Toolbox myself.
In the other program, the simply()'d version is equivalent to the following:
-(1/549755813888/10^56)*(-12884901888*C0^2*L0 - 2794227756815616035186997904500000000000000000000000*C0^5*L0^2 - 2147483648*L0^3 + 249156101152561171875*C0^3*L0 - 51870368705054935049759770874700000000000000000000000000000000*C0^5*L0^3 + 17939882979527499842397106252000244*10^37*C0^6*L0^3 - 6867007664798629656218750000000*C0^2*L0^3 + 1572261156935652588441050351000000000000000000000000*C0^4*L0^3 + 118140407280496373375428750000000000000000*C0^3*L0^3 + 83052033717520390625*C0*L0^3 + 2147483648*C0^3+1279185939839683623343750000000*C0^4*L0 - 332208134870081562500*C0^2*L0^2 + 157527740484329598232661250000000000000000*C0^4*L0^2 - 1967664285161703581260147853808461750080000000000000000000000000000000000000000000*C0^6*L0^4 + 610983299939981723372973776750000000000000000000000*C0^3*L0^4 - 836338272320550456725829424169330388*10^36*C0^5*L0^4 + 41496555030766781312265422860700000000000000000000000000000000*C0^4*L0^4 + 2036548401159578319890625000000*C0*L0^4 - 78761711009064468996703750000000000000000*C0^2*L0^4 + 2272087383959684089640625000000*C0^3*L0^2 + 3505793907072771854940998215835239392989248*10^49*C0^7*L0^4 + 10737418240*C0*L0^2) / (C0^7*L0^4) = 1055078633212981/17179869184
with the difference that everywhere 10^ appears in the above, the other program had all of the zeros in-place. I had to convert to 10^N notation in order to fit some of the numbers in the width of the comment box, as Matlab Answers does not have a scroll-bar for comments.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!