why can matlab NOT solve this simple equation (2015a version) ?
2 views (last 30 days)
Show older comments
>> syms x;
>> solve(2*x-1==0)
ans =
1/2
>> solve(5000*(1/x - 1/(x*(1+x)^15)) - 35000 == 0)
>> solve(5000*(1/x - 1/(x*(1+x)^15)) - 35000 == 0, 'real', true)
There is a solution: 0.114913
what is wrong here?
0 Comments
Answers (2)
Star Strider
on 12 Aug 2015
Nothing is wrong. Your equation has 15 solutions, only one of which is real.
Use vpasolve, and to get the one real solution, select it as having no imaginary component:
x1 = vpasolve(5000*(1/x - 1/(x*(1+x)^15)) - 35000 == 0);
real_x1 = x1(imag(x1)==0)
real_x1 =
0.11491336334766181651570218695387
0 Comments
Walter Roberson
on 13 Aug 2015
Notice the warning messages about parameterized solutions and ReturnConditions. Then it warns you that the answer that follows is subject to a particular condition.
The way to interpret what you received is that solve() is replying that "all x that meet a particular condition are solutions, and if you were to request that the conditions be output you could capture the condition for further manipulation"
If you wanted the numeric value you could vpa() or double() the result. There is no nice closed-form solution for the result. 15 degree polynomials seldom have nice closed-form solutions.
0 Comments
See Also
Categories
Find more on Special Values in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!