This preview shows pages 1–3. Sign up to view the full content.
2.2
4.
FIXED POINT ITERATION CODE
i = 1;
N = 100;
p0 = 1;
tol = 1.e2;
while
i <= N
p = g(p0);
if
abs(pp0) < 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)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Documenty =(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(x1)+cos(x1))/(1/(x1)sin(x1));
The procedure was successful after k iterations
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '08
 MACKGALLOWAY

Click to edit the document details