Re: Newbie question: big matrix calculations

*To*: mathgroup at smc.vnet.net*Subject*: [mg9268] Re: Newbie question: big matrix calculations*From*: hans.steffani at e-technik.tu-chemnitz.de (Hans Steffani)*Date*: Mon, 27 Oct 1997 02:46:41 -0500*Organization*: University of Technology Chemnitz, FRG*Sender*: owner-wri-mathgroup at wolfram.com

dscott at ews.uiuc.edu (Dennis Wayne Scott) writes: >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; To inverte a matrix is often a bad idea and not necessary. x2 = Inverse[matrxD].( (matrxL+matrxU).x1 + b); needs only one inversion instead of two and will be faster than your solution. That is the same as v = ( (matrxL+matrxU).x1 + b); x2 = Inverse[matrxD].v which does not help much but shows us the way. It is obvious that x2 is the solution of the matrix equation matrxD.x2 == v To solve such kind of equations LinearSolve is implemented in Mathematica. We may know that it is not necessary to compute the inverse to solve a matrix equation. Therefore we can hope that LinearSolve[] handles this faster that your solution. This all is not tested! Hans Friedrich Steffani [cc,fup] >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? >I'm using a P133 and Mathematica 2.2. >The entire hunk of code is viewable at: >http://www.cen.uiuc.edu/~dscott/PartB.gif solved for a 5x5 matrix >"size". >PS-I've already tried decreasing the "accrcy" and changing my initial >"guess"... >Thanks! >-- >Dennis W. Scott, Jr. >University of Illinois at Urbana dscott at ews.uiuc.edu > ---------------------------------------------------------------- >Aspiring Electrical Engineer "I want to know God's >thoughts... -- Hans Friedrich Steffani Institut fuer Elektrische Maschinen und Antriebe, TU Chemnitz mailto:hans.steffani at e-technik.tu-chemnitz.de http://www.tu-chemnitz.de/~hfst/