cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Gauss Jordan rref

AlvaroDíaz
12-Amethyst

Gauss Jordan rref

Or the echelon form. Starting a new topic, but from Cramer's rule post.

Regards.
18 REPLIES 18
lvl107
20-Turquoise
(To:AlvaroDíaz)

On 10/20/2009 6:12:37 AM, adiaz wrote:
>Or the echelon form. Starting
>a new topic, but from Cramer's
>rule post.
>
>Regards.

...help needed...


On 10/30/2009 9:09:09 PM, lvl107 wrote:
...
>...help needed...
>___________________

"Gauss-Jordan" has several meaning. rref(M) is a Mathcad built-in function. "Gauss-Jordan pivot" is used to solve a sparse n x n matrix of n unknowns. A square matrix n x n may also represent the transformation of two vectors. And by applying the Legendre "least square" method, this matrix will solve for the coefficients of a n-1 [or less] order polynomial.
You should specify if rref(M) ends your demand or if you have something more in mind. The Gauss-Jordan Wiki english is long and jargon.



jmG



Here is how to get the determinant using Guass-Jordan elimination. Note that it is not necessary to reduce the matrix to echelon form, it is sufficient to reduce it to triangular form.
__________________
� � � � Tom Gutman

As Tom Gutman pointed, partial Gauss-Jordan elimination is better, and is to obtain the LU decomposition of the matrix.

I add det into the RREF algo only to show how to eval det inside this method, and because is usefull eval all at the same time, but not to set a model to eval det.

The LU decomposition have the propertie that det(A)=det(L)*det(U), with det(L)=1 and det(U)=Prod(diag(U)). But this for a full pivoting LU, and mathcad do partial pivoting algorithm, so, must to correct the sign of the determinant.

Also, the classical recursion method added.

As question to Mr. Gutman: your pivoting is partial or full? Can't see that in a first lecture of your routine.

Regards. Alvaro.

>>As question to Mr. Gutman: your pivoting is partial or full? Can't see that in a first lecture of your routine.<<

Not sure of the terminology. Probably partial, as it's very simple and just looks within the current column. This basic structure could easily be adapted to do the echelon form.
__________________
� � � � Tom Gutman

On 10/31/2009 3:14:37 PM, Tom_Gutman wrote:

>Not sure of the terminology.

I forgot set this. Acclaration added. Your pivoting is partial too.

Regards. Alvaro.
lvl107
20-Turquoise
(To:AlvaroDíaz)

On 10/31/2009 5:22:38 PM, adiaz wrote:
>On 10/31/2009 3:14:37 PM, Tom_Gutman
>wrote:

>Not sure of the terminology.

I
>forgot set this. Acclaration added. Your
>pivoting is partial too.

Regards.
>Alvaro.

...re-checking...


AlvaroDíaz
12-Amethyst
(To:lvl107)

On 11/4/2009 1:39:11 PM, lvl107 wrote:
>...re-checking...

You're right, the attached procedure don't find well the signature of P.

Regards. Alvaro.
lvl107
20-Turquoise
(To:TomGutman)

On 10/31/2009 1:07:00 AM, Tom_Gutman wrote:
>Here is how to get the
>determinant using Guass-Jordan
>elimination. Note that it is
>not necessary to reduce the
>matrix to echelon form, it is
>sufficient to reduce it to
>triangular form.
>__________________
>� � � � Tom Gutman


Why did you remove the absolute value from the calculation of a? That makes the pivoting incorrect, one is looking for the largest magnitude, positive or negative.

Why did you choose to do the subscripting for Ai,i three times, rather than do it once, saving the value?

Why do you multiply a (the potential pivots) by D? What does that product mean?

What do the extra three values you return supposed to mean?

The algorithm here will reduce the matrix A to a lower triangular form, with ones along the diagonal. Each of the individual transforms can be considered as a matrix multiplication, by a suitable matrix. Calculate the product of the inverses of these matrices and you get a matrix which, when multiplied by the residual matrix, produces the original matrix. But note that there are column interchanges involved. You need to take those into account. The Mathcad LU decomposition also does not decompose the original matrix, but that matrix with some row interchanges.
__________________
� � � � Tom Gutman
lvl107
20-Turquoise
(To:TomGutman)

I'm new with this. I'm new with Programming in Mathcad. I have not comprehended that. I did that to compare outputs for learning. I have learned a lots from your help. Thanks for your commend.
-------
Loi.


On 11/6/2009 10:58:16 PM, Tom_Gutman wrote:
>Why did you remove the
>absolute value from the
>calculation of a? That makes
>the pivoting incorrect, one is
>looking for the largest
>magnitude, positive or
>negative.
>
>Why did you choose to do the
>subscripting for Ai,i three
>times, rather than do it once,
>saving the value?
>
>Why do you multiply a (the
>potential pivots) by D? What
>does that product mean?
>
>What do the extra three values
>you return supposed to mean?
>
>The algorithm here will reduce
>the matrix A to a lower
>triangular form, with ones
>along the diagonal. Each of
>the individual transforms can
>be considered as a matrix
>multiplication, by a suitable
>matrix. Calculate the product
>of the inverses of these
>matrices and you get a matrix
>which, when multiplied by the
>residual matrix, produces the
>original matrix. But note
>that there are column
>interchanges involved. You
>need to take those into
>account. The Mathcad LU
>decomposition also does not
>decompose the original matrix,
>but that matrix with some row
>interchanges.
>__________________
>� � � � Tom Gutman



lvl107
20-Turquoise
(To:TomGutman)

...self re-check...I was wrong and I have learned some. Thanks for your commend.
-----
Loi.

On 11/6/2009 10:58:16 PM, Tom_Gutman wrote:
>Why did you remove the
>absolute value from the
>calculation of a? That makes
>the pivoting incorrect, one is
>looking for the largest
>magnitude, positive or
>negative.
>
>Why did you choose to do the
>subscripting for Ai,i three
>times, rather than do it once,
>saving the value?
>
>Why do you multiply a (the
>potential pivots) by D? What
>does that product mean?
>
>What do the extra three values
>you return supposed to mean?
>
>The algorithm here will reduce
>the matrix A to a lower
>triangular form, with ones
>along the diagonal. Each of
>the individual transforms can
>be considered as a matrix
>multiplication, by a suitable
>matrix. Calculate the product
>of the inverses of these
>matrices and you get a matrix
>which, when multiplied by the
>residual matrix, produces the
>original matrix. But note
>that there are column
>interchanges involved. You
>need to take those into
>account. The Mathcad LU
>decomposition also does not
>decompose the original matrix,
>but that matrix with some row
>interchanges.
>__________________
>� � � � Tom Gutman


You can appreciate the solving utility of rref(,).



jmG






DISAMBIGUATION: ref, rref(M)

"Comments and Cautions:
In todays lesson we express linear systems in augmented matrices and solve them using matrix methods. We use matrix row operations to transform the system to REF form (a diagonal of ones with a triangle of zero below the diagonal) and use back-substitution to solve the system. This is the Gaussian Elimination method. Or we could go further using matrix row ops to get a second triangle of zeros above the diagonal of ones (RREF) and reading the answers straight from the resulting matrix. This is Gauss-Jordan method".



jmG

Erratum:
Read "Gauss elimination is upper triangular".

jmG
lvl107
20-Turquoise
(To:TomGutman)

On 11/6/2009 10:58:16 PM, Tom_Gutman wrote:
>Why did you remove...

All for learning... Because I have not known about "vectorize" as yet. Please check if this cover all the cases. Thanks.



>Please check if this cover all the cases.<<br> ______________________

Easy to check vs the material I have posted. The principal cases are exemplified. Check for more. Visit Wiki, Matlab as it was linked in the thread.

jmG

On 10/30/2009 9:09:09 PM, lvl107 wrote:
>On 10/20/2009 6:12:37 AM, adiaz wrote:
>>Or the echelon form. Starting
>>a new topic, but from Cramer's
>>rule post.
>>
>>Regards.
>
>...help needed...
>__________________________

You said many times "help needed", but you don't specify what kind of help, maybe except for collabs who can open your repost in Mathcad version that only opens in 14, thus excluding collabs at lower versions. That stuff "Linear Algebra" used to be a book by itself and long gone with the wind. For specific applications, you may need lot more functions than the Mathcad built-in ones. However, vis solving a given system with different setup and possible different interpretations, here are in Mathcad 11.2a: rref, svds, QR, SVD, + conventional

Quite an interesting suite to "Cramer".
A "tool box" work sheet.

jmG
Announcements

Top Tags