RE: Newbie question: big matri
- To: mathgroup at smc.vnet.net
- Subject: [mg9338] RE: [mg9253] Newbie question: big matri
- From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
- Date: Sat, 1 Nov 1997 03:33:25 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Dennis wrote: | |I have three 100x100 sparse (diagonal) matrices (matrxD, matrxU, and |matrxL) and three 100x1 matrices (b, x2, and x1), and I'm performing |several operation on them: | |x2 = -Inverse[matrxD].(matrxL+matrxU).x1+Inverse[matrxD].b; | |I have to do it MANY, MANY times... with a 5x5 matrix it takes a few |minutes, but with a 100x100 it takes longer than eight hours (and still |running). Does anyone (offhandedly) know of a way to reduce the time |this takes for Mathematica to solve? | |Dennis W. Scott, Jr. |University of Illinois at Urbana dscott at ews.uiuc.edu | I don't have a simple fix for you, but I will point you to a few places. Take a look at Numerical Recipes in C. You will most likely find it at your campus bookstore and possibly at the library. This book talks about numerical computations on sparse matrices, and a lot of other good stuff. Note: The authors of Numerical Recipes in C advise that computing the inverse of a large matrix is a very tedious task, and you should avoid this computation if you can help it. One place in particular where you don't want to compute the inverse of a matrix is when you are finding the solution to a system of linear equations (there are faster ways). This book discusses many other numerical algorithms (many are similar to those in Mathematica) that may be suitable for your problem. Is the problem you referred to part of a much larger effort? In general it's best to avoid making your own routines if you can. It's usually better to make use of built in features (as much as you can). Keep this in mind when you write your programs. Also, you might look into MathSource at; http://www.mathsource.com/ Ted Ersek