linear algebra

Performance of common biomechanics linear algebra operations in Numpy

Klevis Aliaj
950 words
Before building more complex logic into my codebase, I wanted to compare the performance of different methods of computing common biomechanics linear algebra operations in Numpy. As is common in biomechanics and robotics, I use a 4x4 homogeneous matrix to represent a coordinate system or pose, and correspondingly 3D vectors are upgraded to homogeneous coordinates. I knew that numpy.einsum could accommodate all linear algebra operations I am interested in performing, but I was curious to compare its performance against numpy.matmul for operations that could be performed just by matrix multiplication. Thanks to Numpy's broadcasting algorithm a considerable number of operation can be performed using numpy.matmul.

How not to spill your friend's coffee: tensor invariance under coordinate system transformations

Klevis Aliaj
2083 words
When I first began studying continuum mechanics, tensors were a conundrum to me. I understood how to manipulate them algebraically but obtaining an intuitive understanding of them was a more difficult path. The purpose of this post is to simplify tensors for students who may have also run into the same roadblocks as I did. This post assumes familiarity with orthonormal bases, coordinate systems (frames), and measuring the position and orientation of one frame with respect to another.