skane88 / simplebeam

A basic beam bending analysis package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Beam

License: MIT Code style: black PyPI Version

Introduction

A basic beam bending analysis package, intended to do simple beam bending moment & shear force analysis. The method used is McCauley's method, and the implementation is based on SymPy's beam analysis module, just more nicely wrapped for everyday usage.

The use of the term "Simple" does not mean that only simply-supported beams will be included in this package. McCauley's method can handle fixed ended (and even multi-span) beams. However, beams with axial loads, beams in 3-dimensions and frames, trusses etc. will not be included.

This is primarily intended to be a proof of concept package for me - at this point it is not a robust means for doing your engineering analysis. This may change as the package develops.

Installation

Use your preferred virtual environment solution and then simply pip install.

pip install simplebeam

Basic Usage

The following demonstrates basic usage of simplebeam:

>>> from simplebeam import simple, point
>>> length = 1
>>> load = point(position=length/2, magnitude=1)
>>> beam = simple(length=length, loads=load)
>>> beam.max_moment()
0.25

By itself, this seems like overkill - M = PL / 4 would be faster. However, consider the following examples:

>>> from simplebeam import simple, udl
>>> length = 5
>>> l1 = udl(magnitude=-5000)
>>> l2 = udl(magnitude=-5000, start=0, end=3.5)
>>> beam = simple(length=length, elastic_modulus=200e9, second_moment=0.0001, loads=[l1, l2])
>>> beam.max_moment_locations()
((0.0, 0.0), (2.4000000000000004, -28500.0))

>>> beam.plot_deflection()

Or:

>>> from simplebeam import Beam, pin, udl
>>> length = 5
>>> r1 = pin(position=0)
>>> r2 = pin(position=2)
>>> r3 = pin(position=4)
>>> l1 = udl(magnitude=-5000)
>>> beam = Beam(length=length, elastic_modulus=200e9, second_moment=0.0001, restraints=[r1, r2, r3], loads=l1)
>>> beam.plot_moment()

>>> beam.reaction_summary()

                                  Reactions                                   
┌────────────────────────────┬────────────────────────────┬───────────────────┐
│          PositionForceMoment       │
├────────────────────────────┼────────────────────────────┼───────────────────┤
│         0.000e+004.062e+03None        │
│         2.000e+001.062e+04None        │
│         4.000e+001.031e+04None        │
├────────────────────────────┼────────────────────────────┼───────────────────┤
│            Max.            │         1.062e+04None        │
│            Min.            │         4.062e+03None        │
└────────────────────────────┴────────────────────────────┴───────────────────┘

Documentation

You're reading it. Additionally, check the tests folder to see additional uses. I may add documentation at some future point in time but no promises.

Future Development

The following future developments may be done:

  • Implementation of helper methods for different load types.
  • Multiple load cases & load combinations
  • Implementation of beams with pins & varying properties.

Disclaimer

While all efforts have been made to ensure that the appropriate engineering theories etc. have been implemented correctly, it is the user's responsibilty to ensure that all output is correct. In particular, users should be familiar with basic structural mechanics and standard engineering practices.

For example, you should be doing independent checks of tools you take from unknown authors on the internet.

Contributing

Feel free to contribute through a pull request to provide bug fixes, new features or documentation.

Note that the intent of this program is that it will remain focussed on simple 2D beam bending only.

About

A basic beam bending analysis package.

License:MIT License


Languages

Language:Python 100.0%