Skip to main content

Indeterminate Beam

Version License DOI Documentation Status Build Status CodeFactor Colab Binder Website Downloads

IndeterminateBeam is a Python Package aiming to serve as a foundation for civil and structural engineering projects in Python. The module can also serve as a stand-alone program and is useful for determining:

  • reaction forces for indeterminate beams
  • internal forces for indeterminate beams (shear, bending, axial)
  • deflections of beams due to resulting forces
  • axial force, shear force, bending moment and deflection diagrams.
  • Euler-Bernoulli or Timoshenko beam deflections

The package is based mainly on engineering concepts of statics as described in (Hibbeler, 2013), and Python packages Sympy (Meurer et al., 2017) and Plotly (Plotly Technologies Inc, 2015).

The package documentation provides a brief overview of the theory behind the solutions used to calculate the forces on the indeterminate beam. The full package documentation can be accessed here.

Text-based examples of the package presented in the documentation can be found on this Jupyter Notebook and a web-based graphical user interface (GUI) is available at https://indeterminatebeam.onrender.com .

Getting Started Video

Getting Started

Project Purpose

The purpose of this project is two-fold:

  1. Create a free website that has more features than paid and free beam calculators that exist on the web.
  2. Provide a foundation for civil and structural engineers who want to create higher order engineering Python programs.

Several (mostly paid) beam calculator websites currently exist online, providing the same service as this package, with web traffic in the hundreds of thousands per month (Similiarweb, 2021). Despite this, no online service exists (to the authors knowledge) that has all the features of IndeterminateBeam and is also free.

Similiarly, there are no well-documented indeterminate beam solving Python packages (to the authors knowledge) despite the importance of such a calculation in engineering. Several python finite element analysis (FEA) packages do exist, however they are vastly overcomplicated for someone wanting to only solve for forces on a one-dimensional beam.

This python package was heavily inspired by beambending (Carella, 2019), a module created for educational purposes by Alfredo Carella of the Oslo Metropolitan University. The beambending module, although well documented, can only solve for simply supported beams consisting of a pin and roller support. The package documentation for this project includes a more rigorous overview of the theory behind the basics for solving determinate structures.

Functionality and Usage

A typical use case of the IndeterminateBeam package involves the following steps:

  1. Create a Beam object
  2. Create Support objects and assign to Beam
  3. Create Load objects and assign to Beam
  4. Solve for forces on Beam object
  5. Plot results

You can follow along with the example below in this web-based Jupyter Notebook. Alternatively, you can download the jupyter-notebook for this example here, or the python file for this code here.

The units used throughout the Python package are the base SI units (newtons and metres), but can be updated using the update_units method. Units and load direction conventions are described in the package documentation.

Creating a Beam

The creation of a Beam instance involves the input of the beam length (m) and optionally the input of the Young's modulus (E), second moment of area (I), shear modulus (G) and cross-sectional area (A). E, I, G and A are optional and by default are the properties of a steel 150UB18.0 (except G which is infinity). For a beam with constant properties, these parameters will only affect the deflections calculated and not the distribution of forces, unless spring supports are specified. If G is not specified an infinite shear stiffness is used which corresponds to the Euler-Bernoulli beam method. If G is finite then timoshenko beam theory is applied and shear deformations are considered.

from indeterminatebeam import Beam
# Create 7 m beam with E, I, A as defaults
beam = Beam(7)                          
# Create 9 m beam with E, I, and A assigned by user
beam_2 = Beam(9, E=2000, I=10**6, A=3000)     

Defining Supports

Support objects are created separately from the Beam object, and are defined by an x-coordinate (m) and the beams translational and rotational degrees of freedom.

Degrees of freedom are represented by a tuple of 3 booleans, representing the x , y , and m directions respectively. A 1 indicates the support is fixed in a direction and a 0 indicates it is free.

Optionally, stiffness can be specified in either of the translational directions, which overrides the boolean specified.

from indeterminatebeam import Support
# Defines a pin support at location x = 5 m  
a = Support(5, (1,1,0))      
# Defines a roller support at location x = 0 m
b = Support(0, (0,1,0))      
# Defines a fixed support at location x = 7 m
c = Support(7, (1,1,1))      
# Assign the support objects to a beam object created earlier
beam.add_supports(a,b,c)    

Defining loads

Load objects are created separately from the Beam object, and are generally defined by a force value and then a coordinate value, however this varies slightly for different types of loading classes.

from indeterminatebeam import PointLoadV, PointTorque, DistributedLoadV
# Create a 1000 N point load at x = 2 m
load_1 = PointLoadV(1000, 2)
# Create a 2000 N/m UDL from x = 1 m to x = 4 m
load_2 = DistributedLoadV(2000, (1, 4))
# Defines a 2 kN.m point torque at x = 3.5 m
load_3 = PointTorque(2*10**3, 3.5)
# Assign the load objects to the beam object
beam.add_loads(load_1,load_2,load_3)

Solving for Forces

Once the Beam object has been assigned with Load and Support objects it can then be solved. To solve for reactions and internal forces we call the analyse function.

beam.analyse()  

Plotting results

After the beam has been analysed we can plot the results.

fig_1 = beam.plot_beam_external()
fig_1.show()

fig_2 = beam.plot_beam_internal()
fig_2.show()

The plot_beam_external and plot_beam_internal methods collate otherwise seperate plots.

The script above produces the following figures: example_1 beam diagram plot example_1 beam internal plot

Exporting results

After the beam has been analysed we can also export the results as table.

We can choose to print the table or export as a csv file.

# print results as a table with 10 points
beam.print_results_table(num_points=10)

# export as a csv with 100 points
beam.export_results_csv(filename="beam_results.csv", num_points=100)

Installing the package

If you want to install the indeterminatebeam package, you run this one-liner:

pip install indeterminatebeam

NOTE: You need Python 3 to install this package (you may need to write pip3 instead of pip).

The library dependencies are listed in the file requirements.txt, but you only need to look at them if you clone the repository. If you install the package via pip, the listed dependencies should be installed automatically.

Future Work

The following are areas that can be implemented in future:

  • allow for segmental beam properties (E,I,A)
  • calculate axial deflections
  • Latex or PDF output of calculations
  • More indeterminate beams in testing

Contributing

The guidelines for contributing are specified here.

Support

The guidelines for support are specified here.

License

License

Copyright (c) 2020, Jesse Bonanno

References

  1. Carella, A. (2019). BeamBending: A teaching aid for 1-d shear force and bending moment diagrams. Journal of Open Source Education, 2(16), 65. https://doi.org/10.21105/ jose.00065
  2. Hibbeler, R. (2013). Mechanics of materials. P.Ed Australia. ISBN: 9810694369
  3. Meurer, A., Smith, C. P., Paprocki, M., Čertík, O., Kirpichev, S. B., Rocklin, M., Kumar, A., Ivanov, S., Moore, J. K., Singh, S., Rathnayake, T., Vig, S., Granger, B. E., Muller, R. P., Bonazzi, F., Gupta, H., Vats, S., Johansson, F., Pedregosa, F., … Scopatz, A. (2017). SymPy: symbolic computing in Python. PeerJ Computer Science, 3, e103. https://doi.org/10.7717/peerj-cs.103
  4. Similiarweb, 2021, https://www.similarweb.com/. Accessed 1 Mar 2021.
  5. Plotly Technologies Inc. Collaborative data science. Montréal, QC, 2015. https://plot.ly."

Metadata

Release files for indeterminatebeam 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indeterminatebeam 2.4.0
File Size Uploaded
indeterminatebeam-2.4.0.tar.gz 39.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indeterminatebeam 2.4.0
File Interpreter ABI Platform
indeterminatebeam-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.1 kB

Release files / indeterminatebeam-2.4.0.tar.gz

Download URL indeterminatebeam-2.4.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a8182ffa652458345887eaa26af8c5f0bd347a7cfe5a087f556e0da7eaed49cc
BLAKE2b-256 checksum
How to use checksums
93943fe5140f5e3304015458195cc0868e2d133e273089857fb452f6c85752e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / indeterminatebeam-2.4.0-py3-none-any.whl

Download URL indeterminatebeam-2.4.0-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6166846d29fb4689b0568c96d24c6848a04988fb15a24e98658336f309d30d4
BLAKE2b-256 checksum
How to use checksums
f8dc7ec4e8523cfdaf79c84e09ee59f286566acd3e582c541a5f5d22c5c5e06d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.0

2 release files

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.6

1 release file

2.1.4

1 release file

v2.1.1

1 release file

v2.1.0

1 release file

v2.0.5

1 release file

v2.0.4

1 release file

v2.0.3

1 release file

v2.0.2

1 release file

v2.0.1

1 release file

v1.2.3

1 release file

v1.2.2

1 release file

v1.2.1

1 release file

v1.1.0

1 release file

v1.0.5

1 release file

v1.0.4

1 release file

v1.0.3

1 release file

v1.0.2

1 release file

v1.0.1

1 release file

v1.0.0

1 release file

v0.6.0

1 release file

v0.5.2

1 release file

v0.5.1

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page