Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Newbie question: big matrix calculations

  • To: mathgroup at
  • Subject: [mg9296] Re: [mg9253] Newbie question: big matrix calculations
  • From: Luci Ellis <elisha at>
  • Date: Mon, 27 Oct 1997 02:47:06 -0500
  • Sender: owner-wri-mathgroup at

>This is the first time I've ever been in this newsgroup, so please try
>to excuse anything I do/say that's silly to the experts...
>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;

One thing you can do is to calculate Inverse[matrxD] separately and call
that object, instead of calculating the Inverse twice:

x2 =

Another thing is that you may be able to get the "optimal" ordering of
the dot-product calculations with judicious use of parentheses. Roman
Maeder's book "Programming in Mathematica" has, I believe, some
discussion of this.

I've just had a look at your code and I am certain there are faster ways
to do what you are doing. I will have a closer look later -- there may
be some built in functions that will speed things up.


>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:
>  solved for a 5x5 matrix
>PS-I've already tried decreasing the "accrcy" and changing my initial
>Dennis W. Scott, Jr.
>University of Illinois at Urbana          dscott at
>     ----------------------------------------------------------------
>Aspiring Electrical Engineer              "I want to know God's

Luci Ellis:  elisha at

  • Prev by Date: Re: Integration bugs in Mathematica 3.0
  • Next by Date: Re: Integration bugs in Mathematica 3.0
  • Previous by thread: Newbie question: big matrix calculations
  • Next by thread: Re: Newbie question: big matrix calculations