.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/trusses/plot_truss01.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_auto_examples_trusses_plot_truss01.py: ========================== Simple triangular truss. ========================== The system is statically determined and allows for easy validation of calculated deformation, reactions and internal forces. Author: Peter Mackenzie-Helnwein .. GENERATED FROM PYTHON SOURCE LINES 14-15 Setup .. GENERATED FROM PYTHON SOURCE LINES 15-22 .. code-block:: Python from femedu.examples import Example from femedu.domain import System, Node from femedu.elements.linear import Truss from femedu.materials import FiberMaterial .. GENERATED FROM PYTHON SOURCE LINES 23-24 Create the example by subclassing the :py:class:`Example` .. GENERATED FROM PYTHON SOURCE LINES 24-65 .. code-block:: Python class ExampleTruss01(Example): def problem(self): # initialize a system model B = 6.0 * 12 H = 3.0 * 12 params = {'E': 10., 'A': 1., 'nu': 0.0, 'fy': 1.e30} model = System() # create nodes nd0 = Node(0.0, 0.0) nd1 = Node( B, 0.0) nd2 = Node(0.5*B, H) model.addNode(nd0, nd1, nd2) # create elements model.addElement(Truss(nd0, nd1, FiberMaterial(params))) # bottom 1 model.addElement(Truss(nd0, nd2, FiberMaterial(params))) # up right diag 1 model.addElement(Truss(nd1, nd2, FiberMaterial(params))) # up left diag 1 # define support(s) nd0.fixDOF('ux', 'uy') # pin support left end nd1.fixDOF('uy') # roller support right end # add loads # .. load only the upper nodes nd2.setLoad([0.0, -1.0], ('ux', 'uy')) # analyze the model model.solve() # write out report model.report() # create plots model.plot(factor=1., filename="truss01_deformed.png") model.beamValuePlot('f',filename="truss01_forces.png") .. GENERATED FROM PYTHON SOURCE LINES 79-81 Run the example by creating an instance of the problem and executing it by calling :py:meth:`Example.run()` .. GENERATED FROM PYTHON SOURCE LINES 81-86 .. code-block:: Python if __name__ == "__main__": ex = ExampleTruss01() ex.run() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/trusses/images/sphx_glr_plot_truss01_001.png :alt: Deformed System (magnification=1.00) :srcset: /auto_examples/trusses/images/sphx_glr_plot_truss01_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/trusses/images/sphx_glr_plot_truss01_002.png :alt: Axial Forces :srcset: /auto_examples/trusses/images/sphx_glr_plot_truss01_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none System Analysis Report ======================= Nodes: --------------------- Node_0: x: [0.000 0.000] fix: ['ux', 'uy'] u: [0.000 0.000] Node_1: x: [72.000 0.000] fix: ['uy'] u: [3.600 0.000] Node_2: x: [36.000 36.000] P: [0.000 -1.000] u: [1.800 -6.891] Elements: --------------------- Truss: Node_0 to Node_1: material properties: FiberMaterial(Material)({'E': 10.0, 'A': 1.0, 'nu': 0.0, 'fy': 1e+30}) strain:0.04999999999999999 stress:{'xx': np.float64(0.4999999999999999), 'yy': 0.0, 'zz': 0.0, 'xy': 0.0} internal force: 0.4999999999999999 Truss: Node_0 to Node_2: material properties: FiberMaterial(Material)({'E': 10.0, 'A': 1.0, 'nu': 0.0, 'fy': 1e+30}) strain:-0.07071067811865474 stress:{'xx': np.float64(-0.7071067811865474), 'yy': 0.0, 'zz': 0.0, 'xy': 0.0} internal force: -0.7071067811865474 Truss: Node_1 to Node_2: material properties: FiberMaterial(Material)({'E': 10.0, 'A': 1.0, 'nu': 0.0, 'fy': 1e+30}) strain:-0.07071067811865472 stress:{'xx': np.float64(-0.7071067811865472), 'yy': 0.0, 'zz': 0.0, 'xy': 0.0} internal force: -0.7071067811865472 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.637 seconds) .. _sphx_glr_download_auto_examples_trusses_plot_truss01.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_truss01.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_truss01.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_truss01.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_