Solved

# Source Code VB6 to calculate eigenvector and eigenvalue?

Posted on 2011-10-17
Medium Priority
1,067 Views
Source Code VB6 to calculate eigenvector and eigenvalue? matrix with dimention nxn
thanks
0
Question by:harry2228
• 4
• 3
• 2
• +1

LVL 53

Expert Comment

ID: 36978038
A Function That Computes the Eigenvalues and Eigenvectors For a Real Symmetric Matrix

http://www.freevbcode.com/ShowCode.asp?ID=9209
0

Author Comment

ID: 36978053
can give me some example how to use this function?thanks
0

LVL 11

Expert Comment

ID: 36978379
You populate an array and pass that as the parameter, and assign the results of the function to an array.  Such as:

``````Dim jk_source(2,2)
Dim jk_results(2,2)

'populate the array - it's been too long to remember what reasonable values should be,
'and my textbook is at work, but do something like this
jk_source(0,0) = value1
jk_source(0,1) = value1
jk_source(1,0) = value1
jk_source(1,1) = value1

jk_target = EIGEN_JK(jk_source)
``````
0

Author Comment

ID: 36979115
thanks for the answer.. but i still get error "object required". can help me to solve this one? thanks
0

LVL 37

Expert Comment

ID: 36981008
Um... finding eigenvectors involves generally involves solving the characteristic polynomial so for n>=5, this becomes quite a problem (since it has been proven impossible to come up with a general solution for such polynomials).

The code kbirecki linked to only works for symmetric matrices and is also only an approximation.

What exactly is the purpose of the code? Is n bounded by some low limit (like 3 or something)?
0

LVL 11

Expert Comment

ID: 36982306
Tommy sounds right on this.  I was just trying to fill in the blank using the link Dheast provided.  But, I'm at work, and I'm grabbing my Elementary Differential Equations and Boundary Value Problems text book from college.  And it says...wait....let me read a little here...umm, I think I'll need a little time to refresh my memory.  I'll read it tonight and see if I can come up with some help.  If anyone else has a solution, maybe they can chime in.
0

LVL 11

Expert Comment

ID: 37043781
I apologize for the delay, but I've been trying to go back and review the fundamentals for this.  It's been a while.  I don't yet have an answer, but hopefully someone else will come along and help.  I'll continue working on this as I can, unless someone else gives you a solution.  That's the best I can do right now.
0

LVL 11

Accepted Solution

kbirecki earned 1500 total points
ID: 37043808
In the mean time, here an option to consider:

Matrix ActiveX Component - http://www.bluebit.gr/matrix/ - \$59
0

LVL 37

Expert Comment

ID: 37044648
Based on the other question from you that I just saw, I would also recommend either MATLAB or C++ with OpenCV for intense matrix calculations. Again you will find that it's much faster and there's much more free (and not free) code out there for those languages for anything heavily math related.
0

Author Closing Comment

ID: 37060212
thanks
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.