Public: anyone can read this; the crew can change it.
Continuous beams and moment loads #4
Check · Review · Land · Live done — Landed and live in production.
Reached maximum budget ($6)
shipped production is serving it for issue #3 deploy eda5fc0
The beam now sits on up to four supports, and the reactions are no longer taken from statics: they are unknowns inside the Macaulay expression, closed by global equilibrium, y(xᵢ) = −δᵢ at every support and θ(0) = 0 at a built-in end — one small linear system solved in src/linear.ts (Gauss with partial pivoting, no dependency). That single formulation covers continuous beams, applied moments (positive clockwise, a step of exactly C in the moment diagram), a settlement per support, propped cantilevers and overhangs, and it reduces exactly to the old simply-supported and cantilever answers, which still pass their original table checks.
The deploy failure was newSupport appending the new support to the end of the list instead of into its place along the beam, so the redirect's canonical query listed s1=6, s2=3; it now sorts, and bun test is 59 green.
What to look at in the preview: press + Support on the default beam and it becomes a two-span continuous beam with the support in the middle of the widest gap; the line under the title says where the supports stand, what spans they make and what overhangs, since changing the span deliberately does not move a support. ?u=si&L=12&ns=3&s0=0&s1=6&s2=12&n=1&k0=W&m0=12&a0=0&b0=12 gives the textbook −54 kN·m and 27 / 90 / 27 kN; add &d1=30 to watch the middle prop shed load as it settles. Diagrams, maxima, CSV/JSON, the shareable URL, print and the terminal (m, S, d are new keys) all carry the supports and moments through.
What I left out: no elastic supports, no internal hinge, no lift-off check (a negative reaction is reported as a support that holds the beam down, not released), and EI is still constant along the whole beam — all stated on the page and in the README.
The two-span hand check matches exactly. Add linear.test.ts that exercises the solver directly (a known 3x3 system and a singular one), and write the pull description — the run ran out of budget before it could.
The reactions of a continuous beam are no longer taken from statics. They are unknowns in the Macaulay expression alongside the fixing moment and the two integration constants, and the conditions that close the problem — V(L⁺) = 0, M(L⁺) = 0, y(xᵢ) = −δᵢ at every support, θ(0) = 0 at a built-in end — are assembled into one small linear system and solved by Gaussian elimination with partial pivoting in src/linear.ts. That is the force method, the matrix form of the three-moment equation, and it covers two to four supports, support settlement, applied moment loads, propped cantilevers and overhangs in a single formulation, with no special case per beam type. Support positions are part of the case and survive a change of span: one short of the end leaves an overhang, one past it is brought back on.
src/beam.test.ts checks every continuous answer against a hand calculation written out above it — two equal spans (M = −wL²/8, R = 3wL/8, 10wL/8), two unequal spans by the three-moment equation, three equal spans (−wL²/10, 0.4wL, 1.1wL), a propped cantilever, and a middle support settling by Δ on an unloaded beam (R_B = −6EIΔ/L³). This push adds src/linear.test.ts, which exercises the solver on its own: a 3×3 system whose solution is derived by Cramer's rule in the comment, a zero first pivot that must be swapped, a 4×4 for the back-substitution, the tiny-pivot case partial pivoting exists for, and the singular ones — a dependent row, an unknown nothing constrains, a ragged matrix, a non-finite entry — where null has to come back instead of NaN, since assemble reads that as "these supports cannot hold the beam" and both the page and the tty say so. Deleting the pivot search fails two of the new tests; deleting the guards fails six. 70 tests pass.
What to look at in the preview: add a third support and watch the moment diagram go negative over it; drag a support inboard to make an overhang; set a settlement on the middle support of an unloaded beam and see reactions appear from geometry alone. The URL still carries the whole case, and CSV/JSON export, the print view and the terminal all follow the same solver. Not done: no moving loads, no influence lines, no shear deformation, and the section list is unchanged — the solver is Euler–Bernoulli and the page says so under the results. No dependencies added.
Reached maximum budget ($6)
Closes #3