LEARNING HOW TO USE AUTOMATED FUNCTIONS
Gauss Elimination
The purpose of this Maple worksheet is to show how to use the automated function
gausselim. There are three modes of the gausselim function: demonstration, interactive
and nostep modes.
> with(linalg) : with(linsys);
Demonstration Mode
The purpose of this version is to display the steps necessary to perform the Gauss elimination
on a given matrix. The user only needs to press the enter key to proceed. Let us look at the
following example. Press Enter at the Maple prompt > to proceed.
> A := matrix ([[1,2,3,4],[9,3,4,1],[2,1,4,5]]);
> gausselim(A);
1. Demonstration mode
2. Interactive mode
3. No Intermediate steps. Just give me the answer
<Select from 1; 2; or 3; >
1;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
Or you may call the function without its argument. As soon as you call the function the program will ask
you to input the matrix A.
> gausselim();
Please enter a matrix to find its row echelon form
A := matrix ([[1,2,3],[0,1,3],[3,1,3]]);
1. Demonstration mode
2. Interactive mode
3. No Intermediate steps. Just give me the answer
<Select from 1; 2; or 3; >
1;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
< type ; and press Enter to continue ?topic for help exit; to quit >
;
Try your own examples by entering a new matrix A.
Interactive Mode
The purpose of this version is to check whether the user knows how to perform Gauss
elimination on a given matrix. The user must select all row operations (based on a menu)
to perform the Gauss Elimination.Given below is an example in which we have already
entered the inputs that the user is expected to enter while working with this interactive
version of the Gauss Elimination. You may press enter to continue OR select your
own row operations at each level. At any level you may exit the program by typing at
the Maple prompt sign > exit;
> A:=matrix([[28,4,16],[9,1,5],[1,1,1]]);
> gausselim(A);
1. Demonstration mode
2. Interactive mode
3. No Intermediate steps. Just give me the answer
<Select from 1; 2; or 3; >
2;
OPERATION SELECTION MENU
1. Multiply row i by c and add it to row j type:
Rj=Ri*c+Rj or Rj=c*Ri+Rj;
2. Interchange row i and row j type :
Ri<>Rj ; or Ri=Rj
3. Multiply a row i by constant c type:
Ri=c*Ri or Ri=Ri*c;
4. To correct a wrong selction type:
undo;
5. To end selections type : exit;
6. To see the row echelon form of the matrix type : rowec;
At each step, please enter a row operation in the same format
as in the menu
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R1=R1*(1/28);
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R2=r1*(-8) + R2;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
undo;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R2=r1*(-9) + R2;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R1 = r2;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
r1 = r2;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R3 = (-1)*R1 + R3;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R2 = (-7/2)*R2;
<enter operations as Ri <> Rj or Ri = c*Rj + Ri or Ri = c*Ri >
R3 = (-6/7)*R2 + R3;
You may change the matrix in the above example and select your own operations.
Be sure to delete the previous set of operations first.
Nostep Mode
This mode is equivalent to the Maple gausselim function. Only the final row echelon form
is given. Just press enter to see how it works.
> A := matrix ([[1,2,3,4],[9,3,4,1],[0,1,2,4],[4,5,0,4]]);
> gausselim(A);
1. Demonstration mode
2. Interactive mode
3. No Intermediate steps. Just give me the answer
<Select from 1; 2; or 3; >
3;
Try your own examples by entering a new matrix A.
To return to main menu, move the cursor to next line and press < enter >
> quit;