Numerical Analysis
Numerical Analysis
𝐵1 𝐵2 𝐵3
𝑥1 = = −3, 𝑥2 = = −5, 𝑥3 = = −8
𝐴 𝐴 𝐴
Note: Cramer’s Rule is valid only when the system is square system (i.e., a system in
which the number of equations is equal to the number of variables) and for systems
2 1 1 𝑥 5
3 5 2 𝑦 = 15
2 1 4 𝑧 8
2 1 1 𝑥 5
● Now, 𝐴 = 3 5 2 , 𝑋 = 𝑦 and 𝑏 = 15
2 1 4 𝑧 8
𝐴𝑋 = 𝑏 ∴ 𝑋 = 𝐴−1 𝑏
05/01/2024 Prepared by Zerihun Mekoya 12
Solution
●●●
2 1 1
5 2 3 2 3 5
● det(𝐴) = 3 5 2 =2 −1 +1
1 4 2 4 2 1
2 1 4
= 2 × (5 × 4 − 2 × 1) − 1 × (3 × 4 − 2 × 2) + 1 × (3 × 1
− 5 × 2) = 2 × (20 − 2) − 1 × (12 − 4) + 1 × (3 − 10)
= 2 × 18 − 1 × 8 + 1 × −7 = 36 − 8 − 7 = 21
Step 3: Form new system using 𝑈𝑋 = 𝑐 and solve by back substitution method.
05/01/2024 Prepared by Zerihun Mekoya 19
Gaussian Elimination Method
Example 1
●●●
● Solve the system of equations by using Gaussian
elimination method
2𝑥 + 3𝑦 + 𝑧 = −1
3𝑥 + 3𝑦 + 𝑧 = 1
2𝑥 + 4𝑦 + 𝑧 = −2
.
2𝑥1 + 𝑥2 + 𝑥3 = 5
3𝑥1 + 5𝑥2 + 2𝑥3 = 15
2𝑥1 + 𝑥2 + 4𝑥3 = 8
●●●
Iterative methods (Self-correcting methods) are which begin with
step of iteration.
Let us consider the system of equations
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1 (1)
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2 (2)
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3 (3)
Let the coefficient matrix be diagonally dominant and solve for 𝑥1 ,
𝑥2 and 𝑥3 from Equations (1), (2) and (3) respectively, we get
●●●
1
𝑥1 = (𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3 )
𝑎11
1
𝑥2 = (𝑏2 − 𝑎21 𝑥1 − 𝑎23 𝑥3 ) (4)
𝑎22
1
𝑥3 = (𝑏3 − 𝑎31 𝑥1 − 𝑎32 𝑥2 )
𝑎33
Correct to two decimal places and start with the solution (0, 0, 0).
𝑓 𝑥, 𝑦 = 0
(1)
𝑔 𝑥, 𝑦 = 0
𝜕𝑓 𝜕𝑓
−𝑓0 −𝑓0
1 𝜕𝑦0 1 𝜕𝑥0
= 𝜕𝑔
and 𝑘 = (5)
𝐷 𝐷 𝜕𝑔
−𝑔0 −𝑔0
𝜕𝑦0 𝜕𝑥0
● 𝒙𝟏 = 𝒙𝟎 + 𝒉 and 𝒚𝟏 = 𝒚𝟎 + 𝒌
The process is to be repeated till we obtain the roots to the desired accuracy. This
is the same as saying
where
𝜕𝑓 𝜕𝑓 𝜕𝑓 𝜕𝑓
−𝑓𝑖 −𝑓𝑖
1 𝜕𝑦𝑖 1 𝜕𝑥𝑖 𝜕𝑥𝑖 𝜕𝑦𝑖
= ,𝑘 = ,𝐷 =
𝐷 𝜕𝑔 𝐷 𝜕𝑔 𝜕𝑔 𝜕𝑔
−𝑔𝑖 −𝑔𝑖
𝜕𝑦𝑖 𝜕𝑥𝑖 𝜕𝑥𝑖 𝜕𝑦𝑖
● This method of solving systems of nonlinear equations can also be
generalized (extended) for solving a system of 𝑛 equations into 𝑛 unknowns.
● = 34 −2.375 0.75
1 1 −8.5 −2.375
= 0.3180, and 𝑘 = = 0.4375.
−1.75 −4 34 0 −1.75
It follows that
𝑥1 = 0.5 + 0.3180 = 0.8180
and
𝑦1 = 0.5 + 0.4375 = 0.9375
1 −5.3988 −0.7019
𝑘= = 0.0612.
16.8712 0 −0.1914
It follows that 𝑥2 = 0.8180 + 0.1528 = 0.9708 and
𝑦2 = 0.9375 + 0.0612 = 0.9987