newtonraphson_64 - fx dfx Ea fprintf ('i xi f(x) f(x)...

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

View Full Document Right Arrow Icon
function newtonraphson_64 f xi = zeros(4,1); x fx = zeros(4,1); f dfx = zeros(4,1); d Ea = zeros(4,1); E xi(1,1) = 0.3; x Ea(1,1) = 0; E for i = (1:4) fx(i,1) = F(xi(i,1)); dfx(i,1) = DF(xi(i,1)); xi(i+1,1) = xi(i,1) - fx(i,1)/dfx(i,1); if i == 1 else Ea(i,1) = abs((xi(i,1)-xi(i-1,1))/xi(i,1))*100; end end i = (0:3)'; xi
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fx dfx Ea fprintf ('i xi f(x) f(x) Ea\n') for r = (1:4) fprintf('%3d %8.6f %8.5f %8.6f %7.3f\n', i(r,1), xi(r,1), fx(r,1), dfx(r,1), Ea(r,1)) end e function new1 = F(x) f new1 = 8*sin(x)*exp(-x) - 1; n end e function new2 = DF(x) f new2 = 8*exp(-x)*(cos(x)-sin(x)); n 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