# Solution of Linear Equations by Gaussian Elimination and Back-Substitution

Only available on StudyMode
• Topic: Matrix, Numerical linear algebra, Linear algebra
• Pages : 2 (316 words )
• Published : April 28, 2008

Text Preview
Initialise
Clear the workspace and load Linear Algebra package
> restart;
> with(LinearAlgebra):
If you want practice at hand calculation you should use the worksheet "Interactive Gaussian Elimination" (see Menu) Enter the matrix of coefficients and right-hand side vector You may edit the following statements or use the matrix and vector pallettes to enter new data ( see View, Palettes) > A:=; > b:=;

Form the augmented matrix and solve
The Maple routine GaussianElimination requires the augmented matrix A|b as input. In this worksheet this matrix is called Ab and is formed using > Ab:=;
The row echelon form H|c (here called Hc) of Ab is computed by GaussianElimination. (For a square system of equations the row echelon form of A is upper triangular ) Note that the Maple function GaussianElimination performs a systematic version of the idea of elementary row operations: (i) Multiples of R1 are subtracted from R2, R3 . . Rn to reduce the elements below the leading diagonal in the first column to zero. (ii) In the resulting system multiples of R2 are subtracted from R3, R4 . . Rn to reduce the elements below the leading diagonal in the second column to zero. (iii) This process is continued to produce a system in row echelon form, using essential row interchanges where necessary. > Hc:=GaussianElimination(Ab);

Look at the form of H|c before executing the next statement. Is there a unique solution, infinitely many solutions or no solution ? The solution vector, x, is found from H|c using BackwardSubstitute x:=BackwardSubstitute(Hc);

Maple techniques: Accessing vector components and matrix elements and checking that Ax = b The components of x are x[1], x[2] ....:
> x[1];
> x[2];

The elements of A are A[i,j], for example:
A[2,1];

Check that Ax = b
> A.x=b;