eigenvalues

eigenvalues - Messages

#1 Posted: 2/13/2011 5:19:41 PM
maegrad

maegrad

0 likes in 4 posts.

Group: User

Is there a default function to solve eigenvalues? Or do I need to write a program to solve for eigenvalues?
#2 Posted: 2/13/2011 5:51:03 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,
Wrote

Is there a default function to solve eigenvalues? Or do I need to write a program to solve for eigenvalues?


There is no a default function for eigenvalues (I think).
Just try this:
[MATH=eng]A←mat(1,2,2,1,3,2,3,1,4,1,7,2,7,1,2,-3,4,4)[/MATH]
[MATH=eng]solve(det(A-identity(rows(A))*λ)≡0,λ)=mat(-4.19,-0.61,1.81,9.99,4,1)[/MATH]
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 2/14/2011 4:51:34 PM
maegrad

maegrad

0 likes in 4 posts.

Group: User

That will work for me, thanks.
#4 Posted: 2/15/2011 1:33:48 PM
maegrad

maegrad

0 likes in 4 posts.

Group: User


I am new to Smath from Mathcad, so this might be obvious but I am running into issues solving for eigenvalues that way. While it work for the matrix you provided, when I switch to something different I get a "no real roots" error. But if I expand it out and solve the quadratic equation in Smath, it gives me the correct values. Can you think of why I might be getting this error?

For example, try A=(49 20;60 100) and you will get the "no real roots" error, yet while using Smath to solve symbolically and then using the quadratic equation will give 117.51 & 31.49.
#5 Posted: 2/15/2011 2:41:03 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

See this link https://smath.com/wiki/solve.ashx on the Wiki please.

Your problem could be solved with solve(4) with four arguments.
[MATH=eng]A←mat(49,20,60,100,2,2)[/MATH]
[MATH=eng]solve(det(A-identity(2)*λ),λ,0,150)=mat(31.49,117.51,2,1)[/MATH]

Pay attention that solve can fail, especially when the range is rather large (eigenvalues quite distinct). It is based on a numerical searching procedure within a given range.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Posted: 2/15/2011 4:20:24 PM
maegrad

maegrad

0 likes in 4 posts.

Group: User


That method will be too specific for what I am trying to solve. I found a eigenvalue program in "Introduction to the use of SMath Studio", Prepared by Gilberto E. Urroz, May 2010 Appendix 7 that works great for what I am trying to do. Thanks again for the help.
#7 Posted: 10/5/2013 4:53:07 AM
mb10

mb10

9 likes in 20 posts.

Group: User

Wrote


That method will be too specific for what I am trying to solve. I found a eigenvalue program in "Introduction to the use of SMath Studio", Prepared by Gilberto E. Urroz, May 2010 Appendix 7 that works great for what I am trying to do. Thanks again for the help.


I converted the program into a function (see attachment) and it works fine for me. However eigenvectors calculation fails for 2x2 matrices, an error "Array dimensions do not match" being reported.
Did anybody experience the same problem?

mb
eigenAll.sm (22 KiB) downloaded 368 time(s).
#8 Posted: 10/5/2013 7:28:52 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I tried to reproduce the results using Maxima. The eigenvectors of the 3x3 example are different from your result. For debugging the function, inspection of the non-simplified result might help.
Section matrix operations.sm (100 KiB) downloaded 214 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
ioan92 10/6/2013 3:48:00 AM
#9 Posted: 10/6/2013 3:11:35 AM
mb10

mb10

9 likes in 20 posts.

Group: User

Wrote

I tried to reproduce the results using Maxima. The eigenvectors of the 3x3 example are different from your result.


You're right: it's confirmed with MathCad. Silly me not having checked before.

Wrote

For debugging the function, inspection of the non-simplified result might help.


Good to know, thanks!

In conclusion the program, in its current implementation, is not recommended for eigenvectors computations.
  • New Posts New Posts
  • No New Posts No New Posts