The hookeslaw module#

Provide isotropic linear elastic Hooke law relations.

The module converts stresses and elastic strains for one-dimensional, plane-stress, plane-strain, and three-dimensional material states. Stresses and moduli use the same unit, typically MPa, while strains are dimensionless.

class pylife.materiallaws.hookeslaw.HookesLaw1d(E)[source]#

Apply one-dimensional linear elastic Hooke’s law.

Parameters:

E (float) – Young’s modulus in MPa.

Notes

The implemented relation is

\[\sigma = E \, \varepsilon .\]

Examples

>>> from pylife.materiallaws import HookesLaw1d
>>> law = HookesLaw1d(210000.0)
>>> float(law.stress(0.001))
210.0
>>> float(law.strain(210.0))
0.001
property E#

Return Young’s modulus.

Returns:

Young’s modulus in MPa.

Return type:

float

strain(stress)[source]#

Calculate uniaxial elastic strain from stress.

Parameters:

stress (array_like) – Stress in MPa.

Returns:

Elastic normal strain, dimensionless.

Return type:

numpy.ndarray

stress(strain)[source]#

Calculate uniaxial stress from elastic strain.

Parameters:

strain (array_like) – Elastic normal strain, dimensionless.

Returns:

Stress in MPa.

Return type:

numpy.ndarray

class pylife.materiallaws.hookeslaw.HookesLaw2dPlaneStrain(E, nu)[source]#

Apply isotropic Hooke’s law for plane strain.

Parameters:
  • E (float) – Young’s modulus in MPa.

  • nu (float) – Poisson’s ratio, dimensionless. Must satisfy -1 <= nu <= 0.5.

Notes

The out-of-plane strain components are e33 = g13 = g23 = 0.

property E#

Return Young’s modulus.

Returns:

Young’s modulus in MPa.

Return type:

float

property G#

Return the shear modulus.

Returns:

Shear modulus in MPa.

Return type:

float

property K#

Return the bulk modulus.

Returns:

Bulk modulus in MPa.

Return type:

float

property nu#

Return Poisson’s ratio.

Returns:

Poisson’s ratio, dimensionless.

Return type:

float

strain(s11, s22, s12)[source]#

Calculate elastic strain components for plane strain.

Parameters:
  • s11 (array_like) – Normal stress component in 1-direction in MPa.

  • s22 (array_like) – Normal stress component in 2-direction in MPa.

  • s12 (array_like) – Engineering shear stress component in the 1-2 plane in MPa.

Returns:

  • e11 (numpy.ndarray) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (numpy.ndarray) – Elastic normal strain component in 2-direction, dimensionless.

  • g12 (numpy.ndarray) – Elastic engineering shear strain component in the 1-2 plane, dimensionless. The tensor shear strain is 0.5 * g12.

stress(e11, e22, g12)[source]#

Calculate stress components for plane strain.

Parameters:
  • e11 (array_like) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (array_like) – Elastic normal strain component in 2-direction, dimensionless.

  • g12 (array_like) – Elastic engineering shear strain component in the 1-2 plane, dimensionless.

Returns:

  • s11 (numpy.ndarray) – Normal stress component in 1-direction in MPa.

  • s22 (numpy.ndarray) – Normal stress component in 2-direction in MPa.

  • s33 (numpy.ndarray) – Normal stress component in 3-direction in MPa.

  • s12 (numpy.ndarray) – Engineering shear stress component in the 1-2 plane in MPa.

class pylife.materiallaws.hookeslaw.HookesLaw2dPlaneStress(E, nu)[source]#

Apply isotropic Hooke’s law for plane stress.

Parameters:
  • E (float) – Young’s modulus in MPa.

  • nu (float) – Poisson’s ratio, dimensionless. Must satisfy -1 <= nu <= 0.5.

Notes

The out-of-plane stress components are s33 = s13 = s23 = 0.

property E#

Return Young’s modulus.

Returns:

Young’s modulus in MPa.

Return type:

float

property G#

Return the shear modulus.

Returns:

Shear modulus in MPa.

Return type:

float

property K#

Return the bulk modulus.

Returns:

Bulk modulus in MPa.

Return type:

float

property nu#

Return Poisson’s ratio.

Returns:

Poisson’s ratio, dimensionless.

Return type:

float

strain(s11, s22, s12)[source]#

Calculate elastic strain components for plane stress.

Parameters:
  • s11 (array_like) – Normal stress component in 1-direction in MPa.

  • s22 (array_like) – Normal stress component in 2-direction in MPa.

  • s12 (array_like) – Engineering shear stress component in the 1-2 plane in MPa.

Returns:

  • e11 (numpy.ndarray) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (numpy.ndarray) – Elastic normal strain component in 2-direction, dimensionless.

  • e33 (numpy.ndarray) – Elastic normal strain component in 3-direction, dimensionless.

  • g12 (numpy.ndarray) – Elastic engineering shear strain component in the 1-2 plane, dimensionless. The tensor shear strain is 0.5 * g12.

stress(e11, e22, g12)[source]#

Calculate stress components for plane stress.

Parameters:
  • e11 (array_like) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (array_like) – Elastic normal strain component in 2-direction, dimensionless.

  • g12 (array_like) – Elastic engineering shear strain component in the 1-2 plane, dimensionless.

Returns:

  • s11 (numpy.ndarray) – Normal stress component in 1-direction in MPa.

  • s22 (numpy.ndarray) – Normal stress component in 2-direction in MPa.

  • s12 (numpy.ndarray) – Engineering shear stress component in the 1-2 plane in MPa.

class pylife.materiallaws.hookeslaw.HookesLaw3d(E, nu)[source]#

Apply isotropic Hooke’s law in three dimensions.

Parameters:
  • E (float) – Young’s modulus in MPa.

  • nu (float) – Poisson’s ratio, dimensionless. Must satisfy -1 <= nu <= 0.5.

Notes

Engineering shear strains g12, g13, and g23 are twice the corresponding tensor shear strains.

property E#

Return Young’s modulus.

Returns:

Young’s modulus in MPa.

Return type:

float

property G#

Return the shear modulus.

Returns:

Shear modulus in MPa.

Return type:

float

property K#

Return the bulk modulus.

Returns:

Bulk modulus in MPa.

Return type:

float

property nu#

Return Poisson’s ratio.

Returns:

Poisson’s ratio, dimensionless.

Return type:

float

strain(s11, s22, s33, s12, s13, s23)[source]#

Calculate three-dimensional elastic strain components.

Parameters:
  • s11 (array_like) – Normal stress component in 1-direction in MPa.

  • s22 (array_like) – Normal stress component in 2-direction in MPa.

  • s33 (array_like) – Normal stress component in 3-direction in MPa.

  • s12 (array_like) – Engineering shear stress component in the 1-2 plane in MPa.

  • s13 (array_like) – Engineering shear stress component in the 1-3 plane in MPa.

  • s23 (array_like) – Engineering shear stress component in the 2-3 plane in MPa.

Returns:

  • e11 (numpy.ndarray) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (numpy.ndarray) – Elastic normal strain component in 2-direction, dimensionless.

  • e33 (numpy.ndarray) – Elastic normal strain component in 3-direction, dimensionless.

  • g12 (numpy.ndarray) – Elastic engineering shear strain component in the 1-2 plane, dimensionless.

  • g13 (numpy.ndarray) – Elastic engineering shear strain component in the 1-3 plane, dimensionless.

  • g23 (numpy.ndarray) – Elastic engineering shear strain component in the 2-3 plane, dimensionless.

stress(e11, e22, e33, g12, g13, g23)[source]#

Calculate three-dimensional stress components.

Parameters:
  • e11 (array_like) – Elastic normal strain component in 1-direction, dimensionless.

  • e22 (array_like) – Elastic normal strain component in 2-direction, dimensionless.

  • e33 (array_like) – Elastic normal strain component in 3-direction, dimensionless.

  • g12 (array_like) – Elastic engineering shear strain component in the 1-2 plane, dimensionless.

  • g13 (array_like) – Elastic engineering shear strain component in the 1-3 plane, dimensionless.

  • g23 (array_like) – Elastic engineering shear strain component in the 2-3 plane, dimensionless.

Returns:

  • s11 (numpy.ndarray) – Normal stress component in 1-direction in MPa.

  • s22 (numpy.ndarray) – Normal stress component in 2-direction in MPa.

  • s33 (numpy.ndarray) – Normal stress component in 3-direction in MPa.

  • s12 (numpy.ndarray) – Engineering shear stress component in the 1-2 plane in MPa.

  • s13 (numpy.ndarray) – Engineering shear stress component in the 1-3 plane in MPa.

  • s23 (numpy.ndarray) – Engineering shear stress component in the 2-3 plane in MPa.