Please help me to solve this newton-raphson method

조회 수: 16 (최근 30일)
Inggrid Audia
Inggrid Audia 2016년 9월 29일
답변: Luis Varela 2016년 10월 4일
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
James Tursa
James Tursa 2016년 9월 29일
What have you done so far? Have you written any code yet?
Luis Varela
Luis Varela 2016년 10월 4일
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

댓글을 달려면 로그인하십시오.

답변 (2개)

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

Luis Varela
Luis Varela 2016년 10월 4일
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

카테고리

Help CenterFile Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by