Hi, I`m trying to get tangent stiffness matrix of 6 nodes triangular finite element. Beginning part of code contains symbolic calculation and very simple operations such as getting one element of vector or transpose are very very slow. So I can`t to continue.Thanks in advance for any advice. File is attached.
It is not slow for me.
At the beginning of the file - it is better to define the variables and constants in any way - and then reset them all - as shown below -
You are calling B N.nd times just to pick out one of the six results and transpose it. Its sure more efficient to call B.n just once and work on the result.
This modification should do the job approx. N.nd times faster 😉