BeamBending: a teaching aid for 1-D shear force and bending moment diagrams

• teachers who want to automatically create problem sets with their solutions (easily scriptable, random-problem-generator friendly); • students who want to verify their solutions to introductory problem sets; • students who like to play with example problems and receive immediate visual feedback (i.e. about how simple modifications to imposed loads affect the resulting reaction forces and internal stresses).

• stresses on slender one-dimensional solids (i.e. beams) • normal force, shear force, and bending moment diagrams The package documentation includes a simple (but still rigorous enough) explanation of the background theory, inspired in Beer, Russell Johnston, Dewolf, & Mazurek (2017) and Bell (2015). It is assumed that the students understand static equilibrium of flat rigid bodies, but a short recap is provided. Code snippets that reproduce the theory examples are presented next to each result.
The package can be used by • teachers who want to automatically create problem sets with their solutions (easily scriptable, random-problem-generator friendly); • students who want to verify their solutions to introductory problem sets; • students who like to play with example problems and receive immediate visual feedback (i.e. about how simple modifications to imposed loads affect the resulting reaction forces and internal stresses).
The beambending package is ready for installation using pip or can be tested online using the provided Jupyter notebook.

Statement of Need
Statics courses in undergraduate engineering programs are sometimes taught before the knowledge of the relevant mathematical tools (i.e. simple calculus and linear vector algebra) is fully mature. Introducing a topic that resembles the mindset of calculus and employs an unintuitive standard sign convention, on top of a wobbly mathematical foundation, makes it fairly common for students to get lost in the calculations.
This package/module aims to bridge this gap and simplify students' first contact with this challenging new topic by working on two fronts simultaneously: • Explain the background theory from a simple example with focus on connecting the mathematical description with the physical beam model (beambending code snippets are interleaved to illustrate how the package works). • Provide a temporary scaffolding that helps to establish an immediate visual association between beam load states and internal stresses.
Several online tools with similar functionality are currently available, such as Beam Guru (2019) This feature comparison is presented in Table 1.
There are three main differences between the beambending package and the rest of the reviewed tools: • Arbitrary distributed load functions are accepted (as long as sympy can parse them), i.e. they are not restricted to constants or linear functions. • The package (and parts of it) can be called from regular Python code, which makes it easy to automatically generate problem sets with solutions. • It is not only free but also completely open-source.

Functionality and Usage
A typical use case of the beambending package always involves creating an instance of the Beam class. The class constructor takes an optional length argument, which defaults to 10 in case no argument is provided.

from beambending import Beam beam = Beam(9) # Initialize a Beam object of length 9m
After a Beam object is created, the properties corresponding to the x-coordinates of the pinned and rolling supports must be defined.
beam.pinned_support = 2 # x-coordinate of the pinned support beam.rolling_support = 7 # x-coordinate of the rolling support Note that the Beam class currently supports only statically determined beams with (exactly) one pinned and one roller support.
Each load applied to the beam requires an instance of one of the load classes Distribut edLoadH, DistributedLoadV, PointLoadH, or PointLoadV. The load classes are simply namedtuples, and make the resulting scripts easier to read by making the user's intention explicit. The symbolic variable x, also defined by the module, is used for defining variable distributed loads.
from beambending import DistributedLoadV, PointLoadH, PointLoadV, x The loads can be applied to the Beam by passing an iterable (list or tuple) to the method add_loads.  -10, (3, 9)), # Variable load, for 0m <= x <= 2m DistributedLoadV(-20 + x**2, (0, 2)), )) After the problem is fully defined (beam length + placement of supports + loads), the plot method can be invoked to plot a sketch of the loaded beam together with its corresponding load diagrams (normal force, shear force and bending moment).

fig = beam.plot()
The plot method is actually a wrapper that combines these four methods: plot_beam _diagram, plot_normal_force, plot_shear_force and plot_bending_moment into a single A4-sized printer-friendly plot.

Example
The following example, provided within the package documentation, summarizes the explanation above. The output is shown in Figure 1.

Recent Uses
The beambending package was developed as a teaching aid for the Statics course in the Autumn 2019 semester at OsloMet -Oslo Metropolitan University. Beta versions were tried and commented by students during the Autumn 2018 semester, but the effectiveness of the tool has not been tested with large groups of students yet.