Example 103 “Zweibock” (with imperfection)#

This model contains two trusses and three nodes. The left and right end nodes are fixed, whereas on the top middle node a reference force is applied in negative z-direction. A second version contains 2 DOF (x,z at node 2) with a geometric imperfection at node 2. The model may be generated with the following code and is shown in the undeformed state.

MyBinder Colab

!pip install trusspy
import trusspy as tp

M1 = tp.Model(logfile=False)

with M1.Nodes as MN:
    MN.add_node(1, coord=(0, 0, 0))
    MN.add_node(2, coord=(1, 0, 3))
    MN.add_node(3, coord=(2, 0, 0))

with M1.Elements as ME:
    ME.add_element(1, conn=(1, 2), gprop=[1])
    ME.add_element(2, conn=(2, 3), gprop=[1])

    E = 1  # elastic modulus
    ME.assign_material("all", [E])

with M1.Boundaries as MB:
    MB.add_bound_U(1, (0, 0, 0))
    MB.add_bound_U(2, (0, 0, 1))
    MB.add_bound_U(3, (0, 0, 0))

with M1.ExtForces as MF:
    MF.add_force(2, (0, 0, -1))

M1.Settings.incs = 150
M1.Settings.du = 0.01
M1.Settings.dlpf = 0.01
M1.Settings.xlimit = (1, 10)
M1.Settings.dlpf
M1.Settings.stepcontrol = True
M1.Settings.maxfac = 10

The calculation of the deformation process is started by calling the build() and run() methods.

M1.build()
fig, ax = M1.plot_model(inc=0)
# Model Summary
Analysis Dimension      "ndim": 3
Number of Nodes       "nnodes": 3
Number of Elements    "nelems": 2
 
System DOF              "ndof": 9
active DOF             "ndof1": 1
locked DOF             "ndof2": 8
 
active DOF          "nproDOF1": [5]
fixed  DOF          "nproDOF0": [0 1 2 3 4 6 7 8]
../../_images/976ce46772d455f9930e1e3bff01480a6a7882d1d4b099f96081849afa9a2c3b.png
M1.run()
fig, ax = M1.plot_model(view="xz", contour="force", force_scale=2, inc=20)
../../_images/e27ba136be78dc35d801a86970045ba4fab6de06f46cec2908b4600903f4fdf3.png
fig1, ax1 = M1.plot_history(nodes=[2, 2], X="Displacement X", Y="Displacement Z")
../../_images/0c77bc04a0901260591a3997644f95f7b0041e68f5b788d740cbf4512254c6b5.png
fig2, ax2 = M1.plot_history(nodes=[2, 2], X="Displacement Z", Y="LPF")
../../_images/c7ad53549d44b5508e1bf9d3bbfaf0e8473282e3e8d52989efcf64c4f3ff7a84.png

Geometric imperfection#

Let’s re-run the model with a geometric imperfection at node 2 (misalignment dx=0.1). Results are plotted for Node 2 as a History Plot of z-displacement vs. LPF and x-displacement vs. z-displacement.

M2 = tp.Model(logfile=False)

with M2.Nodes as MN:
    MN.add_node(1, coord=(0, 0, 0))
    MN.add_node(2, coord=(1.1, 0, 3))
    MN.add_node(3, coord=(2, 0, 0))

with M2.Elements as ME:
    ME.add_element(1, conn=(1, 2), gprop=[1])
    ME.add_element(2, conn=(2, 3), gprop=[1])

    E = 1  # elastic modulus
    ME.assign_material("all", [E])

with M2.Boundaries as MB:
    MB.add_bound_U(1, (0, 0, 0))
    MB.add_bound_U(2, (1, 0, 1))
    MB.add_bound_U(3, (0, 0, 0))

with M2.ExtForces as MF:
    MF.add_force(2, (0, 0, -1))

M2.Settings.incs = 150
M2.Settings.du = 0.01
M2.Settings.dlpf = 0.01
M2.Settings.xlimit = (2, 10)
M2.Settings.dlpf
M2.Settings.stepcontrol = True
M2.Settings.maxfac = 10
M2.build()
M2.run()
fig, ax = M2.plot_model(lim_scale=(-1, 4, -1, 4), inc=0)
../../_images/d0987aaca594a1b8bbf936792bf8afbe29d7158ebeff534b17ca3ea8734d539c.png
fig, ax = M2.plot_model(
    view="xz", contour="force", lim_scale=(-1, 4, -1, 4), force_scale=10, inc=40
)
../../_images/5e46af1bf0d8f49be1b8aa3184b86b1f08fad17a6ae4c6ff30453fd1e9eae697.png
fig2, ax2 = M2.plot_history(nodes=[2, 2], X="Displacement Z", Y="LPF", fig=fig2, ax=ax2)
ax2.legend(["Node 2: basic model (nDOF=1)", "Node 2: imperfection (nDOF=2)"])
fig2
../../_images/8dfa9c2f0f5d601e4abdd1980dc1dfc2ca231d02c1c8ac10949e4e9b31236114.png
<Figure size 800x600 with 0 Axes>
fig1, ax1 = M2.plot_history(
    nodes=[2, 2], X="Displacement X", Y="Displacement Z", fig=fig1, ax=ax1
)
ax1.legend(["Node 2: basic model (nDOF=1)", "Node 2: imperfection (nDOF=2)"])
fig1
../../_images/d42e9c6f0bd8ec2e6d08e217e86670587bf52e15f3004e0e8b0ceff2df483095.png
<Figure size 800x600 with 0 Axes>
M2.plot_movie(view="xz", contour="force", lim_scale=(-1, 4, -1, 4), force_scale=10)

Movie