The inversion of a 100x100 dense matrix would be quite a big mess, wouldn't it?
But I see what you mean, and I think it makes sense to cache it, if it
speeds things up. But see below.
> Does anybody know if this has been done by somebody somewhere, or have any
> other ideas on how it could be done better than the way I suggested?
I would first try to profile the inversion code to see why it is slow.
Because for example the adjoint method is just a ratio of two
determinants, so it may be the determinants calculation that is slow
(and should be cached). However, there are 100^2 different
determinants (right?), but I guess caching 10000 expressions should
still be doable. But if this is the case, we should just speed up the
determinant calculation, imho. Looking at the code, we have 2
algorithms implemented, bareis and berkowitz.
Also how about the creation of so many expressions, it could be slow too.
So what I want to say is that we should profile it and determine
exactly what things are slowing things down, then we should speed them
up (or cache them).
Ondrej
> Are there differential equation solvers where you don't have to invert
> the matrix?
A Newmark-Beta scheme will directly solve a second-order system of ODEs.
The standard form uses iteration to solve the system so no inversion is
necessary. For linear second-order problems you can rewrite things to
use matrix algebra.
For more information, I recommend Bathe and Wilson,
Klaus-Jürgen Bathe and Edward L. Wilson. Numerical Methods in Finite
Element Analysis. Prentice Hall, Englewood Cliffs, New Jersey,
1976.
There are other second order solvers out there too.
Cheers,
Tim.
---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey
I use either cprofile, or line_profile:
http://packages.python.org/line_profiler/
the line_profiler is nice, that it tells you which lines take so long.
So you need 3x3 matrices, those are fine as it is in sympy, isn't it?
And then you need 6x6 sparse matrices? Are they block diagonal?
Ondrej