I'm using Sympy from within PyDy to generate the equations of motion for
mechanical systems.  At the end of the day,  the equations can be most
generally written as:
M(x) * x'' = F(x, x', t)

M(x) is what is known as the mass matrix, and will in general depend on the
configuration of the system (positions and angles).  This matrix needs to be
inverted in order to solve for x'', which then will allow for numerical
integration or stability analysis.

I am generating M(x) symbolically, and in some case is it sparse, but in
many cases, it isn't.  Each entry of the matrix is a Sympy expression, but
instead of trying to invert a matrix of Sympy expressions, I introduce a
dummy symbol for each non-zero entries and then invert the matrix of dummy
symbols.  Humble systems might have 5 degrees of freedom (so a 5x5 needs to
be inverted), so this inversion isn't so bad, but beyond this, the matrix
inversions take a really long time, especially when the matrices are full
(no zero entries).

I was thinking that it might be nice to have pre-computed matrix inverses
for n x n matrices.  Matrix inversion is O(n^3), so it would be nice to have
all this precomputed symbolically, and this would greatly speed up Sympy's
matrix capabilities.  Inverses up to say 100x100 could be computed (or maybe
something smaller), and then when you need an inverse, everything would be
fast.  This could also be used behind the scenes (by introduction of
symbolic substitution dictionaries) for inverting a matrix full of sympy
expressions.

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?

Thanks,
~Luke

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to