Preview

Solution of Linear Equations by Gaussian Elimination and Back-Substitution

Satisfactory Essays
Open Document
Open Document
316 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Solution of Linear Equations by Gaussian Elimination and Back-Substitution
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:=<<4 | 2 | 3 | 2> , <8 | 3 | -4 | 7> , <4 | -6 | 2 | -5>>;
> b:=<<15, 7, 6>>;

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 <A|b>
> Ab:=<A|b>;
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
>

You May Also Find These Documents Helpful

Related Topics