Constitutive Library Examples

# sphinx_gallery_thumbnail_path = 'images/thumb/sphx_glr_constitutive_relations_thumb.png'

This example demonstrates how to compute isotropic, cubic, transverse isotropic, and orthotropic stiffness and compliance tensors using Simcoon. It also shows how to check symmetries and extract properties from each tensor.

import numpy as np
import matplotlib.pyplot as plt
from simcoon import simmit as sim

L_iso

Provides the elastic stiffness tensor for an isotropic material. The two first arguments are a couple of elastic properties. The third argument specifies which couple has been provided. Returns a NumPy ndarray.

E = 70000.0
nu = 0.3
L = sim.L_iso([E, nu], "Enu")
print("L_iso:\n", np.array_str(L, precision=2, suppress_small=True))

d = sim.check_symetries(L, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Properties:", d["props"])

x = sim.L_iso_props(L)
print("L_iso_props:", x)
L_iso:
 [[94230.77 40384.62 40384.62     0.       0.       0.  ]
 [40384.62 94230.77 40384.62     0.       0.       0.  ]
 [40384.62 40384.62 94230.77     0.       0.       0.  ]
 [    0.       0.       0.   26923.08     0.       0.  ]
 [    0.       0.       0.       0.   26923.08     0.  ]
 [    0.       0.       0.       0.       0.   26923.08]]
Symmetry type: ELISO
Properties: [[7.e+04]
 [3.e-01]]
L_iso_props: [[7.e+04]
 [3.e-01]]

M_iso

Provides the elastic compliance tensor for an isotropic material. The two first arguments are a couple of elastic properties. The third argument specifies which couple has been provided. Returns a NumPy ndarray.

M = sim.M_iso([E, nu], "Enu")
print("M_iso:\n", np.array_str(M, suppress_small=True))

L_inv = np.linalg.inv(M)
d = sim.check_symetries(L_inv, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Properties:", d["props"])

x = sim.M_iso_props(M)
print("M_iso_props:", x)
M_iso:
 [[ 0.00001429 -0.00000429 -0.00000429  0.          0.          0.        ]
 [-0.00000429  0.00001429 -0.00000429  0.          0.          0.        ]
 [-0.00000429 -0.00000429  0.00001429  0.          0.          0.        ]
 [ 0.          0.          0.          0.00003714  0.          0.        ]
 [ 0.          0.          0.          0.          0.00003714  0.        ]
 [ 0.          0.          0.          0.          0.          0.00003714]]
Symmetry type: ELISO
Properties: [[7.e+04]
 [3.e-01]]
M_iso_props: [[7.e+04]
 [3.e-01]]

L_cubic

Provides the elastic stiffness tensor for a cubic material. Arguments are the stiffness coefficients C11, C12, C44, or elastic constants E, nu, G.

G = 23000.0
L = sim.L_cubic([E, nu, G], "EnuG")
print("L_cubic:\n", np.array_str(L, precision=2, suppress_small=True))

d = sim.check_symetries(L, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Properties:", d["props"])

x = sim.L_cubic_props(L)
print("L_cubic_props:", x)
L_cubic:
 [[94230.77 40384.62 40384.62     0.       0.       0.  ]
 [40384.62 94230.77 40384.62     0.       0.       0.  ]
 [40384.62 40384.62 94230.77     0.       0.       0.  ]
 [    0.       0.       0.   23000.       0.       0.  ]
 [    0.       0.       0.       0.   23000.       0.  ]
 [    0.       0.       0.       0.       0.   23000.  ]]
Symmetry type: ELCUB
Properties: [[7.0e+04]
 [3.0e-01]
 [2.3e+04]]
L_cubic_props: [[7.0e+04]
 [3.0e-01]
 [2.3e+04]]

M_cubic

Provides the elastic compliance tensor for a cubic material. Arguments are the stiffness coefficients C11, C12, C44, or elastic constants E, nu, G.

M = sim.M_cubic([E, nu, G], "EnuG")
print("M_cubic:\n", np.array_str(M, suppress_small=True))

L = np.linalg.inv(M)
d = sim.check_symetries(L, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Properties:", d["props"])

x = sim.M_cubic_props(M)
print("M_cubic_props:", x)
M_cubic:
 [[ 0.00001429 -0.00000429 -0.00000429  0.          0.          0.        ]
 [-0.00000429  0.00001429 -0.00000429  0.          0.          0.        ]
 [-0.00000429 -0.00000429  0.00001429  0.          0.          0.        ]
 [ 0.          0.          0.          0.00004348  0.          0.        ]
 [ 0.          0.          0.          0.          0.00004348  0.        ]
 [ 0.          0.          0.          0.          0.          0.00004348]]
Symmetry type: ELCUB
Properties: [[7.0e+04]
 [3.0e-01]
 [2.3e+04]]
M_cubic_props: [[7.0e+04]
 [3.0e-01]
 [2.3e+04]]

L_isotrans

Provides the elastic stiffness tensor for a transverse isotropic material. Arguments: longitudinal modulus EL, transverse modulus ET, Poisson ratios nuTL, nuTT, shear modulus GLT, and axis of symmetry.

EL = 70000.0
ET = 20000.0
nuTL = 0.08
nuTT = 0.3
GLT = 12000.0
axis = 3

L = sim.L_isotrans([EL, ET, nuTL, nuTT, GLT], axis)
print("L_isotrans:\n", np.array_str(L, precision=2, suppress_small=True))

d = sim.check_symetries(L, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Axis:", d["axis"])
print("Properties:", np.array_str(d["props"], precision=2))

x = sim.L_isotrans_props(L, axis)
print("L_isotrans_props:", np.array_str(x, precision=2))
L_isotrans:
 [[22954.82  7570.21  8547.01     0.       0.       0.  ]
 [ 7570.21 22954.82  8547.01     0.       0.       0.  ]
 [ 8547.01  8547.01 74786.32     0.       0.       0.  ]
 [    0.       0.       0.    7692.31     0.       0.  ]
 [    0.       0.       0.       0.   12000.       0.  ]
 [    0.       0.       0.       0.       0.   12000.  ]]
Symmetry type: ELIST
Axis: 3
Properties: [[7.0e+04]
 [2.0e+04]
 [8.0e-02]
 [3.0e-01]
 [1.2e+04]]
L_isotrans_props: [[7.0e+04]
 [2.0e+04]
 [8.0e-02]
 [3.0e-01]
 [1.2e+04]]

M_isotrans

Provides the elastic compliance tensor for a transverse isotropic material.

M = sim.M_isotrans([EL, ET, nuTL, nuTT, GLT], axis)
print("M_isotrans:\n", np.array_str(M, suppress_small=True))

x = sim.M_isotrans_props(M, axis)
print("M_isotrans_props:", np.array_str(x, precision=2))
M_isotrans:
 [[ 0.00005    -0.000015   -0.000004    0.          0.          0.        ]
 [-0.000015    0.00005    -0.000004    0.          0.          0.        ]
 [-0.000004   -0.000004    0.00001429  0.          0.          0.        ]
 [ 0.          0.          0.          0.00013     0.          0.        ]
 [ 0.          0.          0.          0.          0.00008333  0.        ]
 [ 0.          0.          0.          0.          0.          0.00008333]]
M_isotrans_props: [[7.0e+04]
 [2.0e+04]
 [8.0e-02]
 [3.0e-01]
 [1.2e+04]]

L_ortho

Provides the elastic stiffness tensor for an orthotropic material. Arguments: Young moduli E1, E2, E3; Poisson ratios nu12, nu13, nu23; shear moduli G12, G13, G23; or alternatively the list of Cii coefficients.

E_1, E_2, E_3 = 4500.0, 2300.0, 2700.0
nu_12, nu_13, nu_23 = 0.06, 0.08, 0.3
G_12, G_13, G_23 = 2200.0, 2100.0, 2400.0

L = sim.L_ortho([E_1, E_2, E_3, nu_12, nu_13, nu_23, G_12, G_13, G_23], "EnuG")
print("L_ortho:\n", np.array_str(L, precision=2, suppress_small=True))

d = sim.check_symetries(L, 1.0e-2)
print("Symmetry type:", d["umat_type"])
print("Axis:", d["axis"])
print("Properties:", np.array_str(d["props"], precision=2))

x = sim.L_ortho_props(L)
print("L_ortho_props:", np.array_str(x, precision=2, suppress_small=True))
L_ortho:
 [[4537.59  228.65  298.33    0.      0.      0.  ]
 [ 228.65 2583.23  920.72    0.      0.      0.  ]
 [ 298.33  920.72 3038.57    0.      0.      0.  ]
 [   0.      0.      0.   2200.      0.      0.  ]
 [   0.      0.      0.      0.   2100.      0.  ]
 [   0.      0.      0.      0.      0.   2400.  ]]
Symmetry type: ELORT
Axis: 0
Properties: [[4.5e+03]
 [2.3e+03]
 [2.7e+03]
 [6.0e-02]
 [8.0e-02]
 [3.0e-01]
 [2.2e+03]
 [2.1e+03]
 [2.4e+03]]
L_ortho_props: [[4500.  ]
 [2300.  ]
 [2700.  ]
 [   0.06]
 [   0.08]
 [   0.3 ]
 [2200.  ]
 [2100.  ]
 [2400.  ]]

M_ortho

Provides the elastic compliance tensor for an orthotropic material.

M = sim.M_ortho([E_1, E_2, E_3, nu_12, nu_13, nu_23, G_12, G_13, G_23], "EnuG")
print("M_ortho:\n", np.array_str(M, suppress_small=True))

x = sim.M_ortho_props(M)
print("M_ortho_props:", np.array_str(x, precision=4, suppress_small=True))
M_ortho:
 [[ 0.00022222 -0.00001333 -0.00001778  0.          0.          0.        ]
 [-0.00001333  0.00043478 -0.00013043  0.          0.          0.        ]
 [-0.00001778 -0.00013043  0.00037037  0.          0.          0.        ]
 [ 0.          0.          0.          0.00045455  0.          0.        ]
 [ 0.          0.          0.          0.          0.00047619  0.        ]
 [ 0.          0.          0.          0.          0.          0.00041667]]
M_ortho_props: [[4500.  ]
 [2300.  ]
 [2700.  ]
 [   0.06]
 [   0.08]
 [   0.3 ]
 [2200.  ]
 [2100.  ]
 [2400.  ]]

Total running time of the script: (0 minutes 0.008 seconds)

Gallery generated by Sphinx-Gallery