How can i get the same solution as mupad with symbolic math?

1 view (last 30 days)
I tried to solve simulataneous equations I suceed to get solution with mupad. However i failed to get the solution with symbloic math
i attached the source code. How can i get the correct result with symbloic math?
R1=[2.200 1.8250 1.5250];
R2=[1.1000 0.9750 0.800];
R3=[0.5 0.35 0.25];
pR1=[2.0 1.5 1.7];
pR2=[1.0 1.0 0.3];
pR3=[1.0 1.0 0.5];
x=sym('x','real');
y=sym('y','real');
[solx, soly, params, conditions] = solve((R1(1) + x*R1(2) + y*R1(3)) / (pR1(1) + x*pR1(2) + y*pR1(3)) == (R2(1) + x*R2(2) + y*R2(3)) / (pR2(1) + x*pR2(2) + y*pR2(3)) ,(R1(1) + x*R1(2) + y*R1(3)) / (pR1(1) + x*pR1(2) + y*pR1(3)) == (R3(1) + x*R3(2) + y*R3(3)) / (pR3(1) + x*pR3(2) + y*pR3(3)),[x,y],'ReturnConditions',true);

Accepted Answer

Mischa Kim
Mischa Kim on 19 Dec 2014
Hyunsuk, what is the correct result?
When I run your code I get
solx_n = vpa(solx)
solx_n =
-0.83057115678937513937111579526602
-0.69106286794056044132960951267269
-4.1017862817480576543720080358332
soly_n = vpa(soly)
soly_n =
-0.44526685001579194788840336984639
-0.22265558764897935824992374783178
3.516420891692129079484966442921

More Answers (1)

hyunsuk Lee
hyunsuk Lee on 19 Dec 2014
Thank you very much! I didn't know i have to use vpa. Again, thanks alot

Community Treasure Hunt

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

Start Hunting!