Models#

class hyperelastic.models.invariants.ThirdOrderDeformation(C10=0, C01=0, C11=0, C20=0, C30=0, strain=False)[source]#

Third Order Deformation isotropic hyperelastic material formulation based on the first and second invariant of the right Cauchy-Green deformation tensor. The strain energy density per unit undeformed volume is given as a sum of multivariate polynomials.

(1)#\[\psi(I_1, I_2) = \sum_{(i+j) \ge 1}^{(i+2j) \le 3} C_{ij}~(I_1 - 3)^i (I_2 - 3)^j\]

The first partial derivatives of the strain energy density w.r.t. the invariants are given below.

(2)#\[ \begin{align}\begin{aligned}\frac{\partial \psi}{\partial I_1} &= \sum_{i \ge 1} C_{ij}~i~(I_1 - 3)^{i-1} (I_2 - 3)^j\\\frac{\partial \psi}{\partial I_2} &= \sum_{j \ge 1} C_{ij}~(I_1 - 3)^i~j~(I_2 - 3)^{j-1}\end{aligned}\end{align} \]

Furthermore, the second partial derivatives of the strain energy density w.r.t. the invariants are carried out.

(3)#\[ \begin{align}\begin{aligned}\frac{\partial^2 \psi}{\partial I_1~\partial I_1} &= \sum_{i \ge 2} C_{ij}~i~(i-1)~(I_1 - 3)^{i-2} (I_2 - 3)^j\\\frac{\partial^2 \psi}{\partial I_2~\partial I_2} &= \sum_{j \ge 2} C_{ij}~(I_1 - 3)^i~j~(j-1)~(I_2 - 3)^{j-2}\\\frac{\partial^2 \psi}{\partial I_1~\partial I_2} &= \sum_{i \ge 1, j \ge 1} C_{ij}~i~(I_1 - 3)^{i-1}~j~(I_2 - 3)^{j-1}\end{aligned}\end{align} \]
gradient(I1, I2, I3, statevars)[source]#

The gradient as the partial derivative of the strain energy function w.r.t. the invariants.

hessian(I1, I2, I3, statevars)[source]#

The hessian as the second partial derivatives of the strain energy function w.r.t. the invariants.

class hyperelastic.models.invariants.TorchModel(fun, **kwargs)[source]#

Isotropic hyperelastic material formulation based on a given strain energy density function fun(I1, I2, I3, **kwargs) per unit undeformed volume. The gradients are carried out by automatic differentiation using PyTorch.

(4)#\[\psi = \psi(I_1, I_2, I_3)\]

Note

PyTorch uses single-precision by default. This must be considered in numeric simulations, i.e. the error tolerance should not exceed np.sqrt(torch.finfo(torch.float).eps) (approx. tol=5e-4). For double- precision, enable torch.float64 as default.

import torch

torch.set_default_dtype(torch.float64)

Examples

>>> import hyperelastic
>>> def yeoh(I1, I2, I3, C10, C20, C30):
>>>     "Yeoh isotropic hyperelastic material formulation."
>>>     return C10 * (I1 - 3) + C20 * (I1 - 3) ** 2 + C30 * (I1 - 3) ** 3
>>> model = hyperelastic.models.invariants.TorchModel(
>>>     yeoh, C10=0.5, C20=-0.05, C30=0.02
>>> )
>>> framework = hyperelastic.InvariantsFramework(model)
>>> umat = hyperelastic.DistortionalSpace(framework)
gradient(I1, I2, I3, statevars, tensor=False, numpy=True, create_graph=False, retain_graph=False)[source]#

The gradient as the partial derivative of the strain energy function w.r.t. the invariants.

hessian(I1, I2, I3, statevars, numpy=True)[source]#

The hessian as the second partial derivatives of the strain energy function w.r.t. the invariants.

class hyperelastic.models.stretches.GeneralizedInvariantsModel(material, fun, **kwargs)[source]#

Generalized-invariants isotropic hyperelastic material formulation based on the principal stretches.

(5)#\[\psi = \psi \left( I_1\left( E_1, E_2, E_3 \right), I_2\left( E_1, E_2, E_3 \right), I_3\left( E_1, E_2, E_3 \right) \right)\]

The three principal invariants

(6)#\[ \begin{align}\begin{aligned}J_1 &= E_1 + E_2 + E_3\\J_2 &= E_1 E_2 + E_2 E_3 + E_1 E_3\\J_3 &= E_1 E_2 E_3\end{aligned}\end{align} \]

are formulated on a one-dimensional strain-stretch relation.

(7)#\[ \begin{align}\begin{aligned}E_\alpha &= f(\lambda_\alpha)\\E'_\alpha &= f'(\lambda_\alpha) = \frac{\partial f(\lambda_\alpha)} {\partial \lambda_\alpha}\\E''_\alpha &= f''(\lambda_\alpha) = \frac{\partial^2 f(\lambda_\alpha)} {\partial \lambda_\alpha~\partial \lambda_\alpha}\end{aligned}\end{align} \]

Depending on the strain-stretch relation, the invariants contain deformation- independent values.

(8)#\[ \begin{align}\begin{aligned}J_{1,0} &= J_1(E_\alpha(\lambda_\alpha=1))\\J_{2,0} &= J_2(E_\alpha(\lambda_\alpha=1))\\J_{3,0} &= J_3(E_\alpha(\lambda_\alpha=1))\end{aligned}\end{align} \]

The deformation-dependent parts of the invariants are scaled by deformation- independent coefficients of normalization. The deformation-independent parts are re-added after the scaling.

(9)#\[ \begin{align}\begin{aligned}I_1 &= c_1 (J_1 - J_{1,0}) + J_{1,0}\\I_2 &= c_2 (J_2 - J_{2,0}) + J_{2,0}\\I_3 &= J_3\end{aligned}\end{align} \]

Note that the scaling is only applied to the first and second invariant, as the third invariant does not contribute to the strain energy function at the undeformed state.

(10)#\[ \begin{align}\begin{aligned}E_0 &= E(\lambda=1)\\E'_0 &= E'(\lambda=1)\\E''_0 &= E''(\lambda=1)\end{aligned}\end{align} \]

The second partial derivative of the strain w.r.t. the stretch must be provided for a reference strain, e.g. the Green-Lagrange strain measure (at the undeformed state).

(11)#\[ \begin{align}\begin{aligned}J''_{1,0} &= \frac{3}{2} \left( E''_0 + E'_0 \right)\\J''_{2,0} &= \frac{3}{2} \left( (2 E_0 (E''_0 + E'_0)) - E'^2_0 \right)\end{aligned}\end{align} \]
(12)#\[ \begin{align}\begin{aligned}c_1 &= \frac{J''_{1,0,ref}}{J''_{1,0}}\\c_2 &= \frac{J''_{2,0,ref}}{J''_{2,0}}\end{aligned}\end{align} \]

The first partial derivatives of the strain energy function w.r.t. the invariants

(13)#\[ \begin{align}\begin{aligned}\psi_{,1} &= \frac{\partial \psi}{\partial I_1}\\\psi_{,2} &= \frac{\partial \psi}{\partial I_2}\\\psi_{,3} &= \frac{\partial \psi}{\partial I_3}\end{aligned}\end{align} \]

and the partial derivatives of the invariants w.r.t. the principal stretches are defined. From here on, this is consistent with any invariant-based hyperelastic material formulation, except for the factors of normalization.

(14)#\[ \begin{align}\begin{aligned}\frac{\partial I_1}{\partial E_\alpha} &= c_1\\\frac{\partial I_2}{\partial E_\alpha} &= c_2 \left( E_\beta + E_\gamma \right)\\\frac{\partial I_3}{\partial E_\alpha} &= E_\beta E_\gamma\end{aligned}\end{align} \]

The first partial derivatives of the strain energy density w.r.t. the principal stretches are required for the principal values of the stress.

(15)#\[\frac{\partial \psi}{\partial \lambda_\alpha} = \frac{\partial \psi}{\partial I_1} \frac{\partial I_1}{\partial E_\alpha} \frac{\partial E_\alpha}{\partial \lambda_\alpha} + \frac{\partial \psi}{\partial I_2} \frac{\partial I_2}{\partial E_\alpha} \frac{\partial E_\alpha}{\partial \lambda_\alpha} + \frac{\partial \psi}{\partial I_3} \frac{\partial I_3}{\partial E_\alpha} \frac{\partial E_\alpha}{\partial \lambda_\alpha}\]

Furthermore, the second partial derivatives of the strain energy density w.r.t. the principal stretches, necessary for the principal components of the elastic tangent moduli, are carried out. This is done in two steps: first, the second partial derivatives w.r.t. the principal strain components are carried out, followed by the projection to the derivatives w.r.t. the principal stretches.

(16)#\[ \begin{align}\begin{aligned}\frac{\partial^2 \psi}{\partial E_\alpha~\partial E_\beta} &= \frac{\partial^2 \psi}{\partial I_1~\partial I_1} \frac{\partial I_1}{\partial E_\alpha} \frac{\partial I_1}{\partial E_\beta} + \frac{\partial^2 \psi}{\partial I_2~\partial I_2} \frac{\partial I_2}{\partial E_\alpha} \frac{\partial I_2}{\partial E_\beta} + \frac{\partial^2 \psi}{\partial I_3~\partial I_3} \frac{\partial I_3}{\partial E_\alpha} \frac{\partial I_3}{\partial E_\beta}\\ &+ \frac{\partial^2 \psi}{\partial I_1~\partial I_2} \left( \frac{\partial I_1}{\partial E_\alpha} \frac{\partial I_2}{\partial E_\beta} + \frac{\partial I_2}{\partial E_\alpha} \frac{\partial I_1}{\partial E_\beta} \right)\\ &+ \frac{\partial^2 \psi}{\partial I_2~\partial I_3} \left( \frac{\partial I_2}{\partial E_\alpha} \frac{\partial I_3}{\partial E_\beta} + \frac{\partial I_3}{\partial E_\alpha} \frac{\partial I_2}{\partial E_\beta} \right)\\ &+ \frac{\partial^2 \psi}{\partial I_1~\partial I_3} \left( \frac{\partial I_1}{\partial E_\alpha} \frac{\partial I_3}{\partial E_\beta} + \frac{\partial I_3}{\partial E_\alpha} \frac{\partial I_1}{\partial E_\beta} \right)\\ &+ \frac{\partial \psi}{\partial I_1} \frac{\partial^2 I_1}{\partial E_\alpha~\partial E_\beta} + \frac{\partial \psi}{\partial I_2} \frac{\partial^2 I_1}{\partial E_\alpha~\partial E_\beta} + \frac{\partial \psi}{\partial I_3} \frac{\partial^2 I_1}{\partial E_\alpha~\partial E_\beta}\end{aligned}\end{align} \]
(17)#\[\frac{\partial^2 \psi}{\partial \lambda_\alpha~\partial \lambda_\beta} = \frac{\partial E_\alpha}{\partial \lambda_\alpha} \frac{\partial^2 \psi}{\partial E_\alpha~\partial E_\beta} \frac{\partial E_\beta} {\partial \lambda_\beta} + \left( \frac{\partial \psi}{\partial I_1} \frac{\partial I_1}{\partial E_\alpha} + \frac{\partial \psi}{\partial I_2} \frac{\partial I_2}{\partial E_\alpha} + \frac{\partial \psi}{\partial I_3} \frac{\partial I_3}{\partial E_\alpha} \right) \frac{\partial^2 E_\alpha}{\partial \lambda_\alpha \partial \lambda_\alpha}\]
gradient(stretches, statevars)[source]#

The gradient as the partial derivative of the strain energy function w.r.t. the principal stretches.

hessian(stretches, statevars)[source]#

The hessian as the second partial derivatives of the strain energy function w.r.t. the principal stretches.

class hyperelastic.models.stretches.Ogden(mu, alpha)[source]#

Ogden isotropic hyperelastic material formulation based on the principal stretches. The strain energy density per unit undeformed volume is given as a sum of individual contributions from the principal stretches.

(18)#\[ \begin{align}\begin{aligned}\psi(\lambda_\alpha) &= \sum_\alpha \psi_\alpha(\lambda_\alpha)\\\psi_\alpha(\lambda_\alpha) &= \frac{2 \mu}{k^2} \left( \lambda_\alpha^k - 1 \right)\end{aligned}\end{align} \]

The first partial derivatives of the strain energy density w.r.t. the principal stretches are required for the principal values of the stress.

(19)#\[\frac{\partial \psi}{\partial \lambda_\alpha} = \frac{2 \mu}{k} \lambda_\alpha^{k - 1}\]

Furthermore, the second partial derivatives of the strain energy density w.r.t. the principal stretches, necessary for the principal components of the elastic tangent moduli, are carried out.

(20)#\[\frac{\partial^2 \psi}{\partial \lambda_\alpha~\partial \lambda_\alpha} = \frac{2 \mu (k-1)}{k} \lambda_\alpha^{k - 2}\]
gradient(stretches, statevars)[source]#

The gradient as the partial derivative of the strain energy function w.r.t. the principal stretches.

hessian(stretches, statevars)[source]#

The hessian as the second partial derivatives of the strain energy function w.r.t. the principal stretches.