# ଗସ୍ - ସିଡ଼ାଲ୍ ପଦ୍ଧତି

## ବ୍ୟାଖ୍ୟା

ଗସ-ସିଡ଼ାଲ ପଦ୍ଧତି ହୋଇଛି ଏକ iterative technique ଏବଂ ଏହା ଅଜଣା x ଥିବା n ଗୋଟି linear equation ବିଶିଷ୍ଟ ଗୋଟିଏ square systemକୁ ସମାଧାନ କରିବାରେ ବ୍ୟବହାର କରାଯାଏ:

${\displaystyle A\mathbf {x} =\mathbf {b} }$.

iterationଦ୍ୱାରା ନିମ୍ନ ମତେ ଏହାର ସଂଜ୍ଞା ପ୍ରକରଣ କରାଯାଇପାରେ

ଏବଂ  ${\displaystyle \mathbf {x} ^{(k)}}$ is the kth approximation or iteration of ${\displaystyle \mathbf {x} ,\,\mathbf {x} ^{k+1}}$ is the next or k + 1 iteration of ${\displaystyle \mathbf {x} }$, and the matrix A is decomposed into a lower triangular component ${\displaystyle L_{*}}$, and a strictly upper triangular component U: ${\displaystyle A=L_{*}+U}$.[୧]

## ଆଲ୍‌ଗୋରିଦିମ୍

Inputs: A, A
Output: ${\displaystyle \phi }$

Choose an initial guess ${\displaystyle \phi }$ to the solution
repeat until convergence
for A from 1 until A do
${\displaystyle \sigma \leftarrow 0}$
for A from 1 until A do
if A ≠ A then
${\displaystyle \sigma \leftarrow \sigma +a_{ij}\phi _{j}}$
end if
end (A-loop)
${\displaystyle \phi _{i}\leftarrow {\frac {1}{a_{ii}}}(b_{i}-\sigma )}$
end (A-loop)
check if convergence is reached
end (repeat)


## ଉଦାହରଣ

### ମାଟ୍ରିକ୍ସ ସଂସ୍କରଣ ପାଇଁ ଗୋଟିଏ ଉଦାହରଣ

${\displaystyle A\mathbf {x} =\mathbf {b} }$ ଭାବେ ଗୋଟିଏ linear system ଦର୍ଶଯାଇଛି, ଯଥା:

${\displaystyle A={\begin{bmatrix}16&3\\7&-11\\\end{bmatrix}}}$ ଏବଂ ${\displaystyle b={\begin{bmatrix}11\\13\end{bmatrix}}.}$

ଆମେ ନିମ୍ନୋକ୍ତ ସମୀକରଣ

କୁ ନିମ୍ନୋକ୍ତ ରୂପେ ବ୍ୟବହାର କରିବାକୁ ଚାହୁଁ

ଯେଉଁଠାରେ କି:

${\displaystyle T=-L_{*}^{-1}U}$ ଏବଂ ${\displaystyle C=L_{*}^{-1}\mathbf {b} .}$

### ପାଇଥନ ୩ ଏବଂ NumPy ବ୍ୟବହାର କରାଯାଇଥିବା ଏକ ଉଦାହରଣ

The following numerical procedure simply iterates to produce the solution vector.

import numpy as np

ITERATION_LIMIT = 1000

# initialize the matrix
A = np.array([[10., -1., 2., 0.],
[-1., 11., -1., 3.],
[2., -1., 10., -1.],
[0.0, 3., -1., 8.]])
# initialize the RHS vector
b = np.array([6., 25., -11., 15.])

# prints the system
print("System:")
for i in range(A.shape[0]):
row = ["{}*x{}".format(A[i, j], j + 1) for j in range(A.shape[1])]
print(" + ".join(row), "=", b[i])
print()

x = np.zeros_like(b)
for it_count in range(ITERATION_LIMIT):
print("Current solution:", x)
x_new = np.zeros_like(x)

for i in range(A.shape[0]):
s1 = np.dot(A[i, :i], x_new[:i])
s2 = np.dot(A[i, i + 1:], x[i + 1:])
x_new[i] = (b[i] - s1 - s2) / A[i, i]

if np.allclose(x, x_new, rtol=1e-8):
break

x = x_new

print("Solution:")
print(x)
error = np.dot(A, x) - b
print("Error:")
print(error)


ଏହାର output ଆସିବ:

System:
10.0*x1 + -1.0*x2 + 2.0*x3 + 0.0*x4 = 6.0
-1.0*x1 + 11.0*x2 + -1.0*x3 + 3.0*x4 = 25.0
2.0*x1 + -1.0*x2 + 10.0*x3 + -1.0*x4 = -11.0
0.0*x1 + 3.0*x2 + -1.0*x3 + 8.0*x4 = 15.0

Current solution: [ 0.  0.  0.  0.]
Current solution: [ 0.6         2.32727273 -0.98727273  0.87886364]
Current solution: [ 1.03018182  2.03693802 -1.0144562   0.98434122]
Current solution: [ 1.00658504  2.00355502 -1.00252738  0.99835095]
Current solution: [ 1.00086098  2.00029825 -1.00030728  0.99984975]
Current solution: [ 1.00009128  2.00002134 -1.00003115  0.9999881 ]
Current solution: [ 1.00000836  2.00000117 -1.00000275  0.99999922]
Current solution: [ 1.00000067  2.00000002 -1.00000021  0.99999996]
Current solution: [ 1.00000004  1.99999999 -1.00000001  1.        ]
Current solution: [ 1.  2. -1.  1.]
Solution:
[ 1.  2. -1.  1.]
Error:
[  2.06480930e-08  -1.25551054e-08   3.61417563e-11   0.00000000e+00]


### Program to solve arbitrary no. of equations using Matlab

The following code uses the formula

${\displaystyle x_{i}^{(k+1)}={\frac {1}{a_{ii}}}\left(b_{i}-\sum _{ji}a_{ij}x_{j}^{(k)}\right),\quad i,j=1,2,\ldots ,n}$

function [x] = gauss_seidel(A, b, x0, iters)
n = length(A);
x = x0;
for k = 1:iters
for i = 1:n
x(i) = (1/A(i, i))*(b(i) - A(i, 1:n)*x + A(i, i)*x(i));
end
end
end


## ଆହୁରି ଦେଖନ୍ତୁ

• Jacobi method
• Successive over-relaxation
• Iterative method. Linear systems
• Gaussian belief propagation
• Matrix splitting
• Richardson iteration

## ଟୀକା

1. Gauss 1903, p. 279.

## ଆଧାର

• Gauss, Carl Friedrich (1903), Werke (in German), 9, Göttingen: Köninglichen Gesellschaft der WissenschaftenCS1 maint: unrecognized language (link).
• Gauss, Carl Friedrich (1903), Werke (in German), 9, Göttingen: Köninglichen Gesellschaft der WissenschaftenCS1 maint: unrecognized language (link).
• Gauss, Carl Friedrich (1903), Werke (in German), 9, Göttingen: Köninglichen Gesellschaft der WissenschaftenCS1 maint: unrecognized language (link)