I'm following a technical paper converting the mathematical formula to code and am stuck at the following:

Given a vector a in R3, we can construct a 3x3 symmetric matrix, m(a) that has |a| as an eigenvalue with a as the corresponding eigenvector, and with the other two eigenvalues equal to zero. This matrix is defined by

m(a) = {aaT/|a| : a != 0

{ 0 : a = 0

I'm fairly new with the notation and have 2 questions:

1) How do you construct this 3x3 matrix in layman's terms?

If the vector \(\displaystyle a\) (which you write as a column vector) has components \(\displaystyle a_1,\,a_2,\,a_3\), then \(\displaystyle aa^{\textsc{t}}\) is the matrix product of \(\displaystyle a\) with the transpose of \(\displaystyle a\). It is a 3×3 matrix with components \(\displaystyle \begin{bmatrix}a_1^2&a_1a_2&a_1a_3\\ a_2a_1&a_2^2&a_2a_3\\ a_3a_1&a_3a_2&a_3^2\end{bmatrix}.\) To get the matrix \(\displaystyle aa^{\textsc{t}}/|a|\) you then have to divide each element by \(\displaystyle |a|.\)

2) I have 3 eigenvalues & corresponding eigenvectors gained from a stress matrix that I'm trying to decompose into compressive and tensile forces, does it look as if I should be just selecting one of these to form the above matrix?

I'm no engineer, but I'm guessing that the compressive part corresponds to negative eigenvalues and the tensile part to positive eigenvalues (or maybe the other way round). Say there is one positive eigenvalue, with eigenvector \(\displaystyle a\), and two negative eigenvalues, with eigenvectors \(\displaystyle b\) and \(\displaystyle c\). Then my guess is that the stress matrix needs to be decomposed into the positive part which would be \(\displaystyle aa^{\textsc{t}}/|a|\), and the negative part which is \(\displaystyle bb^{\textsc{t}}/|b| + cc^{\textsc{t}}/|c|\).