0% found this document useful (0 votes)
2 views

SemIV_Unit_VI_Numerical Methods_Notes

The document outlines numerical methods for solving algebraic and transcendental equations, including the Bisection Method, Regular-Falsi Method, and iterative techniques such as Gauss elimination. It provides step-by-step instructions and examples for finding roots of equations using these methods, highlighting their applications and limitations. Additionally, it emphasizes the importance of numerical methods in achieving desired accuracy in practical scenarios.

Uploaded by

Prayag Parikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SemIV_Unit_VI_Numerical Methods_Notes

The document outlines numerical methods for solving algebraic and transcendental equations, including the Bisection Method, Regular-Falsi Method, and iterative techniques such as Gauss elimination. It provides step-by-step instructions and examples for finding roots of equations using these methods, highlighting their applications and limitations. Additionally, it emphasizes the importance of numerical methods in achieving desired accuracy in practical scenarios.

Uploaded by

Prayag Parikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SVKM’s Narsee Monjee Institute of Management Studies

Mukesh Patel School of Technology Management & Engineering


----------------------------------------------------------------------------------------------------------------
Unit VI –Numerical Methods:
Solution of algebraic equation using Bisection Method, Regular-Falsi Method,
Newton-Raphson Method.
Solution of simultaneous equation using Gauss elimination Method, Jacobi’s Method,
Gauss-Seidel Method.
----------------------------------------------------------------------------------------------------------------
1.1 Introduction

Consider 𝑓(𝑥) = 𝑎0 𝑥 𝑛 + 𝑎1 𝑥 𝑛−1 + 𝑎2 𝑥 𝑛−2 + 𝑎3 𝑥 𝑛−3 + ⋯ + 𝑎𝑛 where 𝑎’𝑠 are constant


(𝑎0 ≠ 0), 𝑛 is a positive integer.
𝑓(𝑥) is called a polynomial of degree 𝑛 and the equation 𝑓(𝑥) = 0 is called an algebraic
equation of degree 𝑛
If 𝑓(𝑥) contains functions like exponential, trigonometric, logarithmic then 𝑓(𝑥) = 0
is called transcendental equation.
Examples:
Algebraic equations: 𝑥 3 − 3𝑥 + 6 = 0, 𝑥 5 − 7𝑥 4 + 3𝑥 2 + 36𝑥 − 7 = 0
Transcendental equations: 𝑡𝑎𝑛𝑥 − 𝑥 = 0, 𝑥 2 − 3𝑐𝑜𝑠𝑥 + 1 = 0, 𝑥𝑒 𝑥 − 2 = 0
1.2 Methods for finding the root (solution) of an equation
• Direct methods
o Roots of 𝑓(𝑥) = 0 can be found by using direct analytical methods.
• Iterative methods
o These methods are also known as trial-and-error methods and are based on
the idea of successive approximations. These methods give only one root at
a time.
Note:
• The limitations of analytical methods in practical applications have led to the
development of numerical methods.
• Numerical methods are used to approximate the solution of the problem with
a desired accuracy.
• Numerical methods are repetitive i.e., consists of repeated execution of same
process till the result is obtained to desired degree of accuracy. This is known
as iteration process.

1.3 Solution of algebraic equations


The following 3 methods to find a root
of an equation are based on the same
theorem
Theorem: An equation 𝑓(𝑥) = 0,
where 𝑓(𝑥) is a real continuous
function, has at least one root between
𝑎 and 𝑏 if 𝑓(𝑎)𝑓(𝑏) < 0

--------------------------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 1
Unit VI – Numerical Methods
----------------------------------------------------------------------------------------------------------------
1.3.1 Bisection Method

Steps:
1. Given 𝑓(𝑥) = 0, find, by trial and error, real numbers 𝑎 and 𝑏 such that 𝑓(𝑎)𝑓(𝑏) <
0, i.e., 𝑓(𝑎) and 𝑓(𝑏) should have opposite signs.
𝑎+𝑏
2. Evaluate 𝑐 = 2 and hence find 𝑓(𝑐)
3. Case 1: if 𝑓(𝑎)𝑓(𝑐) < 0 then the root lies between 𝑎 and 𝑐. Therefore, replace 𝑏 with
𝑐 and repeat step 2
Case 2: if 𝑓(𝑏)𝑓(𝑐) < 0 then the root lies between 𝑏 and 𝑐. Therefore, replace 𝑎
with 𝑐 and repeat step 2
4. Repeat step 3 till 𝑓(𝑐) is as close to zero as possible.
----------------------------------------------------------------------------------------------------------------
Example 1:
Find the approximate value of the root of the equation 𝑥 3 − 2𝑥 2 = 5 using Bisection
method. Take 4 iterations up to 4 digits after the decimal.
Solution:
Let 𝑓(𝑥) = 𝑥 3 − 2𝑥 2 − 5
𝑓(0) = −5 < 0,
𝑓(1) = −6 < 0,
𝑓(2) = −5 < 0,
𝑓(3) = 4 > 0,
Since 𝑓(2) and 𝑓(3) have opposite signs,
∴ 𝑓(2)𝑓(3) < 0, 𝑎 = 2, 𝑏=3
𝑎+𝑏
𝑖 𝑎 𝑓(𝑎) 𝑏 𝑓(𝑏) 𝑐= 𝑓(𝑐) = 𝑐 3 − 2𝑐 2 − 5
2
2+3
1 2 −5 3 4 𝑐= = 2.5 𝑓(2.5) = −1.875
2
2.5 + 3
2 2.5 −1.875 3 4 𝑐= = 2.75 𝑓(2.75) = 0.6719
2
2.5 + 2.75 𝑓(2.625)
3 2.5 −1.875 2.75 0.6719 𝑐 = = 2.625
2 = −0.6934
2.625 + 2.75
𝑓(2.6875)
4 2.625 −0.6934 2.75 0.6719 𝑐 = 2 = −0.0344
= 2.6875
After 4 iterations, using Bisection method, the approximate root of 𝑥 3 − 2𝑥 2 = 5 is
2.6875
----------------------------------------------------------------------------------------------------------------
Example 2:
Find the approximate value of the root of the equation 𝑥 2 − 2𝑥 − 1 = 0 using Bisection
method. Take 4 iterations up to 4 digits after the decimal.
Solution: Let 𝑓(𝑥) = 𝑥 2 − 2𝑥 − 1
𝑓(0) = −1 < 0,
𝑓(1) = −2 < 0,
𝑓(−1) = 2 > 0,
Since 𝑓(0) and 𝑓(−1) have opposite signs,

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 2
Unit VI – Numerical Methods
----------------------------------------------------------------------------------------------------------------
∴ 𝑓(0)𝑓(−1) < 0, 𝑎 = −1, 𝑏=0
𝑎+𝑏
𝑖 𝑎 𝑓(𝑎) 𝑏 𝑓(𝑏) 𝑐= 𝑓(𝑐) = 𝑐 2 − 2𝑐 − 1
2
−1 + 0
1 −1 2 0 −1 𝑐= = −0.5 𝑓(−0.5) = 0.25
2
−0.5 + 0 𝑓(−0.25)
2 −0.5 0.25 0 −1 𝑐= = −0.25
2 = −0.4375
−0.5 − 0.25
𝑓(−0.375)
3 −0.5 0.25 −0.25 −0.4375 𝑐 = 2 = −0.1094
= −0.375
−0.5 − 0.375
𝑐 = 𝑓(−0.4375)
4 −0.5 0.25 −0.375 −0.1094 2 = 0.0664
= −0.4375
After 4 iterations, using Bisection method, the approximate root of 𝑥 2 − 2𝑥 − 1 = 0 is
−0.4375.
Limitations of Bisection Method

1. Lengthy and tedious because of slow convergence.


2. If 𝑓(𝑥) just touches the 𝑥-axis but does not cross (for example: 𝑓(𝑥) = 𝑥 2 ) finding
𝑎 and 𝑏 is impossible.
1
3. The function changes sign, but the root does not exist, for example:𝑓(𝑥) = 𝑥
Summary
1. Find numbers 𝑎 and 𝑏 such that 𝑓(𝑎) and 𝑓(𝑏) have opposite signs.
𝑎+𝑏
2. Evaluate 𝑐 =
2
----------------------------------------------------------------------------------------------------------------
1.3.2 Regula-Falsi Method (False Position Method)
Steps:
1. Given 𝑓(𝑥) = 0, find, by trial and error, real numbers 𝑎 and 𝑏 such that 𝑓(𝑎)𝑓(𝑏) <
0, i.e., 𝑓(𝑎) and 𝑓(𝑏) should have opposite signs.
𝑎 𝑓(𝑏)−𝑏 𝑓(𝑎)
2. Evaluate 𝑐 = and hence find 𝑓(𝑐)
𝑓(𝑏)−𝑓(𝑎)
3. Case 1: if 𝑓(𝑎)𝑓(𝑐) < 0 then the root lies between 𝑎 and 𝑐. Therefore, replace 𝑏 with
𝑐 and repeat step 2
Case 2: if 𝑓(𝑏)𝑓(𝑐) < 0 then the root lies between 𝑏 and 𝑐. Therefore, replace 𝑎
with 𝑐 and repeat step 2
4. Repeat step 3 till 𝑓(𝑐) is as close to zero as possible.
----------------------------------------------------------------------------------------------------------------
Example 1:
Find the approximate value of the root of the equation 𝑥 3 − 2𝑥 2 = 5 using False
Position method. Take 4 iterations up to 4 digits after the decimal.
Solution:
Let 𝑓(𝑥) = 𝑥 3 − 2𝑥 2 − 5
𝑓(0) = −5 < 0,
𝑓(1) = −6 < 0,
𝑓(2) = −5 < 0,

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 3
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------
𝑓(3) = 4 > 0,
Since 𝑓(2) and 𝑓(3) have opposite signs,
∴ 𝑓(2)𝑓(3) < 0, 𝑎 = 2, 𝑏=3
𝑖 𝑎 𝑓(𝑎) 𝑏 𝑓(𝑏) 𝑎 𝑓(𝑏) − 𝑏 𝑓(𝑎) 𝑓(𝑐)
𝑐=
𝑓(𝑏) − 𝑓(𝑎)
1 2 −5 3 4 2(4) − 3(−5) 𝑓(2.5556)
𝑐= = 2.5556 = −1.3717
4 − (−5)
2 2.5556 −1.3717 3 4 2.5556(4) − 3(−1.3717) 𝑓(2.6691)
𝑐= = −0.2335
4− (−1.3717)
= 2.6691
3 2.6691 −0.2335 3 4 2.6691(4) − 3(−0.2335) 𝑓(2.6874)
𝑐= = −0.0361
4 − (−0.2335)
= 2.6874
4 2.6874 −0.0361 3 4 2.6874(4) − 3(−0.0361) 𝑓(2.6902)
𝑐= = −0.0049
4 − (−0.0361)
= 2.6902
After 4 iterations, using False Position method, the approximate root of 𝑥 3 − 2𝑥 2 = 5
is 2.6902
----------------------------------------------------------------------------------------------------------------
Example 2:
Find the approximate value of the root of the equation 𝑥 2 − 2𝑥 − 1 = 0 using Bisection
method. Take 4 iterations up to 4 digits after the decimal.
Solution: Let 𝑓(𝑥) = 𝑥 2 − 2𝑥 − 1
𝑓(0) = −1 < 0,
𝑓(1) = −2 < 0,
𝑓(−1) = 2 > 0,
Since 𝑓(0) and 𝑓(−1) have opposite signs,
∴ 𝑓(0)𝑓(−1) < 0, 𝑎 = −1, 𝑏=0

𝑖 𝑎 𝑓(𝑎) 𝑏 𝑓(𝑏) 𝑎 𝑓(𝑏) − 𝑏 𝑓(𝑎) 𝑓(𝑐)


𝑐=
𝑓(𝑏) − 𝑓(𝑎)
1 −1 2 0 −1 −1(−1) − 0(2) 1 1
𝑐= =− 𝑓 (− )
−1 − 2 3 3
= −0.2222
2 −1 2 −0.3333 −0.2222 𝑐 𝑓(−0.3999)
−1(−0.2222) − (−0.3333)(2) = −0.0401
=
−0.2222 − 2
𝑐 = −0.3999
3 −1 2 −0.3999 −0.0401 𝑐 𝑓(−0.4117)
−1(−0.0401) − (−0.3999)(2) = −0.0071
=
−0.0401 − 2
𝑐 = −0.4117
4 −1 2 −0.4117 −0.0071 𝑐 𝑓(−0.4138)
−1(−0.0071) − (−0.4117)(2) = −0.0012
=
−0.0071 − 2
𝑐 = −0.4138

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 4
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------
After 4 iterations, using False Position method, the approximate root of
𝑥 2 − 2𝑥 − 1 = 0 is −0.4138.
----------------------------------------------------------------------------------------------------------------
Limitations of Regula Falsi Method:

1. Lengthy and tedious because of slow convergence.


2. If 𝑓(𝑥) just touches the 𝑥-axis but does not cross (for example: 𝑓(𝑥) = 𝑥 2 ) finding
𝑎 and 𝑏 is impossible.
1
3. The function changes sign, but the root does not exist, for example:𝑓(𝑥) = 𝑥
4. More complicated than Bisection method.

1.3.3 Newton-Raphson Method:


Steps:
1. Given 𝑓(𝑥) = 0, evaluate 𝑓′(𝑥)
2. Guess an initial value 𝑥0 .
𝑓(𝑥 )
3. Compute iterations of the root using the formula 𝑥𝑛+1 = 𝑥𝑛 − 𝑓′ (𝑥𝑛 )
𝑛
------------------------------------------------------------------------------------------------------------
Example1:
Find the approximate value of the root of the equation 𝑥 3 − 2𝑥 2 = 5 using Newton-
Raphson method. Take 3 iterations up to 4 digits after the decimal.
Solution: 𝑓(𝑥) = 𝑥 3 − 2𝑥 2 − 5; 𝑓 ′ (𝑥) = 3𝑥 2 − 4𝑥
Let 𝑥0 = 3. (Try Yourself: use 𝑥0 = 2 and see the difference, if any)

𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑓′(𝑥𝑛 ) 𝑓(𝑥𝑛 )


𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥𝑛 )
0 𝑥0 = 3 4 15 4
𝑥1 = 3 − = 2.7333
15
1 𝑥1 0.4788 11.4800 0.4788
𝑥2 = 2.7333 − = 2.6916
= 2.7333 11.48
2 𝑥2 0.0107 10.9680 0.0107
𝑥3 = 2.6916 − = 2.6906
= 2.6916 10.9680
3 𝑥3 5 × 10−6 10.9561 𝑥4 = 2.6906
= 2.6906

After 3 iterations, using Newton-Raphson method, the approximate root of


𝑥 3 − 2𝑥 2 − 5 = 0 is 2.6906
----------------------------------------------------------------------------------------------------------------
Example 2:
Evaluate the 4th root of 40 using Newton Raphson method.

Solution:
1
Let 𝑥 = 404 ∴ 𝑥 4 = 40 ∴ 𝑥 4 − 40 = 0
Let 𝑓(𝑥) = 𝑥 4 − 40, 𝑓 ′ (𝑥) = 4𝑥 3

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 5
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------
Choose 𝑥0 = 2 (Try Yourself: choose 𝑥0 = 3 and see the difference, if any)
𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑓′(𝑥𝑛 ) 𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′
𝑓 (𝑥𝑛 )
0 𝑥0 = 2 −24 32 (−24)
𝑥1 = 2 − = 2.75
32
1 𝑥1 = 2.75 17.1914 83.1875 17.1914
𝑥2 = 2.75 − = 2.5433
83.1875
2 𝑥2 1.8426 65.8072 1.8426
𝑥3 = 2.5433 − = 2.5153
= 2.5433 65.8072
3 𝑥3 0.0302 63.6576 0.0302
𝑥4 = 2.5153 − = 2.5148
= 2.5153 63.6576
4 𝑥4 8 × 10−6 63.6216 𝑥5 = 2.5148
= 2.5148

After 4 iterations, using Newton-Raphson method, the approximate 4th root of 40 is


2.5148
----------------------------------------------------------------------------------------------------------------
Limitations of Newton Raphson Method:

1. If the function is not differentiable, the method fails.


2. Newton's method may not work if there are points of inflection, local maxima or
minima around 𝑥0 or the root.
----------------------------------------------------------------------------------------------------------------
1.4 Solution of simultaneous equations:
System of linear equations in 𝑛 unknown is represented as:

𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + ⋯ 𝑎1𝑛 𝑥𝑛 = 𝑏1


𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥2 + ⋯ 𝑎2𝑛 𝑥𝑛 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥1 + 𝑎33 𝑥1 + ⋯ 𝑎3𝑛 𝑥𝑛 = 𝑏3

𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥1 + 𝑎𝑛3 𝑥1 + ⋯ 𝑎𝑚𝑛 𝑥𝑛 = 𝑏𝑛
In matrix form, we have 𝐴𝑋 = 𝐵, where

𝑥1 , 𝑥2 , ⋯ 𝑥𝑛 are variables whose values have to be found. The system of linear


equations has unique solution if |𝐴| ≠ 0.
--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 6
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------

There are two methods to obtain the solution of system of linear equations:

• Direct method: These methods use elimination of variables. They transform the
system of equations to triangular form. Methods are Cramer’s method, Matrix
inversion method, Gauss elimination method.
• Iterative method: These methods use principles of successive approximation. The
iterations are repeated till the required accuracy is obtained. Methods are Jacobi’s
iteration method, Gauss Seidal method.

In this unit, the solution of three equations in three unknowns will be computed.
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 𝑏1
𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 𝑏2
𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 𝑏3

1.4.1 Gauss Elimination Method:

Steps:
𝑎11 𝑎12 𝑎13 𝑏1
1. Construct the Augumented matrix [𝐴, 𝐵] = [𝑎21 𝑎22 𝑎23 |𝑏2 ]
𝑎31 𝑎32 𝑎33 𝑏3
2. Use row transformations to make 𝑎11 = 1.
3. Use 𝑅1 to make 𝑎21 = 0, 𝑎31 = 0.
4. Use 𝑅2 to make 𝑎32 = 0
----------------------------------------------------------------------------------------------------------------
Example 1:
Determine the solution using Gauss-Elimination Method:
3𝑥 − 2𝑦 + 2𝑧 = 9
𝑥 − 2𝑦 + 𝑧 = 5
2𝑥 − 𝑦 − 2𝑧 = −1
Solution:
3 −2 2 9
[𝐴, 𝐵] = [1 −2 1 | 5 ]
2 −1 −2 −1
𝑅1 ↔ 𝑅2
1 −2 1 5
[𝐴, 𝐵]~ [3 −2 2 | 9 ]
2 −1 −2 −1
𝑅2 → 𝑅2 − 3𝑅1 , 𝑅3 → 𝑅3 − 2𝑅1
1 −2 1 5
[𝐴, 𝐵]~ [0 4 −1 | −6 ]
0 3 −4 −11
3
𝑅3 → 𝑅3 − 𝑅2
4
1 −2 1 5
0 4 −1 −6
[𝐴, 𝐵]~ [ 13 | 13]
0 0 − −
4 2
--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 7
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------
13 13
𝑅3 gives, 0𝑥 + 0𝑦 − 𝑧=− ∴𝑧=2
4 2
𝑅2 gives 0𝑥 + 4𝑦 − 𝑧 = −6 ∴ 𝑦 = −1
𝑅1 gives 𝑥 − 2𝑦 + 𝑧 = 5 ∴𝑥=1
----------------------------------------------------------------------------------------------------------------
Example 2:
Determine the solution using Gauss-Elimination Method:
𝑥 + 2𝑦 − 𝑧 = 1
2𝑥 + 5𝑦 − 𝑧 = 3
𝑥 + 3𝑦 + 2𝑧 = 6

Solution:
1 2 −1 1
[𝐴, 𝐵] = [2 5 −1 |3]
1 3 2 6
𝑅2 → 𝑅2 − 2𝑅1 , 𝑅3 → 𝑅3 − 𝑅1
1 2 −1 1
[𝐴, 𝐵]~ [0 1 1 |1]
0 1 3 5
𝑅3 → 𝑅3 − 𝑅2
1 2 −1 1
[𝐴, 𝐵]~ [0 1 1 |1]
0 0 2 4
𝑅3 gives, 0𝑥 + 0𝑦 + 2𝑧 = 4 ∴𝑧=2
𝑅2 gives 0𝑥 + 𝑦 + 𝑧 = 1 ∴ 𝑦 = −1
𝑅1 gives 𝑥 + 2𝑦 − 𝑧 = 5 ∴𝑥=5
----------------------------------------------------------------------------------------------------------------
1.4.2 Gauss Jacobi Method
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 𝑏1
𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 𝑏2
𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 𝑏3
The equations above are such that
|𝑎11 | ≥ |𝑎12 | + |𝑎13 |, |𝑎22 | ≥ |𝑎21 | + |𝑎23 |, |𝑎33 | ≥ |𝑎31 | + |𝑎32 |
Isolating 𝑥, 𝑦, 𝑧 from the equations,
1
𝑥𝑛+1 = (𝑏 − 𝑎12 𝑦𝑛 − 𝑎13 𝑧𝑛 )
𝑎11 1
1
𝑦𝑛+1 = (𝑏 − 𝑎21 𝑥𝑛 − 𝑎23 𝑧𝑛 )
𝑎22 2
1
𝑧𝑛+1 = (𝑏 − 𝑎31 𝑥𝑛 − 𝑎32 𝑦𝑛 )
𝑎33 3
Evaluate iterations taking 𝑥0 = 0, 𝑦0 = 0, 𝑧0 = 0

Example 1:
Determine the solution using Gauss Jacobi method
5𝑥 − 2𝑦 + 3𝑧 = −1
−3𝑥 + 9𝑦 + 𝑧 = 2

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 8
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------

2𝑥 − 𝑦 − 7𝑧 = 3
Solution: Isolating 𝑥, 𝑦, 𝑧
1
𝑥𝑛+1 = (−1 + 2𝑦𝑛 − 3𝑧𝑛 )
5
1
𝑦𝑛+1 = (2 + 3𝑥𝑛 − 𝑧𝑛 )
9
1
𝑧𝑛+1 = (3 − 2𝑥𝑛 + 𝑦𝑛 )
−7

𝑛 𝑥𝑛 𝑦𝑛 𝑧𝑛

0 𝑥0 = 0 𝑦0 = 0 𝑧0 = 0
1 𝑥1 = −0.2 𝑦1 = 0.2222 𝑧1 = −0.4285
2 𝑥2 = 0.1460 𝑦2 = 0.2031 𝑧2 = −0.5174
3 𝑥3 = 0.1917 𝑦3 = 0.3283 𝑧3 = −0.4158
4 𝑥4 = 0.1808 𝑦4 = 0.3323 𝑧4 = −0.4207
After 4 iterations the approximate values are 𝑥 = 0.1808, 𝑦 = 0.3323, 𝑧 = −0.4207
----------------------------------------------------------------------------------------------------------------
Example 2:
Determine the solution using Gauss Jacobi method
9𝑥 + 2𝑦 + 4𝑧 = 20
𝑥 + 10𝑦 + 4𝑧 = 6
2𝑥 − 4𝑦 + 10𝑧 = −15
Solution:
Isolating 𝑥, 𝑦, 𝑧
1
𝑥𝑛+1 = (20 − 2𝑦𝑛 − 4𝑧𝑛 )
9
1
𝑦𝑛+1 = (6 − 𝑥𝑛 − 4𝑧𝑛 )
10
1
𝑧𝑛+1 = (−15 − 2𝑥𝑛 + 4𝑦𝑛 )
10

𝑛 𝑥𝑛 𝑦𝑛 𝑧𝑛

0 𝑥0 = 0 𝑦0 = 0 𝑧0 = 0
1 𝑥1 = 2.2222 𝑦1 = 0.6 𝑧1 = −1.5
2 𝑥2 = 2.7555 𝑦2 = 0.9777 𝑧2 = −1.7044
3 𝑥3 = 2.7624 𝑦3 = 1.0062 𝑧3 = −1.66
4 𝑥4 = 2.7363 𝑦4 = 0.9877 𝑧4 = −1.6500
After 4 iterations the approximate values are 𝑥 = 2.7363, 𝑦 = 0.9877, 𝑧 = −1.6500
1.4.3 Gauss Seidel Method
Consider the following system of equations:
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 𝑏1
𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 𝑏2
𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 𝑏3
--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 9
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------

The equations above are such that


|𝑎11 | ≥ |𝑎12 | + |𝑎13 |, |𝑎22 | ≥ |𝑎21 | + |𝑎23 |, |𝑎33 | ≥ |𝑎31 | + |𝑎32 |
Isolating 𝑥, 𝑦, 𝑧 from the equations,
1
𝑥𝑛+1 = (𝑏 − 𝑎12 𝑦𝑛 − 𝑎13 𝑧𝑛 )
𝑎11 1
1
𝑦𝑛+1 = (𝑏 − 𝑎21 𝑥𝑛+1 − 𝑎23 𝑧𝑛 )
𝑎22 2
1
𝑧𝑛+1 = (𝑏 − 𝑎31 𝑥𝑛+1 − 𝑎32 𝑦𝑛+1 )
𝑎33 3
Evaluate iterations taking 𝑥0 = 0, 𝑦0 = 0, 𝑧0 = 0
----------------------------------------------------------------------------------------------------------------
Example 1:
Determine the solution using Gauss Seidel method
5𝑥 − 2𝑦 + 3𝑧 = −1
−3𝑥 + 9𝑦 + 𝑧 = 2
2𝑥 − 𝑦 − 7𝑧 = 3
Solution: Isolating 𝑥, 𝑦, 𝑧
1
𝑥𝑛+1 = (−1 + 2𝑦𝑛 − 3𝑧𝑛 )
5
1
𝑦𝑛+1 = (2 + 3𝑥𝑛+1 − 𝑧𝑛 )
9
1
𝑧𝑛+1 = (3 − 2𝑥𝑛+1 + 𝑦𝑛+1 )
−7

𝑛 𝑥𝑛 𝑦𝑛 𝑧𝑛

0 𝑥0 = 0 𝑦0 = 0 𝑧0 = 0
1 𝑥1 = −0.2 𝑦1 = 0.1555 𝑧1 = −0.5079
2 𝑥2 = 0.1669 𝑦2 = 0.3343 𝑧2 = −0.4286
3 𝑥3 = 0.1909 𝑦3 = 0.3334 𝑧3 = −0.4216
4 𝑥4 = 0.1863 𝑦4 = 0.3312 𝑧4 = −0.4226
After 4 iterations the approximate values are 𝑥 = 0.1863, 𝑦 = 0.3312, 𝑧 = −0.4226
----------------------------------------------------------------------------------------------------------------
Example 2:
Determine the solution using Gauss Jacobi method
9𝑥 + 2𝑦 + 4𝑧 = 20
𝑥 + 10𝑦 + 4𝑧 = 6
2𝑥 − 4𝑦 + 10𝑧 = −15
Solution:
Isolating 𝑥, 𝑦, 𝑧
1
𝑥𝑛+1 = (20 − 2𝑦𝑛 − 4𝑧𝑛 )
9
1
𝑦𝑛+1 = (6 − 𝑥𝑛+1 − 4𝑧𝑛 )
10

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 10
Unit VI – Numerical Methods
--------------------------------------------------------------------------------------------------------------------------------------

1
𝑧𝑛+1 = (−15 − 2𝑥𝑛+1 + 4𝑦𝑛+1 )
10

𝑛 𝑥𝑛 𝑦𝑛 𝑧𝑛

0 𝑥0 = 0 𝑦0 = 0 𝑧0 = 0
1 𝑥1 = 2.2222 𝑦1 = 0.3777 𝑧1 = −1.7933
2 𝑥2 = 2.9353 𝑦2 = 1.0238 𝑧2 = −1.6775
3 𝑥3 = 2.7402 𝑦3 = 0.9969 𝑧3 = −1.6492
4 𝑥4 = 2.7336 𝑦4 = 0.9863 𝑧4 = −1.6522
After 4 iterations the approximate values are 𝑥 = 2.7336, 𝑦 = 0.9863, 𝑧 = −1.6522

--------------------------------------------------------------------------------------------------------------------
B. Tech. Integrated (All branches) / 2nd Year Semester-IV / 2022-23 / Page 11

You might also like