Module 3 Linear System of Equations
Module 3 Linear System of Equations
-50
-100
-5 -4 -3 -2 -1 0 1 2 3 4 5
Indirect or Iterative Methods
A. Bracketing Methods – these are methods based on
two initial guesses that bracket a root.
1. Bisection Method
2. Method of False Position (Regula Falsi Method)
3. Secant Method
B. Non-Bracketing (Open) Methods – based on one or
more initial estimation (guess) of the solution that
does not bracket a root.
1. Newton-Raphson Method (Newton's Method)
2. Successive Approximation Method (Fixed Point
Iteration)
Bisection (or Interval Halving) Method
After a root of f(x) = 0 has been
bracketed in the interval (a, b).
Bisection method can be used to close
in on it. The Bisection method
accomplishes this by successfully
halving the interval until it becomes
sufficiently small.
initial guess = 1
Third Arrangement
x = (x^2 - 3)/2
n xn xn+1 |xn+1 - xn| < tol tol
0 1.0000000 -1.0000000 FALSE 0.0001
1 -1.0000000 -1.0000000 TRUE 0.0001
After 1 iteration, the root converges to -1.0000000
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 4 tolerance = 0.0001
First Arrangement:
x = sqrt(2x + 3)
n xn xn+1 |xn+1 - xn| < tol tol
0 4.0000000 3.3166248 FALSE 0.0001
1 3.3166248 3.1037477 FALSE 0.0001
2 3.1037477 3.0343855 FALSE 0.0001
3 3.0343855 3.0114400 FALSE 0.0001
4 3.0114400 3.0038109 FALSE 0.0001
5 3.0038109 3.0012700 FALSE 0.0001
6 3.0012700 3.0004233 FALSE 0.0001
7 3.0004233 3.0001411 FALSE 0.0001
8 3.0001411 3.0000470 TRUE 0.0001
9 3.0000470 3.0000157 TRUE 0.0001
After 9 iterations, the root converges to 3.0000157
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 4 tolerance = 0.0001
Second Arrangement
x = 3/(x - 2)
n xn xn+1 |xn+1 - xn| < tol tol
0 4.0000000 1.5000000 FALSE 0.0001
1 1.5000000 -6.0000000 FALSE 0.0001
2 -6.0000000 -0.3750000 FALSE 0.0001
3 -0.3750000 -1.2631579 FALSE 0.0001
4 -1.2631579 -0.9193548 FALSE 0.0001
5 -0.9193548 -1.0276243 FALSE 0.0001
6 -1.0276243 -0.9908759 FALSE 0.0001
7 -0.9908759 -1.0030506 FALSE 0.0001
8 -1.0030506 -0.9989842 FALSE 0.0001
9 -0.9989842 -1.0003387 FALSE 0.0001
10 -1.0003387 -0.9998871 FALSE 0.0001
11 -0.9998871 -1.0000376 FALSE 0.0001
12 -1.0000376 -0.9999875 TRUE 0.0001
After 12 iterations, the root converges to -0.9999875
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
Where: n = 0, 1, 2, …
Sample Problems in
Newton’s Method
1. Find the root of f(x) = x6 – x – 1 = 0 accurate
to within 0.001 using Newton’s method.
2. Use Newton’s method to approximate the
positive root of x5 – 2 = 0 accurate to four
decimal places.
3. Approximate one real root of the non−linear
equation f(x) = x2 + 4x + 3 + sin x – xcos x to
four decimal places using Newton’s method.
Excel Output for Newton’s Method
1. Find the root of f(x) = x6 – x – 1 = 0 accurate to within
0.001 using Newton’s method.
x^6 - x - 1 = 0
tolerance = 0.001
f(x) = x^6 - x - 1 = 0 f'(x) = 6x^5 - 1
initial guess = 1
n xn xn+1 |x+1 - xn| < tol tol
0 1.0000000 1.2000000 FALSE 0.0001
1 1.2000000 1.1435758 FALSE 0.0001
2 1.1435758 1.1349095 FALSE 0.0001
3 1.1349095 1.1347242 FALSE 0.0001
4 1.1347242 1.1347241 TRUE 0.0001
After 4 iterations, the root converges to 1.1347241
initial guess = -1
n xn xn+1 |x+1 - xn| < tol tol
0 -1.0000000 -0.8571429 FALSE 0.0001
1 -0.8571429 -0.7899519 FALSE 0.0001
2 -0.7899519 -0.7783727 FALSE 0.0001
3 -0.7783727 -0.7780898 FALSE 0.0001
4 -0.7780898 -0.7780896 TRUE 0.0001
After 4 iterations, the root converges to -0.7780896
Excel Output for Newton’s Method
2. Use Newton’s method to fifth root of 2
f(x) = x^5 - 2 f'(x) = 5x^4
approximate the positive
root of x5 – 2 = 0 accurate initial guess = 32
n xn
tolerance = 0.001
xn+1 |x+1 - xn| < tol tol
to four decimal places. 0 32.0000000 25.6000004 FALSE 1.00E-12
1 25.6000004 20.4800012 FALSE 1.00E-12
2 20.4800012 16.3840033 FALSE 1.00E-12
3 16.3840033 13.1072082 FALSE 1.00E-12
4 13.1072082 10.4857801 FALSE 1.00E-12
5 10.4857801 8.3886572 FALSE 1.00E-12
6 8.3886572 6.7110065 FALSE 1.00E-12
7 6.7110065 5.3690024 FALSE 1.00E-12
8 5.3690024 4.2956833 FALSE 1.00E-12
9 4.2956833 3.4377213 FALSE 1.00E-12
10 3.4377213 2.7530411 FALSE 1.00E-12
11 2.7530411 2.2093961 FALSE 1.00E-12
12 2.2093961 1.7843036 FALSE 1.00E-12
13 1.7843036 1.4669054 FALSE 1.00E-12
14 1.4669054 1.2599120 FALSE 1.00E-12
15 1.2599120 1.1666743 FALSE 1.00E-12
16 1.1666743 1.1492438 FALSE 1.00E-12
17 1.1492438 1.1486989 FALSE 1.00E-12
18 1.1486989 1.1486984 FALSE 1.00E-12
19 1.1486984 1.1486984 TRUE 1.00E-12
After 19 iterations, the root converges to 1.1486984
Excel Output for Newton’s Method
3. Approximate one real root of the non−linear equation
f(x) = x2 + 4x + 3 + sin x – xcos x to four decimal
places using Newton’s method.
initial guess = 1
2𝑐
h1 h2 𝑥3 = 𝑥2 −
𝑏 ± 𝑏2 − 4𝑎𝑐
Muller’s Method
h0 h1 h0 h1 h0 h1
d0 d1 d0 d1 d0 d1
𝑐𝑛 = 𝑏𝑛
𝑐𝑛−1 = 𝑏𝑛−1 + 𝑟𝑐𝑛
𝑐𝑖 = 𝑏𝑖 + 𝑟𝑐𝑖+1 + 𝑠𝑐𝑖+2 For i = n – 2 to 0
𝑐2 Δ𝑟 + 𝑐3 Δ𝑠 = −𝑏1 𝑟𝑛+1 = 𝑟𝑛 + Δ𝑟
𝑐1 Δ𝑟 + 𝑐2 Δ𝑠 = −𝑏0 𝑠𝑛+1 = 𝑠𝑛 + Δ𝑠
ans =
1.7321
-1.7321
-1.0000
>>
MATLAB Implementation
Fzero Command
The fzero(f,x) function tries to find a zero of a function of one variable,
where f is a string containing the name of a real−valued function of a
single real variable. MATLAB searches for a value near a point where
the function f changes sign, and returns that value, or returns NaN if the
search fails.
Find the roots of f(x) = x3 + x2 – 3x – 3.
ans =
1.7321
>>
MATLAB Implementation
ans =
0.3604
>>