.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/continuum_mechanics/constitutive_relations.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_continuum_mechanics_constitutive_relations.py: Constitutive Library Examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 5-8 .. code-block:: Python # sphinx_gallery_thumbnail_path = 'images/thumb/sphx_glr_constitutive_relations_thumb.png' .. GENERATED FROM PYTHON SOURCE LINES 9-12 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. .. GENERATED FROM PYTHON SOURCE LINES 12-17 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from simcoon import simmit as sim .. GENERATED FROM PYTHON SOURCE LINES 18-24 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. .. GENERATED FROM PYTHON SOURCE LINES 24-37 .. code-block:: Python 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) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 38-44 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. .. GENERATED FROM PYTHON SOURCE LINES 44-56 .. code-block:: Python 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) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 57-61 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. .. GENERATED FROM PYTHON SOURCE LINES 61-73 .. code-block:: Python 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) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 74-78 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. .. GENERATED FROM PYTHON SOURCE LINES 78-90 .. code-block:: Python 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) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 91-96 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. .. GENERATED FROM PYTHON SOURCE LINES 96-115 .. code-block:: Python 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)) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 116-119 M_isotrans ---------- Provides the elastic compliance tensor for a transverse isotropic material. .. GENERATED FROM PYTHON SOURCE LINES 119-126 .. code-block:: Python 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)) .. rst-class:: sphx-glr-script-out .. code-block:: none 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]] .. GENERATED FROM PYTHON SOURCE LINES 127-132 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. .. GENERATED FROM PYTHON SOURCE LINES 132-148 .. code-block:: Python 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)) .. rst-class:: sphx-glr-script-out .. code-block:: none 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. ]] .. GENERATED FROM PYTHON SOURCE LINES 149-152 M_ortho ------- Provides the elastic compliance tensor for an orthotropic material. .. GENERATED FROM PYTHON SOURCE LINES 152-158 .. code-block:: Python 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)) .. rst-class:: sphx-glr-script-out .. code-block:: none 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. ]] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.008 seconds) .. _sphx_glr_download_examples_continuum_mechanics_constitutive_relations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: constitutive_relations.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: constitutive_relations.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: constitutive_relations.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_