Skip to content

Releases: ccaprani/pycba

PyCBA 1.0.1 — a complete continuous-beam toolkit

Choose a tag to compare

@ccaprani ccaprani released this 27 Jun 14:46
5564c18

🎉 PyCBA 1.0.1 — a complete continuous‑beam toolkit

PyCBA reaches 1.0 — and rather than just the delta since 0.9, these notes set out the whole capability, because the library has grown enormously through a rapid run of releases since 0.6.

PyCBA is a focused, dependable 1‑D continuous‑beam engine for the design, assessment and teaching of buildings and bridges: matrix‑stiffness accurate, light on dependencies (just numpy / scipy / matplotlib), and deliberately not a general 2‑D/3‑D FE tool. At 1.0 it spans linear and nonlinear statics, moving‑load bridge assessment, free‑vibration dynamics, prestress, and a rich, publication‑ready visualisation layer.


🧱 Modelling & analysis

  • Continuous beams by the matrix (direct) stiffness method, any number of spans / members.
  • Supports: pin, roller, encastré, guided, vertical spring and rotational spring — via the low‑level restraint vector or the friendly supports=["pin", "roller", …] API.
  • Prescribed displacements / support settlements (D=).
  • Internal moment releases (hinges) per member.
  • Pre‑solve stability / mechanism detection.
  • Full reaction recovery — vertical, moment and spring forces — reported and plotted.

🧩 Element library

  • Euler–Bernoulli prismatic elements (the exact default).
  • Timoshenko shear‑deformable elements (opt‑in via GAv).
  • Non‑prismatic (variable‑EI) members — SectionEI from const / linear / pwl / poly segments, integrated exactly.
  • Beam on a Winkler (elastic) foundation (kf) — a statically‑condensed super‑element, validated against Hetényi.

🏋️ Loads

  • UDL, point, partial‑UDL, trapezoidal (linearly varying) and moment loads.
  • Imposed‑curvature (initial‑strain) loads for creep, shrinkage and thermal effects.
  • Load cases & combinations, patterned UDLs, and envelope/superposition utilities.

🌉 Bridges & moving loads

  • Vehicle traversal with influence lines and envelopes (Mmax/Mmin/Vmax/Vmin), with traverse‑range control.
  • Coincident load effects (e.g. the shear coexisting with peak moment) and envelope arithmetic (sum, augment).
  • Code load models — road & rail, from six nations. VehicleLibrary grouped by region (AU / US / EU / UK / CA / CN): AASHTO HL‑93, Eurocode LM1 / LM71, BS 5400 / CS 454 HB, CSA CL‑625, China JTG, AREA Cooper E, AS 5100 M1600/S1600/A160/W80/300LA, and the historical NAASRA T44 / MS18.
  • Moving lane UDL with clearance zones, and shear points / critical shear (dv) for code assessment.

💥 Nonlinear & dynamics

  • Elasto‑plastic (plastic‑hinge) analysis to collapse — static and moving load — with hinge tracking, mechanism detection, and a plot_collapse() mechanism diagram.
  • Free‑vibration (modal) analysis — natural frequencies, periods and mode shapes (validated to < 0.1 % against the classical cases).

🔗 Prestress

  • A post‑tensioning preprocessor that converts tendon profiles to equivalent loads.

📊 Visualisation

  • Beam & load schematics in matplotlib and publication‑quality TikZ / stanli (.tex → PDF).
  • Result diagrams — bending moment / shear / deflection (shaded, sagging‑positive), individual or combined, with a reactions panel; plus reaction, coincident‑effects, mode‑shape, collapse‑mechanism and vehicle plots.
  • Interactive Plotly backend — hover any section to read M, V and deflection together.
  • Display unit systems — relabel for SI / US / N·mm without touching the analysis.

⚡ Results & ergonomics

  • Point queries at(x); exports to_dataframe() / to_csv().
  • Consistent member terminology; the friendly supports= API; clear, actionable errors.

✅ Quality

Validated against closed‑form solutions throughout (Hetényi, classical modal frequencies, plastic‑collapse virtual work, …), with 370+ tests and a dozen worked‑example tutorials.


⚠️ Breaking changes (1.0 clean‑ups)

Both keep deprecated aliases, so most existing code is unaffected:

  • i_spani_member on the load‑add methods — positional calls (ba.add_udl(1, 10)) are unchanged; only the i_span= keyword is renamed. no_spans / add_span retained as aliases.
  • VehicleLibrary accessors move under region namespacesVehicleLibrary.AU.get_m1600(6.25) (and the new AU.get_300la(…)).

📄 Licence — now AGPL‑3.0

As of 1.0, PyCBA is licensed under the GNU Affero General Public License v3.0 (previously Apache 2.0). You remain free to use PyCBA for any purpose, including commercial and professional work — but software that incorporates it, whether distributed or offered over a network (SaaS), must in turn be released under the AGPL. This keeps PyCBA open while preventing proprietary appropriation.

📦 Install / upgrade

pip install --upgrade pycba
pip install "pycba[plotly]"   # optional interactive plots

Python 3.9+. Core dependencies remain just numpy, scipy and matplotlib.


Full changelog: https://github.com/ccaprani/pycba/blob/main/CHANGELOG.md · compare: v0.6.0...v1.0.1
Docs & tutorials: https://ccaprani.github.io/pycba/

Thank you to everyone who has used, taught with, and contributed to PyCBA on the road to 1.0. 🚀

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 24 Jun 13:03
5480c85

What’s Changed

Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 11 Jun 12:00
c0268c1

What’s Changed

  • Nonlinear (elasto-plastic) beam analysis (NonlinearBeamAnalysis) — #140
  • Non-prismatic (variable-EI) elements (SectionEI) — #139
  • Imposed-curvature (initial-strain) loads (add_ic, load type 6) — #139
  • plus Markdown (MyST) documentation migration

Verification

  • Full suite: 117 passed (incl. the new test_rejects_nonprismatic_member).
  • Docs build warning-free; the prismatic-only note renders correctly in the nonlinear tutorial.

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 25 Mar 06:11
ba96dde

v0.7.0

Features

Trapezoidal (linearly varying) distributed load (#101)

New load type 5 supports linearly varying distributed loads. Full-span form [span, 5, w1, w2] applies intensity w1 at the left end varying to w2 at the right. Partial form [span, 5, w1, w2, a, c] applies the load starting at position a over cover length c. A convenience method BeamAnalysis.add_trap() is also provided.

Coincident load effects on envelopes (#122)

When computing envelopes from a moving vehicle analysis, the co-existing value of the other effect (V or M) at the truck position that caused each envelope extreme is now tracked. New Envelopes attributes: Vco_Mmax, Vco_Mmin, Mco_Vmax, Mco_Vmin. The critical_values() output now includes "Vco" and "Mco" keys. Coincident values are preserved through augment() and zero_like().

Envelope addition (#92)

New Envelopes.sum() method for element-wise addition of compatible envelopes, enabling superposition of load effects from different sources (e.g. patterned UDL + moving vehicle envelopes).

Vehicle traverse range control (#53)

New pos_start and pos_end parameters on BridgeAnalysis.run_vehicle() restrict the vehicle traverse to a specified range. Useful for transverse deck analyses where the vehicle is confined to specific lanes.

Bug Fixes

Influence line IndexError (#89)

Fixed InfluenceLines.get_il() raising IndexError when the point of interest does not fall exactly on the result grid. Root cause was overly tight floating-point tolerance and zero-valued padding indices at span boundaries.

What’s Changed

v0.6.0

Choose a tag to compare

@ccaprani ccaprani released this 04 Mar 09:55

v0.6.0 — Release Notes

New Features

  • Prescribed displacements: Support for imposing known displacements at any DOF, enabling modelling of support settlements. Specify via the D argument to BeamAnalysis.
  • Spring support reactions: Spring forces are now reported in beam_results.Rs (upward positive, i.e. -k_s × u).

Bug Fixes

  • Load superposition: Fixed MemberResults.__add__ which was incorrectly accumulating shear (V) instead of rotation (R) when superimposing load cases.
  • Spring stiffness double-counting: Fixed a bug where spring stiffness was being added to the global stiffness matrix twice, giving incorrect results for spring-supported beams.
  • Spring reaction sign: Spring forces in beam_results.Rs are now reported with correct sign (upward positive).

Improvements

  • Theory documentation: Expanded theory.ipynb to cover global stiffness matrix assembly, spring supports, boundary condition enforcement, prescribed displacements, and reaction recovery.
  • Type definitions: Shared types (LoadType, LoadMatrix, LoadCNL, MemberResults) consolidated into types.py; explicit API exports replace wildcard imports.
  • CI: Dropped Python 3.8 support; added Python 3.12 and 3.13 to the test matrix. Minimum supported version is now Python 3.9.
  • Docs build: Replaced the unmaintained ammaraskar/sphinx-action with a native build step, fixing the GitHub Pages deployment.

Full Changelog: v0.5.2...v0.6.0

v0.5.2

Choose a tag to compare

@ccaprani ccaprani released this 24 Aug 00:21
08e1415

What's Changed

New Contributors

Full Changelog: v0.5.1...v0.5.2

v0.5.1

Choose a tag to compare

@ccaprani ccaprani released this 08 Apr 13:45
9d6c1ed

What's Changed

  • Added some theory docs by @ccaprani in #83
  • Fix deflections for etype 3 and 4 by @ccaprani in #80
  • Format Python code with psf/black push by @github-actions in #78

v0.5

Choose a tag to compare

@github-actions github-actions released this 31 Mar 06:17
55ae8f3

What’s Changed

  • Deflection shape fixes for all element types (#77) @ccaprani
  • corrected released end forces for etype=3 (Pinned-Fixed) (#75) @tpanagiotakos
  • Format Python code with psf/black push (#74) @github-actions
  • Bump codecov/codecov-action from 4.1.0 to 4.1.1 (#76) @dependabot

v0.4.2

Choose a tag to compare

@github-actions github-actions released this 22 Mar 00:52
ba1302d

What’s Changed

  • Fix for returning IL of vertical support near the POI (#73) @ccaprani

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 02 Mar 03:41
5f3242d

What’s Changed