×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Solving Eigenvalues for a 3x3 matrix
4

Solving Eigenvalues for a 3x3 matrix

Solving Eigenvalues for a 3x3 matrix

(OP)
Pals

anyone has or would like to type here a faster vb code for finding eigenvalues of a 3x3 matrix

respects
ijr

RE: Solving Eigenvalues for a 3x3 matrix

Faster than what?

RE: Solving Eigenvalues for a 3x3 matrix

(OP)
GregLocock

you mean to say there is a built in function. Why didnt you just say that?

thanks anyway
ijr

RE: Solving Eigenvalues for a 3x3 matrix

(OP)
Didnt find any eigenvalue function in xls

RE: Solving Eigenvalues for a 3x3 matrix

I can't think of any simple way to combine those functions to solve Lambda in
Ax = Lambda*x
where A is nxn, x is nx1, Lambda is scalar.

But I might be wrong.  If there is can you outline it Greg?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Solving Eigenvalues for a 3x3 matrix

2
I have modified the spreadsheet in Greg's link to find the eigenvalues by solving a cubic polynomial, rather than using goalseek.  That should be quicker.

Here's the code:

CODE

Public Function Eigen3x3(MatrixA As Variant) As Variant
Dim a As Double, b As Double, c As Double
Dim d As Double, e As Double, f As Double
Dim g As Double, h As Double, i As Double
Dim ac As Double, bc As Double, cc As Double, dc As Double

MatrixA = MatrixA.Value2

a = MatrixA(1, 1)
b = MatrixA(1, 2)
c = MatrixA(1, 3)
d = MatrixA(2, 1)
e = MatrixA(2, 2)
f = MatrixA(2, 3)
g = MatrixA(3, 1)
h = MatrixA(3, 2)
i = MatrixA(3, 3)

ac = -1
bc = a + e + i
cc = f * h + b * d + c * g - a * e - a * i - e * i
dc = b * f * g + c * d * h - a * f * h - b * d * i - c * e * g + a * e * i

Eigen3x3 = CubicC(ac, bc, cc, dc)

End Function

The function to solve the cubic is included in the attached file.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
 

RE: Solving Eigenvalues for a 3x3 matrix

(OP)
GregLocock and IDS

Thanks for the great posts. This solves my problem. I can move on from here.

Sorry for keeping you busy with the word "fast". How can you make me so responsible for that pals? Anyway, let me explain. No standard calculator around me or excel does it easily, so anything that can make me enter a matrix and gets me eigenvalues and eigenvectors is "fast". The algorithm above gets me eigenvalues, thats helpful.

There are numerical analysis that explain this, but I just figured out pals here have a better way around that would save me from learning the power method etc.

respects
ijr

RE: Solving Eigenvalues for a 3x3 matrix

Hey we were just ribbing you. If you really want fast for large matrices don't use Excel. Matlab and Octave both have a function (eig) that will rip out eigenvalues for big matrices, very quickly, say <4 seconds for a 500x500 matrix.

 

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies  http://eng-tips.com/market.cfm?

RE: Solving Eigenvalues for a 3x3 matrix

(OP)
That is another great bit of  info GregoLocock

I am now going into Matlab.

Anyway, your posts and IDS's simplified life for now.

respects

IJR

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources