eigenvalues

eigenvalues - Сообщения

#1 Опубликовано: 13.02.2011 17:19:41
maegrad

maegrad

0 сообщений из 4 понравились пользователям.

Группа: User

Is there a default function to solve eigenvalues? Or do I need to write a program to solve for eigenvalues?
#2 Опубликовано: 13.02.2011 17:51:03
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 14.02.2011 16:51:34
maegrad

maegrad

0 сообщений из 4 понравились пользователям.

Группа: User

That will work for me, thanks.
#4 Опубликовано: 15.02.2011 13:33:48
maegrad

maegrad

0 сообщений из 4 понравились пользователям.

Группа: 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 Опубликовано: 15.02.2011 14:41:03
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 15.02.2011 16:20:24
maegrad

maegrad

0 сообщений из 4 понравились пользователям.

Группа: 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 Опубликовано: 05.10.2013 04:53:07
mb10

mb10

9 сообщений из 20 понравились пользователям.

Группа: 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 КиБ) скачан 369 раз(а).
#8 Опубликовано: 05.10.2013 19:28:52
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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 КиБ) скачан 217 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
ioan92 06.10.2013 03:48:00
#9 Опубликовано: 06.10.2013 03:11:35
mb10

mb10

9 сообщений из 20 понравились пользователям.

Группа: 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.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений