Cycle through mountings and loadings. For each combo, find the maximum deflection. Check it against algebra. Confidence builder before we get to eigenvalues.
Same Euler–Bernoulli beam as the next problem — length L, modulus E, area moment I, no inertia yet. Apply a static load, the beam deflects, the deflection w(x) satisfies
EI · d⁴w/dx⁴ = q(x)
with whatever boundary conditions your mounting imposes. You want: the maximum deflection δmax — how far does the beam move at its worst point?
Six cases live in any beam-deflection table:
cantilever + tip point load P ⇒ δ = PL³ / 3EI at the tip cantilever + uniform load w ⇒ δ = wL⁴ / 8EI at the tip simply supported + center point P ⇒ δ = PL³ / 48EI at midspan simply supported + uniform load w ⇒ δ = 5wL⁴ / 384EI at midspan clamped-clamped + center point P ⇒ δ = PL³ / 192EI at midspan clamped-clamped + uniform load w ⇒ δ = wL⁴ / 384EI at midspan
All algebra. No calculus past integration to get those formulas in the first place. Roark's catalogs hundreds of variants.
Finite-element discretization with Hermite cubics turns EI w'''' = q into a linear system K u = f. Same element stiffness matrix as the vibration problem next door, no mass matrix needed for statics. The unknowns are nodal deflections and slopes; you assemble, apply BCs, solve once. Your brain picks the mesh, applies the mounting, builds the load vector, reads the answer.
Start with the cantilever-with-tip-load case. Hermite cubic elements, 10–20 of them across the beam. Assemble K, build f with the point load at the tip DOF, drop the fixed-end rows and columns, solve K u = f. Pull out δmax. Then point your AI pair at the next five cases — the differences are which DOFs you fix and how you build f.
Spec the discretization, the BC application strategy (row/column drop vs. penalty vs. Lagrange multipliers), and the consistent load vector for UDL with your AI pair. Have it draft. Your job is to specify, audit, verify.
Live below: pick a mounting, pick a loading, watch the beam deform to match. The closed-form formula sits next to the FEM number.
Did you spot it? FEM error is zero to machine precision — even at N=2 elements. That's not the solver getting lucky; it's a deep property of Hermite cubic elements known as superconvergence. The deflection field of every classical case in the table above is a polynomial of degree ≤ 4, and the FEM galerkin equations recover those polynomials' nodal values exactly. Your shape functions happen to be the right shape.
This is why we start here. Three rungs of the verification ladder all pass trivially for this problem:
Two unknowns per node: w and θ = dw/dx. The weak form needs C¹ continuity, so the slope is continuous across element boundaries, not just the displacement. Same setup as the vibration problem, minus the mass matrix.
Hermite cubic shape functions, 4 per element. Element stiffness
matrix Ke is a closed-form 4×4 you can
find in any structural-dynamics text (Bathe, Cook). For the linear
solve once you have K u = f: K is symmetric
positive definite after BC application, so Cholesky is the cleanest
choice. numpy.linalg.solve(K, f) also works.
For a uniform distributed load w on an element of length
le, the equivalent nodal forces are not
just w le / 2 at each end. The correct
consistent load vector is
[wl/2, wl²/12, wl/2, -wl²/12]
(the moment terms come from integrating the shape functions
against the distributed load). Skipping the moment terms gives a
convincing-looking-but-wrong answer.
def element_k(le, EI): ... # 4x4 Hermite stiffness def assemble_K(n_el): ... # scatter into global K def build_f(bc, load, n_el): ... # consistent load vector def apply_bcs(K, f, bc): ... # drop fixed rows/cols def solve(K, f): return np.linalg.solve(K, f) def max_deflection(u, n_el): ... # sample Hermite cubics, find argmax
The reference solver is the same Rust crate driving the live panel
above. The static deflection routine is ~80 lines:
solver/src/lib.rs,
function deflect_static. Look for the
consistent-load assembly for UDL, the row/column elimination for
BC application, and the Cholesky solve.
Your solver probably looks different in shape — that's expected. What to compare:
Post-mortem from the author: skipped the moment terms in the UDL load vector first time around and got an answer ~10% off. The closed-form check caught it in 10 seconds. Wouldn't have caught it on a problem without an algebraic anchor.
When you're ready for the dynamic version of all this: Beam vibration →