Skip to main content

Python Continuous Beam Analysis

Project description

PyCBA logo

PyCBA — Python Continuous Beam Analysis

Fast, accurate continuous-beam analysis for the design, assessment and teaching of buildings and bridges —
from linear statics to plastic collapse, modal dynamics and moving-load bridge assessment.

PyPI version Python versions Tests codecov Documentation License: AGPL v3 Code style: black

PyCBA result diagrams

PyCBA is a focused, dependable 1-D continuous-beam engine built on the matrix (direct) stiffness method. It is deliberately not a general 2-D/3-D FE package — instead it does one thing extremely well, with a clean API, light dependencies (numpy / scipy / matplotlib), and an analysis core that powers a surprisingly broad toolkit.

import pycba as cba

# A two-span continuous beam: 10 m + 12 m, EI = 30 000 kN·m², pinned supports
beam = cba.BeamAnalysis(L=[10, 12], EI=30_000, supports=["pin", "pin", "pin"])
beam.add_udl(i_member=1, w=20)         # 20 kN/m on span 1
beam.add_pl(i_member=2, p=50, a=6)     # 50 kN point load at mid-span 2
beam.analyze()

beam.plot_results()                    # bending moment, shear, deflection + reactions
print(beam.at(5.0))                    # -> {'M': 162.5, 'V': -17.5, 'R': 0.0, 'D': -0.05}

✨ What it does

Analysis

  • Continuous beams of any number of spans, with pin / roller / fixed / vertical-spring / rotational-spring supports, prescribed settlements, and internal hinges — plus pre-solve mechanism detection.
  • An element library: Euler–Bernoulli, Timoshenko (shear-deformable), non-prismatic (variable EI), and beam-on-Winkler-foundation.
  • Nonlinear elasto-plastic analysis to collapse (plastic hinges, mechanism detection, collapse-mechanism plots).
  • Free-vibration (modal) analysis — natural frequencies, periods and mode shapes.

Loads & bridges

  • UDL, point, partial, trapezoidal, moment and imposed-curvature (creep / shrinkage / thermal) loads; load cases, combinations and patterned UDLs.
  • Moving-load bridge assessment — influence lines, envelopes, coincident effects, lane UDLs and shear points / critical shear.
  • Code load models — road & rail, from six nations — AASHTO HL-93, Eurocode LM1 / LM71, BS 5400 / CS 454 HB, CSA CL-625, China JTG, AREA Cooper E, AS 5100 M1600 / S1600 / 300LA, NAASRA T44 / MS18 — organised by region.
  • A post-tensioning preprocessor for prestress.

Visualisation

  • Beam & load schematics in matplotlib and publication-quality TikZ / stanli.
  • Shaded bending-moment / shear / deflection diagrams, reaction plots, coincident-effects, mode-shape, collapse-mechanism and vehicle plots.
  • An interactive Plotly backend, and selectable display unit systems (SI / US / N·mm).

Ergonomics

  • Point queries at(x), exports to_dataframe() / to_csv(), a friendly supports= API, and clear errors — all validated against closed-form solutions, with 370+ tests.

📦 Installation

pip install pycba                 # core
pip install "pycba[plotly]"       # + interactive plots

Requires Python 3.9+.

📚 Documentation & tutorials

Full documentation, a Theoretical Basis, and a dozen worked-example notebooks (bridges, foundations, modal, non-prismatic, nonlinear collapse, creep/shrinkage/thermal, the vehicle library, and more) are at ccaprani.github.io/pycba.

🌱 Origins

PyCBA began life as a Python port of Colin Caprani's MATLAB Continuous Beam Analysis program (later ported to C++ by Pierrot). It has since grown well beyond that starting point into the toolkit above — but the spirit is unchanged: fast, exact, and a pleasure to use.

📄 License

PyCBA is released under the GNU Affero General Public License v3.0 (AGPL-3.0). In short: you are free to use PyCBA for any purpose — including professional and commercial work — but if you incorporate it into your own software, or offer it over a network (e.g. a hosted or SaaS tool), that software must in turn be released under the AGPL. Contributions and issues are welcome on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycba-1.0.1.tar.gz (194.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycba-1.0.1-py2.py3-none-any.whl (153.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pycba-1.0.1.tar.gz.

File metadata

  • Download URL: pycba-1.0.1.tar.gz
  • Upload date:
  • Size: 194.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycba-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dda703318ecfb99b503457dbb7ab030b00f1414fca2dc44396e3d3d083089fc2
MD5 8cf72ae79909a3e685ffc2932e5b7077
BLAKE2b-256 cda7c00ee6b48f8d87cca3db58db9f395eac5004f4a687203245af76f4cd937e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycba-1.0.1.tar.gz:

Publisher: publish.yml on ccaprani/pycba

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycba-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pycba-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 153.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycba-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 71bef51f3b3278141de0e00832b726af282326fa3620595a0483d4d4b8862d4e
MD5 c4e2582bffaca2eefc7bc48f9d5451e9
BLAKE2b-256 47819bbf250e70b1b4786a8ac834235f5c07e85dde904662707a30f2684751b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycba-1.0.1-py2.py3-none-any.whl:

Publisher: publish.yml on ccaprani/pycba

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page