CivilAxisCivilAxis
☕ Support🌐 Community
Tiếng Việt

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.

📐Open the interactive frame & truss calculator

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.

Direct stiffness method workflow1 · ModelK2 · Assemble KKu=F3 · Solve u4 · Forces
Model the structure, assemble the global stiffness matrix K, solve K·u = F for the displacements, then recover reactions and member forces.

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 EAEA, flexural rigidity EIEI and length LL) has six degrees of freedom - translations u,vu, v and rotation θ\theta at each end:

klocal=[EALEAL12EIL36EIL212EIL36EIL26EIL24EIL6EIL22EILEALEAL12EIL36EIL212EIL36EIL26EIL22EIL6EIL24EIL]\mathbf{k}_{\text{local}} = \begin{bmatrix} \frac{EA}{L} & & & -\frac{EA}{L} & & \\ & \frac{12EI}{L^{3}} & \frac{6EI}{L^{2}} & & -\frac{12EI}{L^{3}} & \frac{6EI}{L^{2}} \\ & \frac{6EI}{L^{2}} & \frac{4EI}{L} & & -\frac{6EI}{L^{2}} & \frac{2EI}{L} \\ -\frac{EA}{L} & & & \frac{EA}{L} & & \\ & -\frac{12EI}{L^{3}} & -\frac{6EI}{L^{2}} & & \frac{12EI}{L^{3}} & -\frac{6EI}{L^{2}} \\ & \frac{6EI}{L^{2}} & \frac{2EI}{L} & & -\frac{6EI}{L^{2}} & \frac{4EI}{L} \end{bmatrix}

Each member is rotated from its local axes into the global frame with a transformation matrix T\mathbf{T}, giving the global element stiffness k=TTklocalT\mathbf{k} = \mathbf{T}^{\mathsf T}\mathbf{k}_{\text{local}}\mathbf{T}. Overlapping the members at shared nodes assembles the global stiffness matrix K\mathbf{K}, and equilibrium of the entire structure becomes one linear system:

Ku=F\mathbf{K}\,\mathbf{u} = \mathbf{F}

Here u\mathbf{u} holds every nodal displacement and F\mathbf{F} 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 u\mathbf{u}, 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.

Frame member vs truss memberFrame: rigid jointN, V, MTruss: pinned jointaxial only
A frame joint is rigid and transmits bending moment; a truss joint is a pin, so its members carry axial force only.

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 typesFixedPinRoller-HRoller-V
The five supports: fixed (all restrained), pin (translations restrained), horizontal/vertical rollers (one translation), and free.
SupportRestrainsReactions
Fixed (encastre)u, v, θHorizontal, vertical, moment
Pinu, vHorizontal, vertical
Roller (vertical reaction)vVertical
Roller (horizontal reaction)uHorizontal
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 kvk_v (kN/m) resists vv, horizontal khk_h (kN/m) resists uu, and rotational krk_r (kNm/rad) resists θ\theta. The spring stiffness is simply added to that DOF’s diagonal term in the global stiffness matrix, and the support force is recovered as

R=kuR = k\,u

where uu is the solved displacement of that DOF. Adding a spring to a DOF frees any rigid restraint there (the spring replaces it); as kk \to \infty 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 FxF_x, vertical force FyF_y, or moment MM) or along a member as a uniformly distributed load ww. A distributed load is handled by computing the member’s fixed-end forces - for a full-length UDL these are end shears wL/2wL/2 and end moments wL2/12wL^{2}/12 - 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).

Sign convention+N tension+M sagging
Axial force positive in tension; bending moment positive when sagging. Moment diagrams are drawn along each member.

Quantities and units used by this tool

QuantitySymbolUnit
Coordinatesx, ym
Young's modulusEGPa
Cross-section areaAcm²
Second moment of areaIcm⁴
Nodal force / momentFx, Fy / MkN / kNm
Distributed loadwkN/m
Axial / shear forceN, VkN
Bending momentMkNm
Displacementu, vmm

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

Frame analysis finds the internal forces and displacements of a plane structure made of straight members connected at joints (nodes). Given the geometry, the supports and the loads, it solves for the support reactions, the axial force, shear force and bending moment in every member, and the displaced shape. It is the everyday tool for portal frames, continuous beams, bracing and trusses.

Each member has a stiffness matrix relating the forces at its ends to the displacements at its ends. These are transformed to global axes and assembled into one global stiffness matrix K. With the applied loads in a vector F, equilibrium of the whole structure is the linear system K·u = F. After fixing the supported degrees of freedom, the system is solved for the nodal displacements u, from which reactions and member forces are recovered. This tool uses exactly that method.

In a frame, members are rigidly connected and carry axial force, shear and bending moment; each joint can transmit moment. In a truss, members are pin-connected and carry axial force only (tension or compression) - no bending. In this tool, mark a member as a "truss member" to release its end moments; mixing frame and truss members in one model is allowed.

Fixed (restrains horizontal, vertical and rotation - a built-in/encastre support), pin (restrains horizontal and vertical, free to rotate), roller with a vertical reaction (restrains vertical only, free to slide horizontally), roller with a horizontal reaction (restrains horizontal only, free to slide vertically), and free (no restraint). Click a node in Support mode to cycle through them.

The solver reports "unstable" when the structure is a mechanism - it can move or rotate as a rigid body because it is not adequately restrained. Common causes are too few supports, all supports providing reactions in the same direction, or a part of the model disconnected from any support. Add or change supports so that horizontal, vertical and rotational rigid-body motion are all prevented.

Axial force is positive in tension. The shear and bending-moment diagrams are drawn per member along its local axis, with sagging bending moment taken as positive. Reactions are reported as the force the support exerts on the structure (an upward reaction resisting gravity is positive). Displacements are reported in millimetres, forces in kilonewtons and moments in kilonewton-metres.

It is a first-order linear-elastic analysis and has been checked against textbook results - simply supported and cantilever beams, propped cantilevers, portal frames and trusses all reproduce the published reactions, moments and deflections. It assumes small displacements and elastic behaviour, and does not include second-order (P-delta) effects, buckling, yielding or member self-weight unless you add it as a load.

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
Rate this
No ratings yet
Sign in to join the discussion.
Loading…