← Back to the frame calculator

Direct stiffness method

The direct stiffness method is the displacement method written in matrix form. The unknowns are the displacements and rotations of the nodes; equilibrium at every node yields a system of linear equations. Statically determinate and indeterminate structures follow exactly the same path, which is why the method underlies practically every frame analysis program – including this calculator. This page derives it step by step for plane frames and works through a complete example.

1. Basic idea

A frame structure consists of straight members connected at nodes. Once the displacements and rotations of all nodes are known, so is the position of both ends of every member. For a single member it is possible to state exactly which forces are needed at its ends to move it into that position. That is precisely what its element stiffness matrix describes.

The method therefore proceeds in three steps:

  1. For every member, set up the relation between the displacements and the forces at its ends.
  2. At every node, require the forces of all connected member ends to be in equilibrium with the external load. This gives K u=F\mathbf K \, \mathbf u = \mathbf F with the global stiffness matrix K\mathbf K, the vector u\mathbf u of all nodal displacements and the load vector F\mathbf F.
  3. Introduce the supports, solve the system of equations, and recover the member end forces, the support reactions and the internal force diagrams from the nodal displacements.

Compatibility is satisfied automatically: all members rigidly connected at a node share its displacements and rotation. Unlike the force method, there is no need to know the degree of static indeterminacy or to choose a statically determinate primary structure.

2. Degrees of freedom and sign convention

Every node of a plane frame has three degrees of freedom: the displacements uxu_x and uyu_y and the rotation φ\varphi. With nn nodes this gives 3n3n unknowns, collected in the vector

u=[ux,1uy,1φ1ux,2uy,2φ2⋯φn]T\mathbf u = \begin{bmatrix} u_{x,1} & u_{y,1} & \varphi_1 & u_{x,2} & u_{y,2} & \varphi_2 & \cdots & \varphi_n \end{bmatrix}^{\mathsf T}

Node ii occupies positions 3i−23i-2, 3i−13i-1 and 3i3i. On this page and in the calculator, the following sign convention applies:

Many textbooks let the local zz axis point downwards. That changes the signs of individual matrix entries, not the method. The internal forces output by the calculator follow the usual structural engineering convention in any case, see section 8.

3. Element stiffness matrix in local coordinates

In local coordinates, each member end has three displacement quantities: the axial displacement uu, the transverse displacement ww and the rotation φ\varphi. The member end forces act in the same directions:

d=[uawaφaubwbφb],f=[fx,afz,amafx,bfz,bmb]\mathbf d = \begin{bmatrix} u_a \\ w_a \\ \varphi_a \\ u_b \\ w_b \\ \varphi_b \end{bmatrix}, \qquad \mathbf f = \begin{bmatrix} f_{x,a} \\ f_{z,a} \\ m_a \\ f_{x,b} \\ f_{z,b} \\ m_b \end{bmatrix}

f\mathbf f are the forces exerted by the nodes on the member. For a straight, unloaded member with constant axial stiffness EAEA and bending stiffness EIEI, Euler–Bernoulli beam theory (first-order theory, no shear deformation) gives exactly f=k d\mathbf f = \mathbf k\,\mathbf d with

k=[EAL00−EAL00012EIL36EIL20−12EIL36EIL206EIL24EIL0−6EIL22EIL−EAL00EAL000−12EIL3−6EIL2012EIL3−6EIL206EIL22EIL0−6EIL24EIL]\def\arraystretch{2.1} \mathbf k = \begin{bmatrix} \dfrac{EA}{L} & 0 & 0 & -\dfrac{EA}{L} & 0 & 0 \\ 0 & \dfrac{12EI}{L^3} & \dfrac{6EI}{L^2} & 0 & -\dfrac{12EI}{L^3} & \dfrac{6EI}{L^2} \\ 0 & \dfrac{6EI}{L^2} & \dfrac{4EI}{L} & 0 & -\dfrac{6EI}{L^2} & \dfrac{2EI}{L} \\ -\dfrac{EA}{L} & 0 & 0 & \dfrac{EA}{L} & 0 & 0 \\ 0 & -\dfrac{12EI}{L^3} & -\dfrac{6EI}{L^2} & 0 & \dfrac{12EI}{L^3} & -\dfrac{6EI}{L^2} \\ 0 & \dfrac{6EI}{L^2} & \dfrac{2EI}{L} & 0 & -\dfrac{6EI}{L^2} & \dfrac{4EI}{L} \end{bmatrix}

Each column is a unit displacement state: column jj contains the member end forces needed to impose dj=1d_j = 1 while all other member end quantities remain zero.

Where the entries come from

Formally, the bending entries follow from the differential equation EI w′′′′=qzEI\,w'''' = q_z. For an unloaded member the deflection curve is a cubic polynomial, which can be written in terms of the four end values using Hermite polynomials:

w(x)=H1 wa+H2 φa+H3 wb+H4 φb,ξ=xLw(x) = H_1\,w_a + H_2\,\varphi_a + H_3\,w_b + H_4\,\varphi_b, \qquad \xi = \frac{x}{L} H1=1−3ξ2+2ξ3,H2=L (ξ−2ξ2+ξ3),H3=3ξ2−2ξ3,H4=L (ξ3−ξ2)H_1 = 1 - 3\xi^2 + 2\xi^3, \quad H_2 = L\,(\xi - 2\xi^2 + \xi^3), \quad H_3 = 3\xi^2 - 2\xi^3, \quad H_4 = L\,(\xi^3 - \xi^2)

The stiffness entries are then kij=∫0LEI Hi′′ Hj′′ dxk_{ij} = \int_0^L EI\,H_i''\,H_j''\,\mathrm dx; for instance, ∫0LEI (H1′′)2 dx\int_0^L EI\,(H_1'')^2\,\mathrm dx gives exactly 12EI/L312EI/L^3.

k\mathbf k is symmetric, as Maxwell–Betti's reciprocal theorem requires, and on its own it is singular: a free member can translate and rotate as a rigid body without any forces arising. These three rigid-body modes only disappear once the member is held by nodes and supports.

4. Transformation into the global system

The nodal displacements are expressed in the global system, while the element stiffness matrix applies in local coordinates. The conversion is a rotation by α\alpha, separately for both member ends; the rotation φ\varphi is the same in both systems:

d=T ue,T=[cs0000−sc0000001000000cs0000−sc0000001]\mathbf d = \mathbf T\,\mathbf u_e, \qquad \mathbf T = \begin{bmatrix} c & s & 0 & 0 & 0 & 0 \\ -s & c & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & c & s & 0 \\ 0 & 0 & 0 & -s & c & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix}

ue\mathbf u_e contains the six global displacement quantities of the two member nodes. T\mathbf T is orthogonal, T−1=TT\mathbf T^{-1} = \mathbf T^{\mathsf T}, so forces are rotated back with fglobal=TT f\mathbf f_{\text{global}} = \mathbf T^{\mathsf T}\,\mathbf f. Substituting both into f=k d\mathbf f = \mathbf k\,\mathbf d gives the element stiffness matrix in the global system:

ke=TT k T\mathbf k_e = \mathbf T^{\mathsf T}\,\mathbf k\,\mathbf T

For a horizontal member running from left to right, T=I\mathbf T = \mathbf I. For a vertical member running upwards (c=0c = 0, s=1s = 1), the axial stiffness EA/LEA/L becomes the stiffness in the global yy direction and the bending stiffness 12EI/L312EI/L^3 the one in the xx direction – exactly what one expects of a column.

5. Loads on the member

Loads acting on a member between the nodes enter the system of equations as work-equivalent nodal loads. They are chosen so that they do the same work on the member end displacements as the actual load:

Qi=∫0Lqz(x) Hi(x) dxQ_i = \int_0^L q_z(x)\,H_i(x)\,\mathrm dx

This applies to the transverse load; in the axial direction the same is done with the linear shape functions 1−ξ1-\xi and ξ\xi. For a uniformly distributed load qzq_z over the whole member and for a point load FzF_z at a distance aa from the start, with b=L−ab = L - a:

QUDL=[0qzL2qzL2120qzL2−qzL212],Qpoint=[0Fz b2 (3a+b)L3Fz a b2L20Fz a2 (a+3b)L3−Fz a2 bL2]\def\arraystretch{2.1} \mathbf Q_{\text{UDL}} = \begin{bmatrix} 0 \\ \dfrac{q_z L}{2} \\ \dfrac{q_z L^2}{12} \\ 0 \\ \dfrac{q_z L}{2} \\ -\dfrac{q_z L^2}{12} \end{bmatrix}, \qquad \mathbf Q_{\text{point}} = \begin{bmatrix} 0 \\ F_z\,\dfrac{b^2\,(3a+b)}{L^3} \\ F_z\,\dfrac{a\,b^2}{L^2} \\ 0 \\ F_z\,\dfrac{a^2\,(a+3b)}{L^3} \\ -F_z\,\dfrac{a^2\,b}{L^2} \end{bmatrix}

With the opposite sign, these are the end forces of the member fixed at both ends – the fixed-end forces known from tables, such as qL2/12qL^2/12 or Fab2/L2F a b^2/L^2 and Fa2b/L2F a^2 b/L^2. For a loaded member the element equation therefore reads

f=k d−Q\mathbf f = \mathbf k\,\mathbf d - \mathbf Q

Q\mathbf Q is also rotated into the global system with TT\mathbf T^{\mathsf T}. Trapezoidal, triangular and partial distributed loads are handled with the same integral.

6. Assembly of the global stiffness matrix

Equilibrium at a node requires the external nodal load P\mathbf P to equal the sum of the forces the node exerts on the connected member ends. For all nodes together:

∑e(ke ue−Qe)=P⟹K u=F=P+∑eQe\sum_e \left( \mathbf k_e\,\mathbf u_e - \mathbf Q_e \right) = \mathbf P \quad\Longrightarrow\quad \mathbf K\,\mathbf u = \mathbf F = \mathbf P + \sum_e \mathbf Q_e

In practice this means: every member connects two nodes, and its location vector lists the six global numbers of its degrees of freedom. For a member from node ii to node jj:

g=[3i−23i−13i3j−23j−13j]\mathbf g = \begin{bmatrix} 3i-2 & 3i-1 & 3i & 3j-2 & 3j-1 & 3j \end{bmatrix}

Each entry of the global element matrix is added to K\mathbf K at its position, and each entry of Qe\mathbf Q_e to F\mathbf F:

Kgr gs+=ke,rs,Fgr+=Qe,r,r,s=1,…,6K_{g_r\,g_s} \mathrel{+}= k_{e,rs}, \qquad F_{g_r} \mathrel{+}= Q_{e,r}, \qquad r, s = 1, \dots, 6

Nodal loads go straight to their position in F\mathbf F. K\mathbf K is symmetric and sparse: an entry KpqK_{pq} is non-zero only if the degrees of freedom pp and qq belong to the same node or are connected by a member. Where several members meet at a node, their stiffnesses add up on the main diagonal.

7. Supports and boundary conditions

Without supports, K\mathbf K is singular – the whole structure could move as a rigid body. Supports fix individual degrees of freedom. The unknowns are split into free (ff) and restrained (ss) degrees of freedom, and the system of equations is partitioned accordingly:

[KffKfsKsfKss][ufuˉs]=[FfFs+R]\begin{bmatrix} \mathbf K_{ff} & \mathbf K_{fs} \\ \mathbf K_{sf} & \mathbf K_{ss} \end{bmatrix} \begin{bmatrix} \mathbf u_f \\ \bar{\mathbf u}_s \end{bmatrix} = \begin{bmatrix} \mathbf F_f \\ \mathbf F_s + \mathbf R \end{bmatrix}

The restrained displacements uˉs\bar{\mathbf u}_s are known: usually zero, or the settlement value for a prescribed support settlement. What is unknown there instead are the support reactions R\mathbf R. The first row contains only the free displacements as unknowns:

Kff uf=Ff−Kfs uˉs\mathbf K_{ff}\,\mathbf u_f = \mathbf F_f - \mathbf K_{fs}\,\bar{\mathbf u}_s

The second row then gives the support reactions:

R=Ksf uf+Kss uˉs−Fs\mathbf R = \mathbf K_{sf}\,\mathbf u_f + \mathbf K_{ss}\,\bar{\mathbf u}_s - \mathbf F_s

A spring support does not restrain a degree of freedom. Its spring stiffness kFk_F is added to the main diagonal entry of that degree of freedom, and the support reaction is then −kF u-k_F\,u. More on this, including support settlements, on the page Support types.

If Kff\mathbf K_{ff} is singular, there is a motion of the free nodes that requires no force: the system is a mechanism. The calculator detects this during the solution from a vanishing pivot and names the node and the degree of freedom where it first occurs.

8. Solution and recovery

The reduced system of equations is solved by Gaussian elimination. This gives all nodal displacements, and for every member the following are obtained:

  1. the local member end displacements d=T ue\mathbf d = \mathbf T\,\mathbf u_e,
  2. the member end forces f=k d−Q\mathbf f = \mathbf k\,\mathbf d - \mathbf Q,
  3. the internal forces at any position xx from equilibrium of a cut-off part of the member.

The internal forces follow the structural engineering convention: NN positive in tension, MM positive when the bottom side (the side facing away from the local zz axis) is in tension, and QQ such that dM/dx=Q\mathrm dM/\mathrm dx = Q. At the start of the member this gives

N(0)=−fx,a,Q(0)=fz,a,M(0)=−maN(0) = -f_{x,a}, \qquad Q(0) = f_{z,a}, \qquad M(0) = -m_a

and along the member, with the axial load pxp_x and the transverse load qzq_z,

dNdx=−px,dQdx=qz,dMdx=Q\frac{\mathrm dN}{\mathrm dx} = -p_x, \qquad \frac{\mathrm dQ}{\mathrm dx} = q_z, \qquad \frac{\mathrm dM}{\mathrm dx} = Q

Point loads on the member cause jumps in NN and QQ, point moments jumps in MM. At the end of the member, the result must again be N(L)=fx,bN(L) = f_{x,b}, Q(L)=−fz,bQ(L) = -f_{z,b} and M(L)=mbM(L) = m_b – a useful check for any hand calculation.

9. Worked example: two-span beam

Structure

Two spans of L=6L = 6 m, uniformly distributed load q=10q = 10 kN/m downwards over the full length, cross-section 30/30 cm with E=30 000E = 30\,000 MN/m², so EI=20 250EI = 20\,250 kNm². Node AA (left) is a pinned support, BB (middle) and CC (right) are roller supports. Both members run from left to right.

Degrees of freedom

Three nodes give nine degrees of freedom. Restrained are ux,Au_{x,A}, uy,Au_{y,A}, uy,Bu_{y,B} and uy,Cu_{y,C}; free are ux,Bu_{x,B}, ux,Cu_{x,C} and the three rotations. In a straight beam the axial displacements are uncoupled from bending and stay zero without an axial load. That leaves the rotations φA\varphi_A, φB\varphi_B and φC\varphi_C.

System of equations

Both members are horizontal, T=I\mathbf T = \mathbf I. Of the element matrix, the entries 4EI/L4EI/L and 2EI/L2EI/L remain for the rotations. With qz=−10q_z = -10 kN/m, the work-equivalent moments are qzL2/12=−30q_z L^2/12 = -30 kNm at the start of each member and +30+30 kNm at its end. Assembled:

EIL[42024+42024][φAφBφC]=[−3030−3030]kNm\frac{EI}{L} \begin{bmatrix} 4 & 2 & 0 \\ 2 & 4+4 & 2 \\ 0 & 2 & 4 \end{bmatrix} \begin{bmatrix} \varphi_A \\ \varphi_B \\ \varphi_C \end{bmatrix} = \begin{bmatrix} -30 \\ 30 - 30 \\ 30 \end{bmatrix} \text{kNm}

The entry 4+44 + 4 at BB shows how the stiffnesses of the two connected members add up; on the right-hand side their contributions cancel there.

Solution

By symmetry, φB=0\varphi_B = 0 and φC=−φA\varphi_C = -\varphi_A. The first row then gives

φA=−30⋅L4 EI=−30⋅64⋅20 250=−2.222⋅10−3 rad=−qL348 EI\varphi_A = -\frac{30 \cdot L}{4\,EI} = -\frac{30 \cdot 6}{4 \cdot 20\,250} = -2.222 \cdot 10^{-3}\ \text{rad} = -\frac{q L^3}{48\,EI}

The minus sign means that the beam rotates clockwise at the left support, i.e. it sags into the span.

Recovery for member A–B

The only non-zero quantities are φa=φA\varphi_a = \varphi_A and φb=φB=0\varphi_b = \varphi_B = 0. With 4EI/L=13 5004EI/L = 13\,500 kNm, 2EI/L=6 7502EI/L = 6\,750 kNm and 6EI/L2=3 3756EI/L^2 = 3\,375 kN, from f=k d−Q\mathbf f = \mathbf k\,\mathbf d - \mathbf Q:

ma=4EIL φA−(−30)=−30+30=0mb=2EIL φA−30=−15−30=−45 kNmfz,a=6EIL2 φA−(−30)=−7.5+30=22.5 kNfz,b=−6EIL2 φA−(−30)=7.5+30=37.5 kN\begin{aligned} m_a &= \tfrac{4EI}{L}\,\varphi_A - (-30) = -30 + 30 = 0 \\ m_b &= \tfrac{2EI}{L}\,\varphi_A - 30 = -15 - 30 = -45\ \text{kNm} \\ f_{z,a} &= \tfrac{6EI}{L^2}\,\varphi_A - (-30) = -7.5 + 30 = 22.5\ \text{kN} \\ f_{z,b} &= -\tfrac{6EI}{L^2}\,\varphi_A - (-30) = 7.5 + 30 = 37.5\ \text{kN} \end{aligned}

Result

This is the familiar result for a two-span beam with equal spans – obtained here without the force method and without tables, purely from nodal equilibrium and the element matrix.

10. What the calculator does

The frame calculator follows exactly this path:

Releases at member ends are taken into account by static condensation of the element matrix before assembly. After every analysis the calculator checks global equilibrium of loads and support reactions; for this check the distributed loads are integrated independently of the solution.

Try it in the calculator

The worked example is available as the two-span beam in the example list. The “Reactions” tab shows 22.5, 75 and 22.5 kN, the bending moment diagram shows −45 kNm over BB, and the “Displacements” tab lists the rotation at AA as −2.222e-3 rad.

Open the two-span beam in the calculator

← All topics