Filter löschen
Filter löschen

Please help me to solve this newton-raphson method

8 Ansichten (letzte 30 Tage)
Inggrid Audia
Inggrid Audia am 29 Sep. 2016
Beantwortet: Luis Varela am 4 Okt. 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 Kommentare
James Tursa
James Tursa am 29 Sep. 2016
What have you done so far? Have you written any code yet?
Luis Varela
Luis Varela am 4 Okt. 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

Melden Sie sich an, um zu kommentieren.

Antworten (2)

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

Luis Varela
Luis Varela am 4 Okt. 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