why can matlab NOT solve this simple equation (2015a version) ?
1 回表示 (過去 30 日間)
古いコメントを表示
>> 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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147995/image.jpeg)
There is a solution: 0.114913
what is wrong here?
0 件のコメント
回答 (2 件)
Star Strider
2015 年 8 月 12 日
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 件のコメント
Walter Roberson
2015 年 8 月 13 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!