GAUSS ELIMINATION METHOD:EXPLANATION,ALGORITHM AND FLOWCHART
Gauss elimination method
Gauss Elimination method can be adopted to find the solution of linear simultaneous equations arising in engineering problems. In the method, equations are solved by elimination procedure of the unknowns successively.
The method overall reduces the system of linear simultaneous equations to an upper triangular matrix. Then backward substitution is used to derive the unknowns. This is the key concept in writing an algorithm or program, or drawing a flowchart for Gauss Elimination.
Partial pivoting or complete pivoting can be adopted in Gauss Elimination method. So, this method is considered superior to the Gauss Jordan method.
In the Gauss Elimination method algorithm and flowchart given below, the elimination process is carried out until only one unknown remains in the last equation. It is straightforward to program, and partial pivoting can be used to control rounding errors.
Gauss Elimination Algorithm:
- Start
- Declare the variables and read the order of the matrix n.
- Take the coefficients of the linear equation as:
Do for k=1 to n
Do for j=1 to n+1
Read a[k][j]
End for j
End for k - Do for k=1 to n-1
Do for i=k+1 to n
Do for j=k+1 to n+1
a[i][j] = a[i][j] – a[i][k] /a[k][k] * a[k][j]
End for j
End for i
End for k - Compute x[n] = a[n][n+1]/a[n][n]
- Do for k=n-1 to 1
sum = 0
Do for j=k+1 to n
sum = sum + a[k][j] * x[j]
End for j
x[k] = 1/a[k][k] * (a[k][n+1] – sum)
End for k - Display the result x[k]
- Stop
Comments
Post a Comment