Finding roots of a polynomial

1 回表示 (過去 30 日間)
LukeO
LukeO 2016 年 11 月 10 日
編集済み: James Tursa 2016 年 11 月 10 日
I've carried out manual calculations of newton raphson and have proven it in MATLAB with the following code in the command window:
>> f= 0.5*x.^3 + x.^2 - 10*x+14.037;
>> roots ([0.5 1 -10 14.037])
ans =
-6.0627 + 0.0000i
2.0313 + 0.7101i
2.0313 - 0.7101i
I know the -6.0627 is correct as this is the same as my manual calculation, but I don't understand the following 2 answers MATLAB has provided. Could someone explain this in reasonably simple terms what they mean?
Thanks.

採用された回答

James Tursa
James Tursa 2016 年 11 月 10 日
編集済み: James Tursa 2016 年 11 月 10 日
An n'th order polynomial will have n roots, some of which may be repeated or complex. You have a 3rd order polynomial which will have 3 roots. Turns out one of the roots is real and the other two are complex (meaning a plot of the polynomial will only cross the x-axis once). If you plug the roots into the polynomial you can see that all three results are very close to zero as expected:
>> f = @(x) 0.5*x.^3 + x.^2 - 10*x + 14.037
f =
@(x)0.5*x.^3+x.^2-10*x+14.037
>> r = roots ([0.5 1 -10 14.037])
r =
-6.062670505918885
2.031335252959442 + 0.710147689980882i
2.031335252959442 - 0.710147689980882i
>> f(r)
ans =
1.0e-013 *
0.230926389122033
0.035527136788005 - 0.062172489379009i
0.035527136788005 + 0.062172489379009i
Look at it this way, if you take your real root and form (x+6.062670505918885) and factor that out of your polynomial, you will be left with a 2nd order polynomial that has no real roots.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by