Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb subroutine to invert a very large square matrix 2

Status
Not open for further replies.

navyguy

Mechanical
Aug 13, 2002
5
0
0
US
Hello, I am looking for a VB subroutine to invert a large (possibly 1000X1000) fully populated square matrix stored as an array (?) for a weapon simulation program I am working on. The matrix should be fairly stable. It is actually to be run in a VB macro in Excel.

I am sort of a novice at this point in vb programming.

Any help in this area would be very much apprecited!!!
 
Replies continue below

Recommended for you

navyguy,

Are you looking for the inverse to find the solution to the set of equations? If so, there are other methods (such as Gauss-Seidel) that will solve a large system but not return the matrix inverse. (Although the matrix inverse by itself can also be very useful.)

I have some subroutines that may help you (for solving systems and/or inverting a matrix), but it sounds like using the built-in Excel commands will take care of your problem.
 
Thankyou for responding! What I am trying to do is to solve for the matrix J in the matrix operation, C*J=A, where C is a known fully populated n x n square matrix, J is a n x 1, and A is a another n x 1 but is only populated by values of 1. Depending on the required accuracy, n could possibly be as high as 1000.

I have don ehtis in mathcad and the matrix appears fairly stable. I want to be able to automate this since it is part of a parametric model that can be run multiple times and not need to be dependant on doing it in excel.

Anyone who could provide a "canned" subroutine would help tremendously!!
 
navyguy,

I'm currently developing routines to solve systems of linear equations for educational purposes (ie they don't have many optimizations and only have minimal error handling - they are mainly to show how the algorithms work). I've only tested them for n up to about 20 equations but so far have had excellent results.

The routines include finding the determinant, matrix inversion, Gauss elimination, Gauss-Jordan, Gauss-Seidel, and L-U decomposition. If you are interested contact me at jmgsjg823@hotmail.com and I'll email you some files. They are being developed in VB6.
 
navyguy,
I don't know if you have considered this, but
I believe Excel has an inherent limit. I think
it is limited to 282 columns, which isn't an
insurmountable problem, but might be a problem
if you're looking for something quick and dirty
that runs in a macro on a 1000 by 1000 matrix.
Can someone else confirm this, or am I barking
at the moon? Column IV is the max?
VW
 
ivymike,
That's why I asked. I had heard 256,
but when I looked it up it 'peared to be
282, A thru Z, plus AA thru IV. I get
26 plus 256, i.e. 26 + 9(I is the ninth
letter)*26 + 22(V is 22nd letter) which
equals 26 + 9*26 + 22 = 282. But I
admit 256 makes more sense, so I asked
for my own personal information. Thanks.
VW
 
Status
Not open for further replies.
Back
Top