## vb subroutine to invert a very large square matrix

## vb subroutine to invert a very large square matrix

(OP)

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!!!

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

Any help in this area would be very much apprecited!!!

## RE: vb subroutine to invert a very large square matrix

Thread770-12296

## RE: vb subroutine to invert a very large square matrix

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.

## RE: vb subroutine to invert a very large square matrix

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!!

## RE: vb subroutine to invert a very large square matrix

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.

## RE: vb subroutine to invert a very large square matrix

guest0821(visitor)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

## RE: vb subroutine to invert a very large square matrix

## RE: vb subroutine to invert a very large square matrix

guest0821(visitor)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

## RE: vb subroutine to invert a very large square matrix