7 Lecture Notes 10-13 Aug 20 27 System of Equations
7 Lecture Notes 10-13 Aug 20 27 System of Equations
Lecture Notes-10-13
by
Prof. Santwana Mukhopadhyay
1 System of Equations
2 Direct Methods
Definition:
Consider a system of m linear equations in n (unknown) variables:
Write
a11 a12 ..... a1n b1 x1
a21 a22 ..... a2n b2 x2
A= , b = , x =
... ... ... ... ... ...
am1 am2 ... amn bm xn
Then, A is called the coefficient matrix of the system (1.1). We also
write A = (aij ).
In matrix form, the system (1.1) is written as
Ax = b (1.2)
If b = 0, then the system (1.2) would be called a homogeneous
system. So,
Ax = 0 (1.3)
is a homogeneous system of linear equation.
Then, x = 0 is a solution of the homogeneous system (1.3), to be
called the trivial solution.
Prof. S. Mukhopadhyay (Department of Mathematical
Numerical
SciencesTechnique
IIT(BHU),(MA-201)
Varanasi) 4 / 34
System of equations contd...
In deed, the system (1.1) and the augmented matrix (1.4) has the
same information/data. The row operations performed on system
(1.1), can be performed on the augmented matrix (1.4), in stead.
x = A−1 b (1.5)
j=1,j6=i
Types of matrices:
Let A = (aij ) be a n × n real matrix. Then
A is nonsingular if |A| =
6 0.
A is singular if |A| = 0.
A is symmetric if A = AT .
A is skew symmetric if A = −AT .
A is null if aij = 0 for all i and j.
A is diagonal if aij = 0 for all i 6= j.
Norm of a vector:
Let x = (x1 , x2 , ..., xn ) be a vector. Then
Absolute norm (l1 norm)
n
kx k1 =
X
|xi |
i=1
kx k∞ = max |xi |
1≤i≤n
Norm of a matrix:
Let A be n × n matrix. Then
Frobenius or Euclidean norm
n
!1/2
X
F (A) = |aij | 2
i,j=1
Maximum norm X
kAk∞ = max |aik |
i
k
Condition number:
The condition number of a matrix A is defined and denoted by
ρ(A) ≤ kAk
Direct Methods:
Gauss elimination method
Gauss-Jordan method
Gauss elimination method:
Let us introduce the Gaussian elimination method for n = 3. The method for a general
n × n system is similar.
a11 x1 + a12 x2 + a13 x3 = b1 (2.1)
a21 x1 + a22 x2 + a23 x3 = b2 (2.2)
a31 x1 + a32 x2 + a33 x3 = b3 (2.3)
The solution of the above system of equations can be obtained by Gauss elimination
methd in the following steps:
Step 1:
Assume that a11 6= 0 (otherwise interchange the row for which the coefficient of x1 is
non-zero). Let us eliminate x1 from (2.2) and (2.3). For this define
a21 a31
m21 =
, m31 =
a11 a11
Multiply (2.1) with m21 and subtract with (2.2), and multiply (2.1) with m31 and
subtract with (2.3) to give
Step 2:
(2)
Assume that a22 6= 0 and eliminate x2 from (2.6). Define
(2)
a32
m32 = (2)
a22
Subtract m32 times (2.5) from (2.6) to get
Step 3:
Example:
Solve the given system of equations
using Gaussian elimination method with digits upto four decimal places.
Solution:
1 1/3 1/3
−1/3
∼ 2 0.6667 0.3333 1.000
1 2 −1.0 0.0
Solution contd...
Set a22 =1 and then a32 = 0, so that we get the augmented matrix as
1 1/3 1/3
−1/3
∼ 0 1 −3333 16670
0 0 5554.7777 −27788
Alternative:
The difficulty with this elimination process as given above, is that in (??),
the element in row 2 and column 2 should be nonzero, but rounding error
prevented it and makes the relative error very large. To avoid this,
interchange row 2 and 3 and then continue the elimination. The final
system is (with m32 = 0.00005999)
6.000x1 + 2.000x2 + 2.000x3 = − 2.000
1.667x2 − 1.333x3 =0.3334
−0.3332x3 =1.667
with back substitution, we obtain the approximate solution as x1 = 2.602,
x2 = −3.801 and x3 = −5.003, which is close to exact solution.
Note: Pivoting process helped to avoid the problem encountered earlier
and to get more accurate result.
Prof. S. Mukhopadhyay (Department of Mathematical
Numerical
SciencesTechnique
IIT(BHU),(MA-201)
Varanasi) 26 / 34
Gauss elimination method contd...
Partial Pivoting:
To fix up the diagonal element at ith column, find the entry in the
remaining part from ith position of that column with the largest
absolute value. This entry is called the pivot.
Perform a row interchange, if necessary, so that the pivot is in the ith
row.
Complete Pivoting:
The term partial in partial pivoting refers to the fact that in each pivot
search only entries in the left column of the matrix or submatrix are
considered. This search can be extended to include every entry in the
coefficient matrix or submatrix; the resulting technique is called Gaussian
elimination with complete pivoting.
Unfortunately, neither complete pivoting nor partial pivoting solves all
problems of rounding error.
Example:
Use Gaussian elimination with partial pivoting to solve the following system
Solution contd...
Adding 1.31 times the first row to the second row produces a new second row
1.00 −0.384 −0.0540 0.395
!
0.00 0.408 1.92 −4.94
0.143 0.357 2.01 −5.17
Adding – 0.143 times the first row to the third row produces a new third row
1.00 −0.384 −0.0540 0.395
!
0.00 0.408 1.99 −4.94
0.00 0.412 2.02 −5.23
This completes the first step. We consider the submatrix formed by deleting the first
row and first column. In this matrix the pivot is 0.412, which means that the second and
third rows should be interchanged (interchange the second and third rows)
1.00 −0.384 −0.054 0.395
!
0.00 [0.412] 2.02 −5.23
0.00 0.408 1.92 −4.94
Solution contd...
Adding –0.408 times the second row to the third row produces a new third row
This completes the second step. By using back substitution, the solution can be
obtained as
x3 = −3.00, x2 = 2.00, x1 = 1.00
which agrees with the exact solution of x1 = 1, x2 = 2 and x3 = −3 when rounded to
three significant digits.
Task:
Solve the following system of equations by the Gauss elimination method with partial
pivoting:
(a)
4x1 + x2 + x3 = 4
x1 + 4x2 –2x3 = 4