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

Lab report

The document discusses three methods for solving simultaneous linear equations: Gaussian elimination, Jacobi method, and Gauss-Seidel method. Gaussian elimination involves forward elimination and back substitution, while the Jacobi method iteratively approximates solutions assuming a unique solution exists. The Gauss-Seidel method improves upon Jacobi by using updated values immediately in subsequent calculations.

Uploaded by

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

Lab report

The document discusses three methods for solving simultaneous linear equations: Gaussian elimination, Jacobi method, and Gauss-Seidel method. Gaussian elimination involves forward elimination and back substitution, while the Jacobi method iteratively approximates solutions assuming a unique solution exists. The Gauss-Seidel method improves upon Jacobi by using updated values immediately in subsequent calculations.

Uploaded by

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

COMPUTATIONAL

PHYSICS LAB REPORT


Thasleena N. 2300605030
NAIVE GAUSSIAN ELIMINATION
One of the most popular techniques for solving simultaneous linear equations is the
Gaussian elimination method. The approach is designed to solve a general set
of 𝑛 equations and 𝑛 unknowns.
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
…………………………………………………
…………………………………………………
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + 𝑎𝑛3 𝑥3 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛

Gaussian elimination consists of two steps

1. Forward Elimination of Unknowns: In this step, the unknown is eliminated


in each equation starting with the first equation. This way, the equations
are reduced to one equation and one unknown in each equation.
The basic forward elimination procedure using equation 𝑘 to operate on
equations 𝑘 + 1, 𝑘 + 2, . . . , 𝑛 is

𝑎𝑖𝑘
𝑎𝑖𝑗 ← 𝑎𝑖𝑗 − ( )𝑎 (𝑘 ! 𝑗 ! 𝑛, 𝑘 < 𝑖 ! 𝑛)
𝑎𝑘𝑘 𝑘𝑗
𝑎𝑖𝑘
𝑏𝑖 ← 𝑏𝑖 − ( ) 𝑏𝑘
𝑎𝑘𝑘

2. Back Substitution: In this step, starting from the last equation, each of the
unknowns is found.
Here we assume 𝑎𝑘𝑘 ≠ 0.
𝑛

𝑥𝑖 = 1/𝑎𝑖 (𝑏𝑖 − ∑ 𝑎𝑖𝑗 𝑥𝑗 ) (𝑖 = 𝑛 − 1, 𝑛 − 2, … ,1)


𝑗=𝑖+1
JACOBI METHOD
The Jacobi iterative method is considered as an iterative algorithm which is used for
determining the solutions for the system of linear equations in numerical linear
algebra which is diagonally dominant. In this method, an approximate value is filled in
for each diagonal element.
The two assumptions made on Jacobi method:
1. The system given by
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
…………………………………………………
…………………………………………………
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + 𝑎𝑛3 𝑥3 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
Has a unique solution.
2. The coefficient matrix 𝐴 has no zeros on its main diagonal, namely,
𝑎11 , 𝑎22 , … . . , 𝑎𝑛𝑛 are nonzeroes.
Jacobi’s method consists of repeating this calculation of next sets of values of 𝑥 using
the previous steps, until convergence occurred.
𝑛
𝑎𝑖𝑗 𝑏𝑖
𝑥𝑖𝑘 = − ∑ ( ) 𝑥𝑗𝑘−1 + (1 ≤ 𝑖 ≤ 𝑛 )
𝑎𝑖𝑖 𝑎𝑖𝑖
𝑗=1
𝑗≠𝑖
GAUSS-SEIDEL METHOD
(𝑘)
With the Jacobi method, the values of 𝑥𝑖 obtained in the 𝑘 th iteration remain
unchanged until the entire (𝑘 + 1) th iteration has been calculated. With the Gauss-
(𝑘+1)
Seidel method, we use the new values 𝑥𝑖 as soon as they are known. For
(𝑘+1)
example, once we have computed 𝑥1 from the first equation, its value is then
(𝑘+1)
used in the second equation to obtain the new 𝑥2 and so on.
𝑛 𝑛
(𝑘) 𝑎𝑖𝑗 (𝑘) 𝑎𝑖𝑗 (𝑘−1) 𝑏𝑖
𝑥𝑖 = − ∑ ( ) 𝑥𝑗 − ∑ ( ) 𝑥𝑗 +
𝑎𝑖𝑖 𝑎𝑖𝑖 𝑎𝑖𝑖
𝑗=1 𝑗=1
𝑗<𝑖 𝑗>𝑖

You might also like