how can i solve this equation i keep get error
조회 수: 2 (최근 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!