Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-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
Joined
Aug 13, 2002
Messages
5
Location
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!!!
 
see if this helps:
thread770-12296

 
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
 
I believe the number is 256, not 282...

 
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
 
hehehe... I didn't try to do the math, I just numbered all of the columns and looked to see what value the last one contained.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top