How EduBeam solves a model
Every time you change the model, EduBeam solves it again with the direct stiffness method, in your browser, in a few milliseconds. This page follows the solver @edubeam/fem step by step on a small example, so you can reproduce each number by hand and know why the results can be trusted.
The example is a propped cantilever: an IPE 300 in steel, 4 m long, fixed at A, on a roller at B, under 10 kN/m. Its stiffness is kNm² and, without shear deformation, the textbook answers are kNm, kN and .
From model to displacements
Number the degrees of freedom
Every node gets the DOFs its elements need. All elements are beam elements, so every node has Dx, Dz and Ry. The solver numbers the free DOFs first and the supported ones after them, node by node. Here A is fixed and B is held only vertically, so two DOFs are free:
, and are the displacements along x and z and the rotation, as in the DOF table. Each element keeps a location array: the positions of its six DOFs in . Counting from 1, the beam's DOFs sit at positions .
Compute the element matrices
For each element the solver builds the local stiffness matrix, condenses any end hinges and turns it into global axes, . Each element load becomes equivalent nodal loads, . Our beam is horizontal, so is the identity, and the uniform load gives, in kN and kNm,
Assemble
The global stiffness matrix starts as zeros. Each element adds its entry to the row and column its location array gives for and , so where several elements meet at a node, their stiffnesses for that node's DOFs add up. The load vector collects the nodal loads and the equivalent nodal loads the same way. Prescribed displacements (settlements) go into . Ordered free-then-supported, the system splits into blocks:
where are the unknown reactions. In the example only the end-B rows and columns of the beam fall into :
Apply the supports and solve
Supports are not springs or large numbers on the diagonal: the supported DOFs are simply split off. The free displacements follow from
solved by LU decomposition. With no settlements , and here
which is the textbook , and .
Compute the reactions
With all displacements known, the supported rows give the reactions, the forces the supports exert on the structure:
For the row of holds under , and holds :
which is 25 kN upward (z points down). In the same way kNm and kN: the textbook and .
Results along the members
For each element, the solver takes its end displacements out of , turns them into local axes, , and computes the end forces
For the example, gives kN, kNm, kN and .
The internal forces at any then follow from equilibrium of the piece of the element between its start and : the forces at its start plus the load on that piece.
where , and come from the loads on that piece. For a uniform load , a trapezoidal load from to (with ), and a force or moment at the distance , which act only for :
is with the axial components and in place of and .
For the example, kNm, largest at m with kNm . A temperature load has no term of its own: it acts only through the end forces.
The deflection is the shape functions times the end displacements, plus the deflection of the load on the element with both ends clamped. A hinged end first gets its own rotation back from the condensation. The diagrams and the deformed shape are these functions, evaluated along each member.
Why the results are exact
Each step above is exact for the model it solves:
- The element stiffness comes from the exact solution of a prismatic Timoshenko member, not from assumed polynomial shapes, so it is the member's true stiffness.
- The fixed-end forces are the exact clamped solutions for each load type, so the equivalent nodal loads lose nothing.
- The nodal displacements are therefore exact, and the internal forces between the nodes come from equilibrium of the actual load, so they are exact too.
That is why EduBeam never asks you to refine a mesh: one element per member gives the same answer as a hundred. Nodes are needed only where the member itself changes: at a support, a hinge, a corner or a change of section. A point load between them can stay an element load. The only error left is floating-point round-off; the result tables show values below of the largest value of their kind as 0.
"Exact" refers to the model, which has its limits:
- Linear elastic material and small displacements: equilibrium is written on the undeformed shape, so there are no second-order (P–Δ) effects or buckling.
- Straight, prismatic members: one cross section per element. A tapered member has to be approximated by several elements.
- Bending in the x–z plane only: no torsion and no out-of-plane behaviour.
When the structure cannot stand
A structure that can move without deforming has a singular stiffness matrix and no unique solution. EduBeam looks for that before it solves, and checks the answer after:
- Before solving, every connected part of the structure is checked on its geometry alone. Its supports must stop the three rigid-body motions of a plane body: fewer than three restraints means the model is simply not finished (The structure needs supports before it can be solved.), while three or more that still let it slide or turn, such as parallel rollers, are an error. Then the hinges are checked: if the members can turn about them while every member keeps its length, the structure is a mechanism, and EduBeam circles the hinges and shows the motion.
- While solving, an exactly singular matrix stops the LU decomposition: Structure is a mechanism: the stiffness matrix is singular.
- After solving, a displacement or rotation larger than m or rad means the matrix was singular in all but round-off. EduBeam names the nodes and directions that move: Structure is unstable: … moves practically without resistance. A material or cross section entered as zero, or in the wrong unit, ends up here too.
A rotation that nothing is connected to, at a node where every member is hinged, is not a mechanism: the solver leaves it at zero. Troubleshooting explains every message and how to fix it.
Run the solver yourself
The solver is open source: @edubeam/fem, in TypeScript, for the browser and Node. The same propped cantilever:
import { DofID, LinearStaticSolver, type Beam2D } from '@edubeam/fem'
const solver = new LinearStaticSolver()
const { domain } = solver
const lc = solver.loadCases[0]
// SI units: m, N, Pa. Steel, IPE 300; k = 1e32 makes it shear-rigid.
domain.createMaterial(1, { e: 210e9, g: 81e9 })
domain.createCrossSection(1, { a: 53.8e-4, iy: 8356e-8, h: 0.3, k: 1e32 })
domain.createNode('A', [0, 0, 0], [DofID.Dx, DofID.Dz, DofID.Ry]) // fixed
domain.createNode('B', [4, 0, 0], [DofID.Dz]) // roller
domain.createBeam2D('1', ['A', 'B'], 1, 1)
lc.createBeamElementUniformEdgeLoad('1', [0, 10_000], true) // 10 kN/m, down
solver.solve()
solver.neq // 2: Dx and Ry of B are free
lc.r.toArray() // [0, 0.0007598, 0, 0, 0, 0]: free DOFs, then supported
lc.R.toArray() // [0, -25000, 20000, -15000]: A (Dx, Dz, Ry), then B (Dz)
const beam = domain.getElement('1') as Beam2D
beam.computeEndForces(lc).toArray() // [0, -25000, 20000, 0, -15000, 0]
beam.computeBendingMomentAt(lc, 0) // -20000: N·m, hogging at the wall
beam.computeBendingMomentAt(lc, 2.5) // 11250: the largest sagging moment
After solve(), solver.k holds the assembled matrix and solver.f the load vector , to compare with your own assembly. The steps on this page live in Solver.ts (numbering), LinearStaticSolver.ts (assembly, solution, reactions) and Beam2D.ts (element matrices and results).