Question: Please have a look on my idea for solving a linear system of equations using the gauss-jordan-method.

Hi,

I'm a beginner in programing with Maple.

Maple has an algorithm "LinearSolve". 

I'm trying - just for fun - to generate an algorithm to solve a linear system of equations according to the Gauss-Jordan-method.

The linear System is given by:

M1*x=b

(in the worksheet: M1 is a matrix, point (1)

b is a vector, point (2) and x is a vector too and is the solution of system, point (3)).

Point (3) is to check - after the generated algorithm points out the solution - if the algorthm is working fine.

The augmented matrix M2 is given by <M1|b>, point (4).

First, I want to generate zeros under the main diagonal of matrix M1 in the augmented matrix M2.

In the worksheet there is my idea to do this, but I get a (perhaps simple) error message ("Error, Invalid if statement termination"). But I don't know what I'm doing wrong...

Perhaps someone can have a look on my idea (link to the file) and give me a hint?

Thanks a lot for your help!!

LGS_Gauss-Jordan.mw

Please Wait...