why can matlab NOT solve this simple equation (2015a version) ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
>> 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 Commenti
Risposte (2)
Star Strider
il 12 Ago 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 Commenti
Walter Roberson
il 13 Ago 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 Commenti
Vedere anche
Categorie
Scopri di più su Special Values in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!