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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Schur and Jordan decompositions of a Matrix

LarryJ
6-Contributor

Schur and Jordan decompositions of a Matrix

 

Would be nice if Mathcad Prime included internal routine for the Schur and Jordan decompositions of a matrix.

Has anyone developed a Mathcad Prime routine to return the Schur and Jordan decompositions of a matrix?

 

Thanks for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
LarryJ
6-Contributor
(To:terryhendicott)

Terry,

See attached - I think I cracked it.  I finally got Schur decomposition to work on matrix with a mix of real and pairs of complex conjugate eigenvalues with reduced iterations.  Also added routine to get eigenvectors from Schur decomposition. 😊

 

I think this should be considered an accepted solution. Do you agree?

 

Now need to work on a Mathcad version of the Jordan decomposition with repeated eigenvalues. 

It would be nice if Mathcad included efficient versions of the Schur and Jordan decomposition for eigenvalues and eigenvectors in their list of matrix functions.😩

 

I wanted to add ViadimirN and Werner_E to posting, but don't see how to do it.

 

Thanks all for your help😊

LarryJ

View solution in original post

17 REPLIES 17
VladimirN
24-Ruby II
(To:LarryJ)

You can look at an old discussion here - "Jordansche Normalform of a matrix": https://community.ptc.com/t5/Mathcad/Jordansche-Normalform-of-a-matrix/td-p/81283

LarryJ
6-Contributor
(To:VladimirN)

Thanks for the Link -- interesting discussion but I was looking for a mathcad algorithm that someone may have developed in the past.

Hi Larry,

Here is the Schur decomposition for real matrix and real eigenvalues, have not developed the complex number algorithm yet.

Following are two examples from different sources.

Capture.JPG

Capture2.JPG

Capture3.JPG

Cheers

Terry

Hi,

Realize the iterative solution often needs far less than 2 million iterations.

Here is a solution that defines the maximum number of iterations "n" and an accuracy in decimal places "d"

Capture.JPG

Capture2.JPG

Cheers

Terry

LarryJ
6-Contributor
(To:terryhendicott)

This is better solution -- will it work for complex matrix?

What is 

LarryJ_0-1682929661420.png

Thanks

Hi,

SchurNorm() is a mistake it should read SchurHalt()  Oops

Cheers

Terry.

LarryJ
6-Contributor
(To:terryhendicott)

Terry -- see attached -- I added shifting procedure to reduce the number of iterations.  Works well except for matrices that have pairs of complex conjugate eigenvalues.  Any ideas?

LarryJ
6-Contributor
(To:terryhendicott)

Terry,

See attached - I think I cracked it.  I finally got Schur decomposition to work on matrix with a mix of real and pairs of complex conjugate eigenvalues with reduced iterations.  Also added routine to get eigenvectors from Schur decomposition. 😊

 

I think this should be considered an accepted solution. Do you agree?

 

Now need to work on a Mathcad version of the Jordan decomposition with repeated eigenvalues. 

It would be nice if Mathcad included efficient versions of the Schur and Jordan decomposition for eigenvalues and eigenvectors in their list of matrix functions.😩

 

I wanted to add ViadimirN and Werner_E to posting, but don't see how to do it.

 

Thanks all for your help😊

LarryJ

Larry,

Yes think you can take your work as answering the question.  Well done.

Cheers

Terry

LarryJ
6-Contributor
(To:terryhendicott)

Thats a lot of iterations -- I like your next submittal better.  Thanks for the quick response..

Hi Larry,

Have tested with complex numbers in the matrix with complex eigenvalues,

Function SchurHalt(A,n,d) works unaltered with complex numbers.

The only change is the last check using the decomposition to check you get the original matrix.

Capture.JPG

Cheers

Terry


The only change is the last check using the decomposition to check you get the original matrix.

I am out of my comfort zone, but U being a unitary matrix, the inverse of U equals the transposed of the matrix of the conjugate values:

Werner_E_1-1682958317762.png

Actually we should vectorize additionally, but Prime applies implicit vectorization because there is no such thing like the conjugate of a whole matrix.

 

LarryJ
6-Contributor
(To:Werner_E)

Yes, should be conjugate transpose as you indicated when dealing with complex matrices.

 

Great job, the only improvement would be to accelerate the convergency to reduce the number of iterations.

 

Thanks for your help.

LarryJ
6-Contributor
(To:terryhendicott)

Hi Terry,

See attached File.  I included more examples and alternate procedures in an attempt to accelerate convergence to solution but to no practical avail.  Note Schurv is cheating since the eignvalues and vectors are computed using Mathcad eigenvals and eigenvecs and then using QR to calculate Schur decomposition.  In either procedure the method does not converge well for matrix with repeated roots or singular matrix or in some cases for a matrix with a pair of complex conjugate roots.  If all roots are real and unique (not repeated or close to each other) convergence is reasonable.  Apparently, convergence can be improved by first reducing the matrix to Hessenberg form and then doing shifts which requires more detailed coding. 

Thanks for your help.

Larry

LarryJ
6-Contributor
(To:terryhendicott)

Terry, see attached -- I added a program to calculate Hessenberg decomposition as initial condition for Schur in an effort to increase convergency. It only helped in one case of the examples but it was interesting in its own right. 

Hi,

Jordan Decomposition.

3x3 file has commentary, 4x4 file just does the calculations.

LarryJ
6-Contributor
(To:terryhendicott)

Thanks for the contribution. I'll have to figure out how to program that process.

Top Tags