Hi @profhansen, thanks for the very nice work!
I was skimming through the code, and noticed that there are a few matrix inverses. Generally, this is slow, inaccurate and doesn't leverage sparsity, therefore I have some suggestions.
Hope it helps 🙂
Best regards,
Riccardo
Hi @profhansen, thanks for the very nice work!
I was skimming through the code, and noticed that there are a few matrix inverses. Generally, this is slow, inaccurate and doesn't leverage sparsity, therefore I have some suggestions.
In model_assembler, lines 105 to 109. I suggest to replace the mass matrix inverse with its LU factorization. Then, instead of the multiplication with the stiffness and gyroscopic matrices you can solve a linear system. Useful functions from scipy are:
lu_factorandlu_solve.In corotbeam, lines 749, 753, 759, 762 and 764 you can again compute the LU factorization of
H, and then solve many linear systems.Hope it helps 🙂
Best regards,
Riccardo