Beam deflection, bending stress & shear/moment diagrams
A general single-span beam analysis tool — the same direct-stiffness (beam finite-element) method underneath any "beam calculator" spreadsheet or app a structural/civil engineer reaches for before opening real FEA software: reactions, shear force, bending moment, bending stress, and the full deflection curve for any support combination and up to three point loads plus a uniform load.
5.1–5.2 · General beam analysis (reactions, shear/moment, deflection & stress)
$$E\,I\,\frac{d^4y}{dx^4}=w(x),\quad \sigma_{\max}=\frac{M_{\max}\,c}{I}$$
Solved with a beam finite-element (direct stiffness) model — the same method underneath any general beam-calculator app — rather than a lookup table of textbook cases, so any support combination works: simply-supported, cantilever, propped cantilever, or fixed-fixed, each with up to three point loads plus one full-span uniform load. Reactions (including fixed-end moments) come from the stiffness solve; shear/moment/deflection follow from statics and the beam's nodal rotations/displacements. Scope: single-span, prismatic (constant E, I), linear-elastic, static loads — exactly what a civil/structural engineer checks by hand or spreadsheet before opening real software. Multi-span continuous beams, non-prismatic members, 2D frames/trusses, dynamic or moving loads, and P-Δ effects are genuinely a job for dedicated FEA (SAP2000, RISA, ETABS, STAAD) — this tool intentionally stops short of that. Source: direct stiffness method (Euler-Bernoulli beam element), standard in any matrix structural analysis text (e.g. McGuire, Gallagher & Ziemian, Matrix Structural Analysis); cross-checked against AISC/Roark closed-form tables for all four determinate/simple-indeterminate cases.
| Reaction at x=0 (force, moment if fixed) | — | |
| Reaction at x=L (force, moment if fixed) | — | |
| Max shear |V|max | — | |
| Max moment (location, value) | — | |
| Max bending stress σmax | — | |
| Max deflection (location, value) | — |
import numpy as np, matplotlib.pyplot as plt K, F = assemble_beam_stiffness(nodes, EI, supports, point_loads, udl) # 2 DOF/node U = np.linalg.solve(K[free][:,free], F[free]) V, M = internal_forces(U, reactions, point_loads, udl) # statics from reactions fig, (ax1, ax2) = plt.subplots(2, 1); ax1.plot(x, V); ax2.plot(x, M)