I have the following function y=4*(1-cos(x)).^2+x.^3. Using newtonian iteration how can iterate the formula 100 times with initial guess of x=4?
I have the following code so far which gets me the first root, but im not sure how to progress from here.
maxIter=100';
x=4;
i=0;
f=4*(1-cos(x)).^2+x.^3
dfx=3*x.^2+8*sin(x)*(1-cos(x))
y=x-(f/dfx)
newx=y
x=newx
i=i+1
Thanks for any help
0 Comments
Sign in to comment.