2D Frame & Truss Analysis - The Stiffness Method Explained
The theory behind this 2D structural analysis calculator: how the direct stiffness method assembles the global stiffness matrix and solves K·u = F, the difference between frames and trusses, the support types and loads, the sign conventions, and how support reactions, axial force, shear, bending moment and the deflected shape are obtained.
What 2D frame and truss analysis computes
A plane (2D) structure is a set of straight members joined at nodes, held by supports and acted on by loads. Structural analysis finds, for that arrangement: the support reactions, the internal axial force, shear force and bending moment in every member, and the deflected shape. This is the daily bread of structural engineering - portal frames, continuous beams, trusses and bracing are all solved this way.
Unlike a closed-form beam formula, a general frame has no single equation: it is solved numerically with the direct stiffness method, the matrix method that underlies every commercial analysis package.
The direct stiffness method
Every member relates the forces at its ends to the displacements at its ends through an element stiffness matrix. Written in the member’s local axes, a 2D frame element (with axial rigidity , flexural rigidity and length ) has six degrees of freedom - translations and rotation at each end:
Each member is rotated from its local axes into the global frame with a transformation matrix , giving the global element stiffness . Overlapping the members at shared nodes assembles the global stiffness matrix , and equilibrium of the entire structure becomes one linear system:
Here holds every nodal displacement and the applied nodal forces (distributed member loads are first converted to equivalent fixed-end nodal forces). The rows and columns of the supported degrees of freedom are removed, the reduced system is solved for , and then the reactions and each member’s internal forces are recovered by back-substitution.
Frames vs trusses
In a frame, joints are rigid: members carry axial force, shear and bending moment, and a moment is transmitted across the joint. In a truss, joints are pinned: each member carries only axial force (tension or compression), and the bending terms of the stiffness matrix are released. In this tool, mark any member as a truss member to pin its ends; you can freely mix frame and truss members in one model.
Supports and boundary conditions
Supports restrain selected degrees of freedom and so generate reactions. A structure must be restrained against all three rigid-body motions (horizontal, vertical and rotation) or it is a mechanism and cannot be solved.
| Support | Restrains | Reactions |
|---|---|---|
| Fixed (encastre) | u, v, θ | Horizontal, vertical, moment |
| Pin | u, v | Horizontal, vertical |
| Roller (vertical reaction) | v | Vertical |
| Roller (horizontal reaction) | u | Horizontal |
| Free | - | None |
Elastic (spring) supports - Winkler foundation
A support need not be perfectly rigid. An elastic springmodels a finite stiffness to ground - a footing on soil, a pile’s lateral resistance, a bearing, or partial joint fixity. Each spring acts on one degree of freedom and pushes back in proportion to displacement (a Winkler model): vertical (kN/m) resists , horizontal (kN/m) resists , and rotational (kNm/rad) resists . The spring stiffness is simply added to that DOF’s diagonal term in the global stiffness matrix, and the support force is recovered as
where is the solved displacement of that DOF. Adding a spring to a DOF frees any rigid restraint there (the spring replaces it); as the spring behaves like a rigid support. Spring forces are drawn in a distinct colour after solving to set them apart from rigid reactions.
Loads and member forces
Loads are applied either at nodes (a horizontal force , vertical force , or moment ) or along a member as a uniformly distributed load . A distributed load is handled by computing the member’s fixed-end forces - for a full-length UDL these are end shears and end moments - applying their reverse as equivalent nodal loads, and adding the fixed-end forces back into the member after the solve.
Sign convention
Axial force is positive in tension. Bending moment is positive when sagging; the moment diagram is plotted along each member’s local axis. Reactions are the forces the supports exert on the structure (an upward reaction resisting gravity is positive).
Quantities and units used by this tool
| Quantity | Symbol | Unit |
|---|---|---|
| Coordinates | x, y | m |
| Young's modulus | E | GPa |
| Cross-section area | A | cm² |
| Second moment of area | I | cm⁴ |
| Nodal force / moment | Fx, Fy / M | kN / kNm |
| Distributed load | w | kN/m |
| Axial / shear force | N, V | kN |
| Bending moment | M | kNm |
| Displacement | u, v | mm |
Accuracy and limits
The solver is a first-order linear-elastic analysis, verified against textbook problems - simply supported and cantilever beams, propped cantilevers, portal frames and trusses all reproduce the published reactions, moments and deflections. Keep its assumptions in mind:
- Linear elastic, small displacements - no yielding, large-deflection or P-delta effects.
- No buckling check - compression members are not checked for instability; do that separately.
- Self-weight is not automatic - add it as a member UDL if you need it.
- Adequate restraint required - an under-supported model is a mechanism and returns "unstable" rather than a result.
Within these limits it is an accurate, fast way to get reactions, internal forces and deflections for plane frames and trusses - and a natural companion to the closed-form beam calculator for standard cases.
Frequently asked questions
Ready to analyse your own structure? Draw a frame or truss, add supports and loads, and solve for reactions, member forces and deflection.
📐Open the interactive frame & truss calculator→