eigenvalues

eigenvalues - 消息

#1 已发布: 2011/2/13 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 已发布: 2011/2/13 17:51:03
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2011/2/14 16:51:34
maegrad

maegrad

0个赞,共4个帖子。

组: User

That will work for me, thanks.
#4 已发布: 2011/2/15 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 已发布: 2011/2/15 14:41:03
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2011/2/15 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 已发布: 2013/10/5 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.33 KiB)已下载 1895 次。
#8 已发布: 2013/10/5 19:28:52
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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.83 KiB)已下载 1790 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
ioan92 2013/10/6 03:48:00
#9 已发布: 2013/10/6 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.
  • 有新帖
  • 无新帖