Chapter Three
Chapter Three
System of Equations
3.1.Direct Methods
1
3.1.1 Gauss Elimination method
2
In the example, we had a11 0 . Otherwise we would not have been able to eliminate x1 by
using the equations in the given order. Hence if a11 0 in the system of equations, we have to
reorder the equations ( and perhaps even the unknowns in each equation) in a suitable fashion.
3
Exercise: Using Gauss elimination method solve
y 3z 9
2x 2 y z 8
x 5z 8
x 2
Answer: y 3
z 2
4
Example:- Solve the following system of equations by Gauss Jordan method
x yz 5
2 x 3 y 5z 8
4 x 5z 2
Exercise
Answer: x1 1, x2 1, x3 5
5
3.1.4 Matrix inverse Method
So that in order to solve a system of linear equations Ax b , if A is invertible the solution will
be x A 1b . Getting a solution by such procedure is called Matrix inverse method. To use this
method, the challenge is getting an inverse of a matrix, especially when the order is getting
larger and larger. As you recall from linear algebra one of the method is using elementary
operation, that is writing [ A I ] [ I A1 ] .
Once if we get A1 we can multiply it with b and determine the solution of the system.
x yz 4
2 x y 3z 0
x yz 2
Solution
1 1 1 x 4
First let us write in AX b form where A 2 1 3, X y , and B 0 now to apply
1 1 1 z 2
the matrix inverse method we have to get A1 . We can get it (by whatever method you use) as
4 2 2 x 4 2 2 4 2
A 1 5 0 5 , so that our solution will be y 5 0 5 0 1
1 1
10 10
1 2 3 z 1 2 3 2 1
Note that this method is so simple if you use the matlab program in the lab.
Reading Assignment
Write a program for Gauss elimination & Matrix inverse method and check it by
solving system of equations given as an example.
6
3.2. Iterative Methods
3.2.1 Gauss Jacobi Method( Jacobi’s iterative method) and 3.2.2 Gauss Seidel Method
7
8
9
Example:-Solve the following system of linear equations using (a) Jacobi’s iteration method and
(b) Gauss-Seidel iteration method
10
Exercise
Write a program to Gauss-Seidel iteration method using Matlab software and solve the above
problems
11
3.3 System of Non Linear equations using Newton’s Method
12
13
14
Example:-
x2 y2 1 x 0. 5
using Newton’s method by taking initial guess 0
yx 2
y 0 0. 5
2. Write a Matlab program for iterative Newton’s method and solve the above problems
15