.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/frames/plot_frame02.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_frames_plot_frame02.py: ====================================================== Buckling of a vertical beam with pin-pin support ====================================================== modeled using a 2D frame element .. code:: | | P v x o ... support I x ... node I x ... node ^ ... support x ..... node I ... frame element <-- ... applied force ^ ..... pin support o ..... roller support degrees of freedom: 0 ... horizontal displacement 1 ... vertical displacement 2 ... rotation, theta .. list-table:: setting given parameters * - N = 2 - number of elements * - L = 100.0 - column length * - EA = 2000000.0 - axial stiffness * - EI = 21000.0 - flexural stiffness * - w = 0.1 - applied lateral load Author: Peter Mackenzie-Helnwein .. GENERATED FROM PYTHON SOURCE LINES 47-116 .. code-block:: Python from femedu.examples.Example import * from femedu.domain import * from femedu.solver.NewtonRaphsonSolver import * from femedu.elements.finite.Frame2D import * from femedu.materials.ElasticSection import * class ExampleFrame02(Example): def problem(self): # initialize a system model N = 8 # number of elements L = 100.0 E = 20000. EA = 2000000.0 EI = 210000.0 w = -0.1 params = {'E': E, 'A': EA/E, 'I': EI/E} model = System() model.setSolver(NewtonRaphsonSolver()) # create nodes nd0 = Node(0.0, 0.0) model += nd0 ndi = nd0 for i in range(N): # nodes ndj = Node( 0.0, (i+1)*L/N ) model += ndj # elements elem = Frame2D(ndi, ndj, ElasticSection(params)) elem.setDistLoad(w) model += elem ndi = ndj # define support(s) nd0.fixDOF('ux', 'uy') # horizontal and vertical support bottom end ndi.fixDOF('ux') # horizontal support top end # add loads # .. load only the upper nodes Pcr = np.pi**2 * EI / L**2 ndi.setLoad((-0.5*Pcr,), ('uy',)) # show model information print(model) model.solve(verbose=True) model.report() model.plot(factor=10.0, filename="frame2_deformed.png") model.beamValuePlot("F", filename="frame2_force.png") model.beamValuePlot("V", filename="frame2_shear.png") model.beamValuePlot("M", filename="frame2_moment.png") return .. GENERATED FROM PYTHON SOURCE LINES 158-160 Run the example by creating an instance of the problem and executing it by calling :py:meth:`Example.run()` .. GENERATED FROM PYTHON SOURCE LINES 160-166 .. code-block:: Python if __name__ == "__main__": ex = ExampleFrame02() ex.run() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/frames/images/sphx_glr_plot_frame02_001.png :alt: Deformed System (magnification=10.00) :srcset: /auto_examples/frames/images/sphx_glr_plot_frame02_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/frames/images/sphx_glr_plot_frame02_002.png :alt: Axial Forces :srcset: /auto_examples/frames/images/sphx_glr_plot_frame02_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/frames/images/sphx_glr_plot_frame02_003.png :alt: Shear Forces :srcset: /auto_examples/frames/images/sphx_glr_plot_frame02_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/frames/images/sphx_glr_plot_frame02_004.png :alt: Bending Moment :srcset: /auto_examples/frames/images/sphx_glr_plot_frame02_004.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none System object Node_186(x=[0 0], u=None) Node_187(x=[0 12.5], u=None) Node_188(x=[0 25], u=None) Node_189(x=[0 37.5], u=None) Node_190(x=[0 50], u=None) Node_191(x=[0 62.5], u=None) Node_192(x=[0 75], u=None) Node_193(x=[0 87.5], u=None) Node_194(x=[0 100], u=None) Frame2D(Node_186, Node_187, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_187, Node_188, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_188, Node_189, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_189, Node_190, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_190, Node_191, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_191, Node_192, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_192, Node_193, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) Frame2D(Node_193, Node_194, ElasticSection(Material)({'E': 20000.0, 'A': 100.0, 'I': 10.5, 'nu': 0.0, 'fy': 1e+30})) norm of the out-of-balance force: 1.0370e+02 norm of the out-of-balance force: 1.6462e+00 norm of the out-of-balance force: 8.2530e-11 + System Analysis Report ======================= Nodes: --------------------- Node_186: x: [0.000 0.000] fix: ['ux', 'uy'] u: [0.000 0.000 -0.039] Node_187: x: [0.000 12.500] u: [0.479 -0.001 -0.036] Node_188: x: [0.000 25.000] u: [0.882 -0.001 -0.027] Node_189: x: [0.000 37.500] u: [1.149 -0.002 -0.015] Node_190: x: [0.000 50.000] u: [1.242 -0.003 -0.000] Node_191: x: [0.000 62.500] u: [1.149 -0.003 0.015] Node_192: x: [0.000 75.000] u: [0.882 -0.004 0.027] Node_193: x: [0.000 87.500] u: [0.479 -0.005 0.036] Node_194: x: [0.000 100.000] fix: ['ux'] P: [0.000 -103.631 0.000] u: [0.000 -0.005 0.039] Elements: --------------------- Frame2D_298: nodes ( Node_186 Node_187 ) material: ElasticSection internal forces: f0=-103.63 V0=4.38 M0=1.30 fl=-103.63 Vl=4.38 Ml=105.64 Pw=-0.62 Mw=-1.30 Frame2D_299: nodes ( Node_187 Node_188 ) material: ElasticSection internal forces: f0=-103.63 V0=3.13 M0=105.64 fl=-103.63 Vl=3.13 Ml=186.45 Pw=-0.62 Mw=-1.30 Frame2D_300: nodes ( Node_188 Node_189 ) material: ElasticSection internal forces: f0=-103.63 V0=1.88 M0=186.45 fl=-103.63 Vl=1.88 Ml=237.56 Pw=-0.62 Mw=-1.30 Frame2D_301: nodes ( Node_189 Node_190 ) material: ElasticSection internal forces: f0=-103.63 V0=0.63 M0=237.56 fl=-103.63 Vl=0.63 Ml=255.04 Pw=-0.62 Mw=-1.30 Frame2D_302: nodes ( Node_190 Node_191 ) material: ElasticSection internal forces: f0=-103.63 V0=-0.62 M0=255.04 fl=-103.63 Vl=-0.62 Ml=237.56 Pw=-0.62 Mw=-1.30 Frame2D_303: nodes ( Node_191 Node_192 ) material: ElasticSection internal forces: f0=-103.63 V0=-1.87 M0=237.56 fl=-103.63 Vl=-1.87 Ml=186.45 Pw=-0.62 Mw=-1.30 Frame2D_304: nodes ( Node_192 Node_193 ) material: ElasticSection internal forces: f0=-103.63 V0=-3.12 M0=186.45 fl=-103.63 Vl=-3.12 Ml=105.64 Pw=-0.62 Mw=-1.30 Frame2D_305: nodes ( Node_193 Node_194 ) material: ElasticSection internal forces: f0=-103.63 V0=-4.37 M0=105.64 fl=-103.63 Vl=-4.37 Ml=1.30 Pw=-0.62 Mw=-1.30 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.108 seconds) .. _sphx_glr_download_auto_examples_frames_plot_frame02.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_frame02.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_frame02.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_frame02.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_