Package: beambending
BeamBending: a teaching aid for 1-D shear-force and bending-moment diagramsBeamBending isbothan educational moduleanda Python package, intended to serve as a teaching aid during a first course inStatics.
The aim of this module is to enhance clarity and provide visual hands-on examples while introducing the concepts of:stresses on slenderone-dimensionalsolids (i.e. beams)normal force, shear force and bending moment diagramsThepackage documentationincludes a simplified (but still rigorous enough) explanation of the background theory, inspired in [@Beer2017] and [@Bell2015].
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 byteachers 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 about how simple modifications to imposed loads affect the resulting reaction forces and internal stresses.The materials are distributed publicly and openly under a Creative Commons Attribution license,CC-BY 4.0Cite as:Carella, (2019). BeamBending: a teaching aid for 1-D shear force and bending moment diagrams. Journal of Open Source Education, 2(19), 65,https://doi.org/10.21105/jose.00065Statement of NeedStatics 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 thebackground theoryfrom a simple example with focus on connecting the mathematical description with the physical beam model (beambendingcode snippets are interleaved in order 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.Functionality and UsageA typical use case of thebeambendingpackage always involves creating an instance of theBeamclass. The class constructor takes an optionallengthargument, which defaults to 10 in case no argument is provided.frombeambendingimportBeambeam=Beam(9)# Initialize a Beam object of length 9mAfter aBeamobject 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 supportbeam.rolling_support=7# x-coordinate of the rolling supportNote that the Beam class currently supports only statically determined beams withexactlyone pinned and one roller support.Each load applied to the beam requires an instance of one of the load classesDistributedLoadH,DistributedLoadV,PointLoadH, orPointLoadV.
The load classes are simplynamedtuples, and make the resulting scripts easier to read by making the user's intention explicit.
The symbolic variablex, also defined by the module, is used for defining variable distributed loads.frombeambendingimportDistributedLoadV,PointLoadH,PointLoadV,xThe loads can be applied to theBeamby passing an iterable (list or tuple) to the methodadd_loads.beam.add_loads((PointLoadH(10,3),# 10kN pointing right, at x=3mPointLoadV(-20,3),# 20kN downwards, at x=3mDistributedLoadV(-10,(3,9)),# 10 kN/m, downward, for 3m <= x <= 9mDistributedLoadV(-20+x**2,(0,2)),# variable load, for 0m <= x <= 2m))After the problem is fully defined (beam length + placement of supports + loads), theplotmethod can me 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()Theplotmethod is actually a wrapper that combines these four methods:plot_beam_diagram,plot_normal_force,plot_shear_forceandplot_bending_momentinto a single A4-sized printer-friendly plot.The script above produces the following figure:You can read about this example in context in thedocumentation, or try it in a Jupyter notebook hosted online:For more sophisticated applications, like automatic problem generation, you should read thepackage documentation.Installing the packageIf you want to install thebeambendingpackage, you run this one-liner:pipinstall--userbeambendingNOTE: You need Python 3 to install this package (you may need to writepip3instead ofpip).The library dependencies are listed in the filerequirements.txt, but you only need to look at them if you clone the repository.
If you install the package viapip, the listed dependencies should be installed automatically.How to contribute to BeamBendingThe guidelines for contributing are specifiedhere.Copyright and License(c) 2018 Alfredo R. Carella. All content is under Creative Commons AttributionCC-BY 4.0.You are welcome to re-use this content in any way.