exs_beam1

Purpose:

Analysis of a simply supported beam.

Description:

Consider a beam with the length \(9.0\) m. The beam is simply supported and loaded by a point load \(P=10000\) N applied at a point \(3.0\) m from the left support. The corresponding computational model has six degrees of freedom and consists of two beam elements with four degrees of freedom. The beam has Young’s modulus \(E=210\) GPa and moment of inertia \(I=2510 \times 10^{-8}\) m⁴.

_images/exs5_1.svg
_images/exs5_2.svg
Example:

The computation is initialized by importing CALFEM and NumPy. The element topology matrix contains only the degrees of freedom for each element:

import numpy as np
import matplotlib.pyplot as plt
import calfem.core as cfc
import calfem.utils as cfu
import calfem.vis_mpl as cfv

edof = np.array([
    [1, 2, 3, 4],
    [3, 4, 5, 6]
])

The global stiffness matrix K and load vector f are initialized. The point load P = 10000 N is applied at DOF 3:

K = np.array(np.zeros((6, 6)))
f = np.array(np.zeros((6, 1)))
f[2] = -10e3

The material and geometric properties are defined, along with element coordinates and stiffness matrices:

E = 210e9
I = 2510e-8

ep = np.array([E, I])
ex1 = np.array([0, 3])
ex2 = np.array([3, 9])
eq1 = np.array([0])
eq2 = np.array([0])

Ke1 = cfc.beam1e(ex1, ep)
Ke2 = cfc.beam1e(ex2, ep)

cfu.disp_h2("Ke1")
cfu.disp_array(Ke1, tablefmt='plain')
cfu.disp_h2("Ke2")
cfu.disp_array(Ke2, tablefmt='plain')

Based on the topology information, the global stiffness matrix can be generated by assembling the element stiffness matrices.

cfc.assem(edof[0, :], K, Ke1)
cfc.assem(edof[1, :], K, Ke2)

The system of equations is solved by defining boundary conditions and using solveq():

bc_dofs = np.array([1, 5])
bc_vals = np.array([0.0, 0.0])
a, r = cfc.solveq(K, f, bc_dofs, bc_vals)

cfu.disp_array(a, ["a"])
cfu.disp_array(r, ["r"])

The section forces and element displacements are calculated from global displacements:

ed = cfc.extract_ed(edof, a)

es1, ed1, ec1 = cfc.beam1s(ex1, ep, ed[0, :], eq1, nep=4)
es2, ed2, ec2 = cfc.beam1s(ex2, ep, ed[1, :], eq2, nep=7)

cfu.disp_h2("es1")
cfu.disp_array(es1, ["V1", "M1"])
cfu.disp_h2("ed1")
cfu.disp_array(ed1, ["v1"])
cfu.disp_h2("ec1")
cfu.disp_array(ec1, ["x1"])
cfu.disp_h2("es2")
cfu.disp_array(es2, ["V2", "M2"])
cfu.disp_h2("ed2")
cfu.disp_array(ed2, ["v2"])
cfu.disp_h2("ec2")
cfu.disp_array(ec2, ["x2"])

Results:

The solution shows the expected behavior for a simply supported beam with a point load:

  • Maximum deflection: 22.8 mm at the loading point (DOF 3)

  • Support reactions: 6667 N at left support, 3333 N at right support

  • Maximum shear force: 6667 N (in element 1)

  • Maximum moment: 20000 Nm (at the loading point)

Visualization of the results using matplotlib:

cfv.figure(1)
plt.plot([0, 9], [0, 0], color=(0.8, 0.8, 0.8))
plt.plot(
    np.concatenate(([0], ec1[:, 0], 3 + ec2[:, 0], [9]), 0),
    np.concatenate(([0], ed1[:, 0], ed2[:, 0], [0]), 0),
    color=(0.0, 0.0, 0.0),
)
cfv.title("displacements")

# ----- Draw shear force diagram----------------------------------

cfv.figure(2)
plt.plot([0, 9], [0, 0], color=(0.8, 0.8, 0.8))
plt.plot(
    np.concatenate(([0], ec1[:, 0], 3 + ec2[:, 0], [9]), 0),
    -np.concatenate(([0], es1[:, 0], es2[:, 0], [0]), 0) / 1000,
    color=(0.0, 0.0, 0.0),
)
cfv.title("shear force")

# ----- Draw moment diagram----------------------------------

cfv.figure(3)
plt.plot([0, 9], [0, 0], color=(0.8, 0.8, 0.8))
plt.plot(
    np.concatenate(([0], ec1[:, 0], 3 + ec2[:, 0], [9]), 0),
    -np.concatenate(([0], es1[:, 1], es2[:, 1], [0]), 0) / 1000,
    color=(0.0, 0.0, 0.0),
)
cfv.title("bending moment")

cfv.show_and_wait()
_images/exs5_3.svg
_images/exs5_4.svg
_images/exs5_5.svg