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.