Professional Documents
Culture Documents
Lec 9 Other Methods
Lec 9 Other Methods
• Linear Interpolation
• Muller’s Method
• Fixed Point Iteration
Linear Interpolation or Regula Falsi
• The bisection method is not very efficient. We
would like to converge to the root at a faster
rate with a different algorithm.
problem:
x5 + x3 + 4x2 - 3x – 2 = 0 40
f(x)
20
• Let us first draw a graph
and see where are the roots;
10
• The roots are between (-
1.7,-1.3), (-1,0), & (0.5,1.5) 0
c1 = (f(x2)-f(x1))/(x2 - x1)
c2 = (f(x3)-f(x2))/(x3 - x2)
d1 = (c2-c1)/(x3 - x1)
s = c2 + d1 *(x3 - x2)
x4 = x3 - 2*f(x3)/
[s + sign(s)*sqrt( s^2 -4*f(x3)*d1]
Set x1 = x2;
Set x2 = x3;
Set x3 = x4;
END loop
Muller’s Method
f(x)
20
k a b c xmid f(xmid)
1 -2.00000000 -1.75000000 -1.50000000 -1.51271936 7.394e-005
2 -1.75000000 -1.50000000 -1.51271936 -1.51272104 7.394e-005
3 -1.50000000 -1.51271936 -1.51272104 -1.51272189 7.394e-005
4 -1.51271936 -1.51272104 -1.51272189 -1.51272189 7.394e-005
5 -1.51272104 -1.51272189 -1.51272189 -1.51271884 7.394e-005
6 -1.51272189 -1.51272189 -1.51271884 -1.51271884 7.394e-005
7 -1.51272189 -1.51271884 -1.51271884 -1.51271884 7.394e-005
8 -1.51271884 -1.51271884 -1.51271884 -1.51271884 7.394e-005
9 -1.51271884 -1.51271884 -1.51271884 -1.51271884 7.394e-005
10 -1.51271884 -1.51271884 -1.51271884 -1.51271884 7.394e-005
f(x) = a3 x3 + a2 x2 + a1 x + a0 = 0
f(x)
-3 -2 -1 0 1 2
for 0.1<x<0.5 -5
-15
-20
x value
Computer Program in MATLAB
% It Uses fixed Point Iteration to find the roots
% of x = 5x^3 - 10x + 3
% Input: x0 = initial guess
% left = left boundary
% right = right boundary
% n = (optional) number of iterations; default: n =8
% Output: x = estimate of the root
n=10; x0 = 0.1; left = 0.0; right = 0.5;
x = x0; % Initial Guess
gleft = 1.5*left^2;
gright = 1.5*right^2;
fprintf('left hand boundary is %8.4f and g`(x) = %8.4f\n',left,gleft);
fprintf('right hand boundary is %8.4f and g`(x) = %8.4f\n\n',right,gright);
if( (abs(gleft) > 0.5)|(abs(gright)> 0.5)) break; end
end
Results
Result of the computer program: xleft = -2.0 , xright = -1.5 and iterations n = 10.
left hand boundary is 0.0000 and g`(x) = 0.0000
right hand boundary is 0.5000 and g`(x) = 0.3750
k x g(x) abs(x(k+1)-x(k))