how can i solve this equation i keep get error
1 次查看(过去 30 天)
显示 更早的评论
clc,clear;
syms x
eqn=-15730900+(-1473100)+(501831/(1+x))+(501831/(1+x)^2)+(501831/(1+x)^3)+...
+(501831/(1+x)^4)+(501831/(1+x)^5)+(501831/(1+x)^6)+(501831/(1+x)^7)+...
+(501831/(1+x)^8)+(501831/(1+x)^9)+(501831/(1+x)^10)==0;
solx=solve(eqn,x)
this is my equation and i cant take the value for x im wonder why
2 个评论
Walter Roberson
2015-12-14
What error do you get?
Those continuation lines would have to be immediately after the previous lines; you show a blank line between the lines of the eqn and that is not permitted syntax.
If you are using an earlier version of the Symbolic Toolbox, before about R2011b (I think) you might need to remove the "==0"
回答(1 个)
John D'Errico
2015-12-14
As I pointed out, there will surely be no analytical solution. You should expect that with near certainty, as this is the equivalent of a high order polynomial.
I see no error however. Only the indication (from solve, in the form of the results it yields) that it was unable to compute analytical roots.
solve(eqn)
ans =
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 1) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 2) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 3) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 4) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 5) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 6) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 7) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 8) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 9) - 1
1/root(z^10 + z^9 + z^8 + z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z - 1564000/45621, z, 10) - 1
Again, that was completely expected. However, nothing stops you from getting approximate roots.
vpa(solve(eqn))
ans =
-1.6661435339699159760690274098319
-0.17803633410337122738678393539001
- 0.82944078945054912679553055169416 + 0.67487342116657470095168018942751i
- 1.2392357796067300876301190456248 - 0.63453525124017787853359333001222i
- 1.5503593102427657212185969586246 - 0.38032263725340143579333271938087i
- 1.5503593102427657212185969586246 + 0.38032263725340143579333271938087i
- 1.2392357796067300876301190456248 + 0.63453525124017787853359333001222i
- 0.82944078945054912679553055169416 - 0.67487342116657470095168018942751i
- 0.44428946799323473628513677400307 - 0.47475279125570655866734145566345i
- 0.44428946799323473628513677400307 + 0.47475279125570655866734145566345i
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!