solve() does not give all roots and sometimes crashes the symbolic toolbox
3 views (last 30 days)
Show older comments
I asked this question earlier ( see http://www.mathworks.nl/matlabcentral/answers/52958-solve-gives-incorrect-answer) and it seemed to be solved, but it keeps on returning. In hope of new answers I opened a new thread.
----------------------------
COMPUTER SPECIFICATIONS
----------------------------
- Windows 7 Enterprise SP 1
- 64-bit OS
- Intel Core i7-2670QM CPU 2.2 GHz
- 8,00 GB RAM
----------------------------
QUESTION
----------------------------
I have a function
>> clear all
>> syms x
>> G = (x - (23*x^2)/2 + 1/2)/(10*(x^5)^(1/2))
for which I want to find intersections with certain y-values. Let us first try to find the intersection with y = -1.
>> m = 0; s = 4; double(solve(G == (2*m-s)/s,'MaxDegree',4))
ans =
1.0000
0.4388
Which is correct. If I now try to find the intersection at y = -0.5, it gives me
>> m = 1; s = 4; double(solve(G == (2*m-s)/s,'MaxDegree',4))
ans =
5.0935
It leaves out one of the intersections, which should be around 0.3 after inspection of ezplot(G,[0 1]).
Now, if I try to find the intersection at y = 0.5, it gives me
>> m = 3; s = 4; solve(G == (2*m-s)/s,'MaxDegree',4)
Error using mupadmex
Internal error with symbolic engine. Please quit and
restart MATLAB.
Error in mupadengine/evalin (line 97)
[res,status] = mupadmex(statement);
Error in mupadengine/feval (line 150)
[S,err] = evalin(engine,stmt);
Error in solve (line 160)
sol = eng.feval('symobj::solvefull',eqns,vars);
It gets from bad to worse. Not using the ...,'MaxDegree',4) does not change anything. The answer to my previous question on this topic showed me that using that option should work, which it did for one instance, but as you can see, the problem has returned.
Thanks in advance, Jori
0 Comments
Answers (1)
Walter Roberson
on 7 Nov 2012
That system of equations requires a quintic rather than a quartic, and so has no analytic solution.
Near (3,4) there are three real solutions, .2290803577, .3029690575, 5.093506594
I have no idea why mupad encounters an internal error.
Have you considered expanding to find the general polynomial form of the solution, and using roots() ?
roots([1600*(m-(1/2)*s)^2, -529*s^2, +92*s^2, +42*s^2, -4*s^2, -s^2])
0 Comments
See Also
Categories
Find more on Special Values in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!