Beambending Reference

Main module containing the main class Beam, and auxiliary classes PointLoadH, PointLoadV, DistributedLoadH, and DistributedLoadV.

Example

>>> my_beam = Beam(9)
>>> my_beam.pinned_support = 2    # x-coordinate of the pinned support
>>> my_beam.rolling_support = 7  # x-coordinate of the rolling support
>>> my_beam.add_loads([PointLoadV(-20, 3)])  # 20 kN downwards, at x=3 m
>>> print("(F_Ax, F_Ay, F_By) =", my_beam.get_reaction_forces())
(F_Ax, F_Ay, F_By) = (0.0, 16.0, 4.0)

Beam

class beam.Beam(span: float = 10)[source]

Represents a one-dimensional beam that can take axial and tangential loads.

Through the method add_loads, a Beam object can accept a list of:

  • PointLoad objects, and/or

  • DistributedLoad objects.

Notes

  • The Beam class currently supports only statically determined beams with (exactly) one pinned and one roller support.

  • The default units package units for length, force and bending moment (torque) are respectively (m, kN, kN·m)

beam.Beam.add_loads(self, loads: list)

Apply an arbitrary list of (point- or distributed) loads to the beam.

Parameters
loadsiterable

An iterable containing DistributedLoad or PointLoad objects to be applied to the Beam object. Note that the load application point (or segment) must be within the Beam span.

beam.Beam.get_reaction_forces(self)

Calculates the reaction forces at the supports, given the applied loads.

The first and second values correspond to the horizontal and vertical forces of the pinned support. The third one is the vertical force at the rolling support.

Returns
F_Ax, F_Ay, F_By: (float, float, float)

reaction force components for pinned (x,y) and rolling (y) supports respectively.

beam.Beam.plot(self)

Generates a single figure with 4 plots corresponding respectively to:

  • a schematic of the loaded beam

  • normal force diagram,

  • shear force diagram, and

  • bending moment diagram.

These plots can be generated separately with dedicated functions.

Returns
figure~matplotlib.figure.Figure

Returns a handle to a figure with the 3 subplots: Beam schematic, shear force diagram, and bending moment diagram.

beam.Beam.plot_beam_diagram(self, ax=None)

Returns a schematic of the beam and all the loads applied on it.

beam.Beam.plot_normal_force(self, ax=None)

Returns a plot of the normal force as a function of the x-coordinate.

beam.Beam.plot_shear_force(self, ax=None)

Returns a plot of the shear force as a function of the x-coordinate.

beam.Beam.plot_bending_moment(self, ax=None)

Returns a plot of the bending moment as a function of the x-coordinate.

PointTorque

class beam.PointTorque(torque, coord)[source]

Point clockwise torque, described by a tuple of floats: (torque, coord).

Examples

>>> motor_torque = PointTorque(30, 4)  # 30 kN·m (clockwise) torque at x=4 m

PointLoad

class beam.PointLoadH(force, coord)[source]

Horizontal point load described by a tuple of floats: (force, coord).

Examples

>>> external_force = PointLoadH(10, 9)  # 10 kN towards the right at x=9 m
>>> external_force
PointLoadH(force=10, coord=9)
class beam.PointLoadV(force, coord)[source]

Vertical point load described by a tuple of floats: (force, coord).

Examples

>>> external_force = PointLoadV(-30, 3)  # 30 kN downwards at x=3 m
>>> external_force
PointLoadV(force=-30, coord=3)

DistributedLoad

class beam.DistributedLoadH(expr, span)[source]

Distributed horizontal load, described by its functional form and application interval.

Examples

>>> wind_load = DistributedLoadH("10*x**2+5", (1, 3))  # Quadratically growing load for 1<y<3
class beam.DistributedLoadV(expr, span)[source]

Distributed vertical load, described by its functional form and application interval.

Examples

>>> snow_load = DistributedLoadV("10*x+5", (0, 2))  # Linearly growing load for 0<x<2 m