Please help me to solve this newton-raphson method

16 vues (au cours des 30 derniers jours)
Inggrid Audia
Inggrid Audia le 29 Sep 2016
How can I use Newton-Raphson method to determine a root of
f (x) = x5−16.05x4+88.75x3−192.0375x2+116.35x +31.6875
using an initial guess of x = 0.5825 and εs = 0.01%.
  2 commentaires
James Tursa
James Tursa le 29 Sep 2016
What have you done so far? Have you written any code yet?
Luis Varela
Luis Varela le 4 Oct 2016
On Newton Raphson method, you need calculate the function f(x) and the derivate f'(x), to get the next value of x, and continue while the error is greater than desired, for example:
x = 0.5825;
e=1;
while e>0.01
fx= x^5 - 16.05*x^4 + 88.75*x^3 - 192.0375*x^2 + 116.35*x + 31.6875;
dfx= 5*x^4 - 4*16.05*x^3 + 3*88.75*x^2 - 2*192.0375*x + 116.35;
x2=x-(fx/dfx);
e=100*abs((x2-x)/x2);
x=x2;
end
At the end x will have the value of the calculated root, aprox. x=6.5

Connectez-vous pour commenter.

Réponses (2)

Jakub Rysanek
Jakub Rysanek le 3 Oct 2016
In this case I would go with
roots([1,-16.05,88.75,192.0375,116.35,31.6875])

Luis Varela
Luis Varela le 4 Oct 2016
On Newton Raphson method, you need calculate the function f(x) and the derivate f'(x), to get the next value of x, and continue while the error is greater than desired, for example:
x = 0.5825;
e=1;
while e>0.01
fx= x^5 - 16.05*x^4 + 88.75*x^3 - 192.0375*x^2 + 116.35*x + 31.6875;
dfx= 5*x^4 - 4*16.05*x^3 + 3*88.75*x^2 - 2*192.0375*x + 116.35;
x2=x-(fx/dfx);
e=100*abs((x2-x)/x2);
x=x2;
end
At the end x will have the value of the calculated root, aprox. x=6.5

Community Treasure Hunt

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

Start Hunting!

Translated by