Skip to content

DGames95/pybeam

Repository files navigation

PyBeam – Structural Beam Analysis in Python

Project Status: Alpha PyPI License Docs

PyBeam is a lightweight, Python-based library for analyzing beams. v0.1.0 supports creating internal stress diagrams

Table of Contents

Installation

Install via pip:

pip install pybeam-structural

Quick Example – Cantilever Beam with Point Load

from pybeam import members

# Define beam properties
length = 5  # meters
resolution = 1000

# Define load
load = 50  # N
load_position = 5  # meters from fixed end

# Create beam object
beam = members.Loadable(length, resolution)

# Apply point load (as fraction of beam length)
beam.add_shear_point_force(load, load_position / length)

# Manually add support reactions
beam.add_shear_point_force(-load, 0)            # Fixed end vertical reaction
beam.add_point_moment(-load * length, 0)        # Fixed end moment

# Plot shear and moment diagrams
beam.plot()

Sign Conventions

  • Positive shear force: acts downward
  • Positive moment: causes sagging (concave up)

Testing and Development

Install dev dependencies into a venv:

python3 -m venv ./venv
chmod +x ./venv/bin/activate
./venv/bin/activate
pip install -r requirements-dev.txt

Run tests:

pytest

Run with coverage:

coverage run -m pytest
coverage report -m

Build

Build the package (creates .whl in dist/):

python -m build

Documentation

https://pybeam-structural.readthedocs.io/en/latest/

Generated via sphinx, see docs

License

MIT License – see LICENSE

About

A structural analysis tool with fluent interface.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages