Why does vpasolve work where solve doesn't for the following:
Ältere Kommentare anzeigen
When I pass the following equations into solve like so
eqn1 = (120*Lt*pi*Rt)/(14400*Lt^2*pi^2 + Rt^2)^(1/2) - 338920901889975/17592186044416
eqn2 = (42000*Lt*pi*Rt)/(1764000000*Lt^2*pi^2 + Rt^2)^(1/2) - 8473022547249375/17592186044416
S = solve([eqn1,eqn2],[Rt, Lt])
I get the following error:
Warning: 4 equations in 2 variables.
> In C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\symbolic\symbolic\symengine.p>symengine at 56
In mupadengine.mupadengine>mupadengine.evalin at 97
In mupadengine.mupadengine>mupadengine.feval at 150
In solve at 170
In Main at 152
Warning: Explicit solution could not be found.
> In solve at 179
In Main at 152
However, if I plug these same two equations into vpasolve like so
S = vpasolve([eqn1, eqn2], [Rt, Lt], [1e3, 1e-6]);
I get
double(S.Rt) = 482.866983 and
double(S.Lt) = 0.051144.
What am I doing wrong inside the solve function??? Thanks for any help.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 21 Okt. 2013
There are two solutions:
Lt = (135/7881299347898368)*sqrt(87986205389370659588312581)/pi,
Rt = (405/17592186044416)*sqrt(439931026946853297941562905)
and the negatives of those.
I suggest switching to symbolic numbers when you construct the equation:
eqn1 = sqrt(sym(120)*Lt*sym('pi')*Rt)/(sym(14400)*Lt^2*sym('pi')^2 + Rt^2) - sym('338920901889975')/sym('17592186044416')
eqn2 = sqrt(sym(42000)*Lt*sym('pi')*Rt)/(sym('1764000000')*Lt^2*sym('pi')^2 + Rt^2) - sym('8473022547249375')/sym('17592186044416')
I used sym(120) and other small numbers, but sym('17592186044416') and other large numbers, to avoid the possibility of losing precision in converting the double precision representation of the larger numbers to symbolic form.
2 Kommentare
David
am 21 Okt. 2013
Kategorien
Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!