JoeSpencer1 / Joe-Spencer-Programs

0 stars 0 forks source link

Eigenvectors for repeat eigenvalues #21

Closed JoeSpencer1 closed 1 year ago

JoeSpencer1 commented 1 year ago

Add functionality for these special cases.

JoeSpencer1 commented 1 year ago

Ok, I have the eigenvalues. Now I just need to make the eigenvectors.

JoeSpencer1 commented 1 year ago

Now the eigenvalues are finished. Next I should find the eigenvectors.

JoeSpencer1 commented 1 year ago

Complex eigenvectors are harder to find...

JoeSpencer1 commented 1 year ago

Here are eigenvectors for a 2x2 matrix: https://math.stackexchange.com/questions/395698/fast-way-to-calculate-eigen-of-2x2-matrix-using-a-formula

JoeSpencer1 commented 1 year ago

For bigger matrices: https://math.stackexchange.com/questions/1781772/finding-eigenvectors-of-a-3x3-matrix https://en.wikipedia.org/wiki/Row_echelon_form

JoeSpencer1 commented 1 year ago

For a larger matrix, once you have it in row echelon form you can set the last entry of the eigenvector to one and then find the others by elimination. Be flexible on the first/final entry.

JoeSpencer1 commented 1 year ago

Hmm I think you need to find the eigenvectors with algebra.

JoeSpencer1 commented 1 year ago

Also, the last term of the eigenvector can be complex in some cases.

JoeSpencer1 commented 1 year ago

Find 1st entry in terms of the others, then remove 1st entry from equation for 2nd entry, until you have equation for last entry. Set last entry real portion equal to 1. After this use the same method to find λ if any of the eigenvalues are complex.

JoeSpencer1 commented 1 year ago

What do you do for repeated eigenvalues or eigenvectors whose last entry is zero?

JoeSpencer1 commented 1 year ago

You should work this out on paper to figure out how to make the eigenvectors. I'm pretty sure the last entry is different mainly for repeat eigenvalues.

JoeSpencer1 commented 1 year ago

Some repeat eigenvalues only have one eigenvector. For example, this matrix only has 2 eigenvectors: {{-2,2,3},{-9,7,5},{-5,2,6}}

JoeSpencer1 commented 1 year ago

Solve for imaginary eigenvectors first, then real.

JoeSpencer1 commented 1 year ago

🤦🏻‍♂️I know this is super basic, but ChatGPT generated this method. You can set up 2 equations, with a as the real portion and b as the imaginary portion, so λ=a+bi. They are: (A-aI)yr-byi=0, (A-aI)yi+byr=0

JoeSpencer1 commented 1 year ago

https://1drv.ms/w/s!AhMaGhbx4p1E93UnidVUKTeNxcHp?e=x3dwup

JoeSpencer1 commented 1 year ago

Both real and complex eigenvectors can be found now. The program still cannot find eigenvectors for repeat eigenvalues, though.

JoeSpencer1 commented 1 year ago

If the eigenvalue is a repeat diagonal entry, this will also have to be resolved differently.

JoeSpencer1 commented 1 year ago

If the eigenvalue is on the main diagonal, you'll have problems with the multiplicity function too.

JoeSpencer1 commented 1 year ago

I think eigenvalues should work for all matrices now, even weird ones.