The Derivatives Library

dI1DS(const mat &S)

Provides the derivative of the first invariant (trace) of a 2nd order tensor \(\mathbf{S}\). Such derivative returns the identity matrix \(\mathbf{I}\):

\[\frac{\partial I_1}{\partial \mathbf{S}} = \mathbf{I}\]
mat S = randu(3,3);
mat dI1 = dI1DS(S);
mat dI2DS(const mat &S) {

Provides the derivative of the second invariant \(I_2 = \frac{1}{2} S_{ij} S_{ij}\) of a 2nd order tensor \(\mathbf{S}\). Such derivative returns the tensor \(\mathbf{S}\):

\[\frac{\partial I_2}{\partial \mathbf{S}} = \mathbf{S}\]
mat S = randu(3,3);
mat dI2 = dI2DS(S);
dI3DS(const mat &S)

Provides the derivative of the third invariant \(I_3 = \frac{1}{3} S_{ij} S_{jk} S_{ki}\) of a 2nd order tensor \(\mathbf{S}\). Such derivative returns the tensor \(\left(\mathbf{S} \cdot \mathbf{S}\right)^T\)

\[\frac{\partial I_3}{\partial \mathbf{S}} = \left(\mathbf{S} \cdot \mathbf{S}\right)^T\]
mat S = randu(3,3);
mat dI3 = dI3DS(S);
dtrSdS(const mat &S)

Provides the derivative of the trace of a 2nd order tensor \(\mathbf{S}\). Such derivative returns the identity matrix :

\[\frac{\partial tr(\mathbf{S})}{\partial \mathbf{S}} = \mathbf{I}\]
mat S = randu(3,3);
mat dtrS = dtrSdS(S);
mat ddetSdS(const mat &S)

Provides the derivative of the determinant of a 2nd order tensor \(\mathbf{S}\):

\[\mathbf{C} = \textrm{det} (\mathbf{S}) \cdot \mathbf{S}^{-T}\]
mat S = randu(3,3);
mat ddetS = ddetSdS(S);
mat dinvSdS(const mat &S)

Provides the derivative of the inverse of a 2nd order tensor \(\mathbf{S}\):

mat S = randu(3,3);
mat dinvS = dinvSdS(S);