Rootfinder_74 - xold = xnew end xnew F(xnew F end e function new1 = F(x f new1 =-1.5*x^6 2*x^4 12*x end e function new2 = dF(x f new2 =-9*x^5 8*x^3

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function rootfinder_74 f x = (-2:0.1:2)'; for r = (1:41) y(r,1) = -1.5*x(r,1)^6 - 2*x(r,1)^4 + 12*x(r,1); end e plot(x,y) p xold = 1.2; Ea = 100; while Ea > 0.00000001 fx = dF(xold); dfx = d2F(xold); xnew = xold - fx/dfx; Ea = abs((xnew-xold)/xnew)*100;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: xold = xnew; end xnew F(xnew) F end e function new1 = F(x) f new1 = -1.5*x^6 - 2*x^4 + 12*x; end e function new2 = dF(x) f new2 = -9*x^5 - 8*x^3 + 12; end e function new3 = d2F(x) f new3 = -45*x^4 - 24*x^2; end...
View Full Document

This note was uploaded on 09/21/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Ask a homework question - tutors are online