0% found this document useful (0 votes)
64 views8 pages

Lec. - 1 - (Linear Eqns.)

This document provides an introduction and overview of methods for solving systems of linear equations, including direct and indirect methods. It discusses the Gauss-Seidel iterative technique for indirect methods, which finds an approximate solution that converges to the true solution through iterations. It also covers the Gauss elimination and Gauss-Jordan direct methods, which find the exact solution systematically by eliminating variables. Examples are provided to illustrate the application of each method. Homework problems are assigned at the end to practice applying Gauss-Seidel, Jacobi, and Gauss elimination methods to additional systems of linear equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views8 pages

Lec. - 1 - (Linear Eqns.)

This document provides an introduction and overview of methods for solving systems of linear equations, including direct and indirect methods. It discusses the Gauss-Seidel iterative technique for indirect methods, which finds an approximate solution that converges to the true solution through iterations. It also covers the Gauss elimination and Gauss-Jordan direct methods, which find the exact solution systematically by eliminating variables. Examples are provided to illustrate the application of each method. Homework problems are assigned at the end to practice applying Gauss-Seidel, Jacobi, and Gauss elimination methods to additional systems of linear equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1 Chapter One / System of Linear Equations

1.1 Introduction

The basic idea for this method is finding the value of (x) by
arranging several simulation equations in a manner that simplify the
solution.

A simple example can explain the above text:

Suppose we have several equations that contain the unknown value of (x),
we cannot find the value of (xs) from one equation, like
𝒂𝟏𝟏 𝒙𝟏 + 𝒂𝟏𝟐 𝒙𝟐 + 𝒂𝟏𝟑 𝒙𝟑 + ⋯ + 𝒂𝟏𝒏 𝒙𝒏 = 𝒃𝟏
Where
The values of 𝒙𝟏 → 𝒙𝒏 is unknown
𝒂𝟏𝟏 → 𝒂𝟏𝒏 Constant
𝒃𝟏 Constant
So:
If we want to know the values of (x), we should have several equations
having a number equal to the number of unknown,

𝒂𝟏𝟏 𝒙𝟏 + 𝒂𝟏𝟐 𝒙𝟐 + 𝒂𝟏𝟑 𝒙𝟑 + ⋯ + 𝒂𝟏𝒏 𝒙𝒏 = 𝒃𝟏


𝒂𝟐𝟏 𝒙𝟏 + 𝒂𝟐𝟐 𝒙𝟐 + 𝒂𝟐𝟑 𝒙𝟑 + ⋯ + 𝒂𝟐𝒏 𝒙𝒏 = 𝒃𝟐
⋮ ⋮ ⋮ ⋮
𝒂𝒎𝟏 𝒙𝟏 + 𝒂𝒎𝟐 𝒙𝟐 + 𝒂𝒎𝟑 𝒙𝟑 + ⋯ + 𝒂𝒎𝒏 𝒙𝒏 = 𝒃𝒎

Where the as are constant coefficients and the bs are constants.


There are two types for solving the system of equations.
A- Indirect Method (Gauss-Seidel, Jacobi).
B- Direct Method (Gauss Elimination, Gauss Jordan).

Lec. Hussein K. Jobair


2 Chapter One / System of Linear Equations

1.2 Indirect Method (Iterative Technique)


1.2.1 Gauss-Seidel Iteration Method
Iterative technique method is one in which we start from an
approximate and end up with the true solution as the number of iterations
becomes large.
Assume the equations:
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
The solution for the new values is:
(𝑘+1) 𝑏1 𝑎12 (𝑘) 𝑎13 (𝑘)
𝑥1 = − 𝑥 − 𝑥
𝑎11 𝑎11 2 𝑎11 3

(𝑘+1) 𝑏2 𝑎21 (𝑘+1) 𝑎23 (𝑘)


𝑥2 = − 𝑥 − 𝑥
𝑎22 𝑎22 1 𝑎22 3

(𝑘+1) 𝑏3 𝑎31 (𝑘+1) 𝑎32 (𝑘+1)


𝑥3 = − 𝑥 − 𝑥
𝑎33 𝑎33 2 𝑎33 3

In General
(𝑘+1) 𝑏1 𝑎12 (𝑘) 𝑎13 (𝑘) 𝑎1𝑛 (𝑘)
𝑥1 = − 𝑥2 − 𝑥3 … … − 𝑥
𝑎11 𝑎11 𝑎11 𝑎11 𝑛

(𝑘+1) 𝑏2 𝑎21 (𝑘+1) 𝑎23 (𝑘) 𝑎2𝑛 (𝑘)


𝑥2 = − 𝑥1 − 𝑥3 … … − 𝑥
𝑎22 𝑎22 𝑎22 𝑎22 𝑛

⋮ ⋮ ⋮ ⋮ ⋮

(𝑘+1) 𝑏𝑛 𝑎𝑛1 (𝑘+1) 𝑎𝑛2 (𝑘+1) 𝑎𝑛 𝑛−1 (𝑘+1)


𝑥𝑛 = − 𝑥1 − 𝑥2 …… − 𝑥
𝑎𝑛𝑛 𝑎𝑛𝑛 𝑎𝑛𝑛 𝑎𝑛𝑛 𝑛−1

Lec. Hussein K. Jobair


3 Chapter One / System of Linear Equations

Important Note

The first step for solving any gauss-Seidel problem is to apply the condition
below

|𝑎𝑖𝑖 | > ∑|𝑎𝑖𝑗 |


𝑗≠𝑖

Example (1-1)

Solve the following set of linear algebraic equations using Gauss-Seidel


method.
5𝑥1 − 2𝑥2 + 𝑥3 = 4
𝑥1 + 4𝑥2 − 2𝑥3 = 3
𝑥1 + 2𝑥2 + 4𝑥3 = 17

Solution

Obtain the condition

|5| > |−2| + |1| → 5 > 3 .. Right


|4| > |1| + |−2| → 4 > 3 .. Right
|4| > |1| + |2| → 4 > 3 .. Right
∴ We can solve the problem by Gauss-Seidel Method.

(𝑘+1) (𝑘) (𝑘)


𝑥1 = 0.8 + 0.4𝑥2 − 0.2𝑥3

(𝑘+1) (𝑘+1) (𝑘)


𝑥2 = 0.75 − 0.25𝑥1 + 0.5𝑥3

(𝑘+1) (𝑘+1) (𝑘+1)


𝑥3 = 4.25 − 0.25𝑥1 − 0.5𝑥2

For (k=0)/first iterative, initial guess 𝑥1 = 𝑥2 = 𝑥3 = 1

𝑥11 = 0.8 + 0.4 − 0.2 = 1

Lec. Hussein K. Jobair


4 Chapter One / System of Linear Equations

𝑥21 = 0.75 − (0.25 ∗ 1) − 0.5 = 0


𝑥31 = 4.25 − 0.25 − 0 = 4

The process is continued by substituting the new 𝒙𝟐𝟐 & 𝒙𝟐𝟑

Iteration X1 X2 X3
1 1 0 4
2 0 2.75 2.875
3 1.324 1.8565 2.990
4 0.9446 2.008 3.007
5 1.002 2.003 2.998
6 1.001 1.999 3.000
7 0.999 2.000 3.000

∴ 𝑥1 = 1, 𝑥2 = 2, 𝑥3 = 3
H.W (1)
Solve the following sets of linear equations using Gauss-Seidel and Jacobi
iteration methods and compare the results of the two methods.
8𝑥1 + 2𝑥2 + 3𝑥3 = 30
𝑥1 − 9𝑥2 + 2𝑥3 = 1
2𝑥1 + 3𝑥2 + 6𝑥3 = 31

Lec. Hussein K. Jobair


5 Chapter One / System of Linear Equations

H.W (2)
Solve the following sets of linear equations using Gauss-Seidel and Jacobi
iteration methods.
10𝑥1 − 𝑥2 + 2𝑥3 =6
−𝑥1 + 11𝑥2 − 𝑥3 + 3𝑥4 = 25
2𝑥1 − 𝑥2 + 10𝑥3 − 𝑥4 = −11
3𝑥2 − 𝑥3 + 8𝑥4 = 15
1.3 Direct Method (Exact Method)
1.3.1 Gauss Elimination Method
Engineers often need to solve large systems of linear equations; for
example in determining the forces in a large framework or finding currents
in a complicated electrical circuit. The method of Gauss elimination
provides a systematic approach to their solution.
The technique involves combining equations in order to eliminate
unknown, although it is one of the earliest methods for solving simultaneous
equations, it remains among the most important algorithms in use today.
Simple Example
Consider we have three simultaneous equations
3𝑥1 − 𝑥2 + 2𝑥3 = 12 → 𝑟1
𝑥1 + 2𝑥2 + 3𝑥3 = 11 → 𝑟2
2𝑥1 − 2𝑥2 − 𝑥3 = 2 → 𝑟3

First step eliminating x1 from equations (1&2)


(3r2 – r1) & multiply r1 by 2 & r3 by 3 and subtract r3 from r1
3𝑥1 − 𝑥2 + 2𝑥3 = 12
0 + 7𝑥2 + 7𝑥3 = 21
0 − 4𝑥2 − 7𝑥3 = −18

Lec. Hussein K. Jobair


6 Chapter One / System of Linear Equations

Eliminate x2 from equation (3) by multiplying equation (2 by 4) and


equation (3 by 7).
3𝑥1 − 𝑥2 + 2𝑥3 = 12
0 + 7𝑥2 + 7𝑥3 = 21
0 + 0 − 21𝑥3 = −42
𝑥3 = 2 From third equation
By back substitution
𝑥2 = 1 , 𝑥1 = 3
H.W (1)
Solve the following sets of linear equations using Gauss-Elimination
method.
0.729 0.81 0.9 0.6867
[ 1 1 1 ] [0.8338]
1.331 1.2 1 1
H.W (2)
Solve the following sets of linear equations using Gauss-Elimination
method.
𝑥1 + 𝑥2 − 𝑥3 = 0
3𝑥1 − 𝑥2 + 𝑥3 = 4
𝑥1 − 2𝑥2 + 2𝑥3 = 3
1.3.2 Gauss-Jordan Method
The Gauss-Jordan method is a variation of Gauss Elimination, the
major difference is that the unknowns eliminated from all other equations
rather than just the subsequent ones.
All rows are normalized by dividing them by their pivot equations,
this illustrated by an example.

Lec. Hussein K. Jobair


7 Chapter One / System of Linear Equations

𝑎11 𝑎12 𝑎13 𝑐1


[𝑎21 𝑎22 𝑎23 ⋮ 𝑐2 ]
𝑎31 𝑎32 𝑎33 𝑐3
↓↓↓
(𝑛)
1 0 0 𝑐1
(𝑛)
[0 1 0 ⋮ 𝑐2 ]
0 0 1 (𝑛)
𝑐3

Hint
The superscript (n) means that the elements of the right-hand side vector
have been modified n- times (for this case n=3).
Example
Solve the following set of algebraic equations by using the Gauss-Jordan
method
3𝑥1 − 0.1𝑥2 − 0.2𝑥3 = 7.85
0.1𝑥1 + 7𝑥2 − 0.3𝑥3 = −19.3
0.3𝑥1 − 0.2𝑥2 + 10𝑥3 = 71.3

Solution
The first step normalized the first row by dividing by 3

1 −0.0333 −0.06667 2.61667 𝑅1


[0.1 7 −0.31 ⋮ −19.3 ]→𝑅2
0.3 −0.2 10 71.3 𝑅3

Now: (R2 - 0.1R1), (R3 – 0.3R1)

1 −0.0333 −0.06667 2.61667


[0 7.0033 −0.2933 ⋮ −19.56166]
0 −0.1900 10.02 70.51499

Now: (R2/7.0033), (R3 +0.1900R2)

Lec. Hussein K. Jobair


8 Chapter One / System of Linear Equations

1 −0.0333 −0.06667 2.61667


[0 1 −0.0417 ⋮ −2.7814]
0 0 10.192 70.086

Now: (R1 + 0.0333R2)

1 0 −0.068 2.524
[0 1 −0.0417 ⋮ −2.7814]
0 0 10.192 70.081
Now: (R3/10.192),(R1 + 0.068R3), (R1+0.0417R2)

1 0 0 2.991
[0 1 0 ⋮ −2.4946]
0 0 1 6.8765

∴ 𝑥1 = 2.991 , 𝑥2 = −2.4946 , 𝑥3 = 6.8765


H.W (1)
Solve the following set of algebraic equations by using Gauss-Jordan
method
3 −1 2 12
[1 2 3 ⋮ 11]
2 −2 −1 2

Lec. Hussein K. Jobair

You might also like