Solving a System of Three Linear Equations (Gaussian Elimination)
What Is Gaussian Elimination?
Gaussian elimination is a typical algorithm for solving systems of linear equations. It finds the unknowns while transforming the coefficient matrix. It is widely used in numerical computation, control engineering, simulation and more.
Solves a system of three linear equations by Gaussian elimination.
Gaussian elimination consists of forward elimination and back substitution
Forward elimination
Using the first equation as a reference, the x component is eliminated from the other equations. Then the y component is eliminated to create an upper triangular matrix.
Back substitution
z is found from the last equation, and that value is used to find y and then x.
gauss
| --- Input --- | |
| In | Input values [x,y,z,a],[x,y,z,a],[x,y,z,a] |
| --- Output --- | |
| out | Solution [x,y,z] |
Example
\begin{align}
3x + 6y + 2z &= 32 \\
x + 2y + 8z &= 40 \\
7x + 3y + 2z &= 35
\end{align}
To solve the system of equations above
set the values in the function's IN (input values) as follows
\(3x + 6y + 2z = 32\) → [3, 6, 2, 32]
\(x + 2y + 8z = 40\) → [1, 2, 8, 40]
\(7x + 3y + 2z = 35\) → [7, 3, 2, 35]
Result
| [x, y, z] | [2, 3, 4] |
