Please help me to solve this newton-raphson method
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
2016-10-3
In this case I would go with
roots([1,-16.05,88.75,192.0375,116.35,31.6875])
0 个评论
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
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!