hw307 - 2.2 4. FIXED POINT ITERATION CODE i = 1; N = 100;...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
2.2 4. FIXED POINT ITERATION CODE i = 1; N = 100; p0 = 1; tol = 1.e-2; while i <= N p = g(p0); if abs(p-p0) < tol disp( 'The procedure was successful after k iterations' ) k = i disp( 'The root to the equation is' ) p return end i = i+1; p0 = p; end disp( 'Method Failed after N iterations' ) N a) Method Failed after N iterations N = 100 b) Method Failed after N iterations N = 100 c) The procedure was successful after k iterations k = 6 The root to the equation is p = 1.4758 d) The procedure was successful after k iterations k = 67 The root to the equation is p = 1.4806 5. function y = g(x)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
y =(3*x^2+3)^(1/4); The procedure was successful after k iterations k = 6 The root to the equation is p = 1.9433 6. a) function y = g(x) y =x-(exp(x)+2^(-x)+2*cos(x)-6)/(-2*log(2)*2^(-x)-2*sin(x)+exp(x)); The procedure was successful after k iterations k = 10 The root to the equation is p = 1.8494 b) function y = g(x) y = x-(log(x-1)+cos(x-1))/(1/(x-1)-sin(x-1)); The procedure was successful after k iterations
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

hw307 - 2.2 4. FIXED POINT ITERATION CODE i = 1; N = 100;...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online