Search

Search papers and lessons

Stiffness Matrix

Level 3 · 12 min read

A stiffness matrix is a grid that turns a set of node displacements into the forces needed to hold them, and it is how a computer solves for how a structure bends under load.

On this page

  • Colour = topic mix
  • Discrete math
  • Classical mechanics
  • Linear algebra
  • Calculus
  • Computational methods
  • ReadReady to readNot yet

TL;DR

A stiffness matrix is a square table of numbers that links the positions of a set of points, called nodes, to the forces needed to hold those points in place. Multiply the matrix by the list of displacements and you get the list of forces. Solving the reverse problem, which is given the loads find the displacements, is how engineers predict how a bridge, a car frame or an aircraft wing will bend.

The matrix is built from simple pieces. Each spring or small element contributes a small table, and these tables are added together by node number. The result is symmetric, and it describes the whole structure at once.

Builds on: Hooke's Law, Matrix Multiplication, Gaussian Elimination · Leads to: Finite Element Method, Linear Elasticity, Sparse Matrix

Where it's used

Bridges and buildings. Structural engineers model a steel truss as bars joined at nodes. The global stiffness matrix of the truss tells the engineer how far each joint moves under traffic or wind, and whether the joints stay within safe limits. Commercial structural codes assemble and solve matrices of this kind for every design check.

Car and aircraft parts. A car chassis or an aircraft wing is modelled as a mesh of small solid elements. Each element has its own small stiffness matrix, derived from Linear Elasticity, and they are assembled into one matrix with millions of rows. Engineers use the result to find stress concentrations before a part is built.

Computer graphics. Animators and game engines simulate soft objects, such as cloth or jelly, by treating the object as a network of springs. The same matrix that describes a bridge describes the springs that hold the jelly together, and the solver computes how it wobbles.

How it works

We trace one tiny structure from start to finish. A wall is at the left. Node 1 is fixed to the wall, so it cannot move. Node 2 is joined to node 1 by a spring with stiffness k1=2k_1 = 2 N/m. Node 3 is joined to node 2 by a spring with stiffness k2=3k_2 = 3 N/m. A force of 6 N pulls node 3 to the right, and we want to know how far each node moves.

flowchart LR
  W["Wall: node 1 fixed"] -- "spring k1 = 2" --> N2["Node 2"]
  N2 -- "spring k2 = 3" --> N3["Node 3: load 6 N"]
  1. Write the matrix for one spring. A spring of stiffness kk between two nodes gives the 2×22 \times 2 table k(1−1−11)k \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}. For spring 1, that is (2−2−22)\begin{pmatrix} 2 & -2 \\ -2 & 2 \end{pmatrix} on nodes 1 and 2. Check: the two rows add to zero, because the spring pushes the two ends in opposite directions.
  2. Write the matrix for the second spring. For spring 2, it is (3−3−33)\begin{pmatrix} 3 & -3 \\ -3 & 3 \end{pmatrix} on nodes 2 and 3.
  3. Add them by node number. Node 2 belongs to both springs, so its diagonal entry gets 2+3=52 + 3 = 5. The full 3×33 \times 3 matrix is K=(2−20−25−30−33)K = \begin{pmatrix} 2 & -2 & 0 \\ -2 & 5 & -3 \\ 0 & -3 & 3 \end{pmatrix}. Check: it is symmetric, and each row adds to zero.
  4. Remove the fixed node. Node 1 cannot move, so its row and column are dropped, leaving the 2×22 \times 2 system (5−3−33)(u2u3)=(06)\begin{pmatrix} 5 & -3 \\ -3 & 3 \end{pmatrix}\begin{pmatrix} u_2 \\ u_3 \end{pmatrix} = \begin{pmatrix} 0 \\ 6 \end{pmatrix}. The right-hand side holds the forces: none at node 2, and 6 N at node 3.
  5. Solve. The first row gives 5u2−3u3=05u_2 - 3u_3 = 0, so u2=0.6 u3u_2 = 0.6\,u_3. Put this into the second row: −3(0.6 u3)+3u3=6-3(0.6\,u_3) + 3u_3 = 6, so 1.2 u3=61.2\,u_3 = 6 and u3=5u_3 = 5. Then u2=3u_2 = 3. Check: 5⋅3−3⋅5=05 \cdot 3 - 3 \cdot 5 = 0 and −3⋅3+3⋅5=6-3 \cdot 3 + 3 \cdot 5 = 6.
  6. Check the forces. Spring 1 stretches by u2−u1=3u_2 - u_1 = 3, so it carries 2⋅3=62 \cdot 3 = 6 N. Spring 2 stretches by u3−u2=2u_3 - u_2 = 2, so it carries 3⋅2=63 \cdot 2 = 6 N, which equals the applied load.

Interpretation: a 6 N pull moves the free end 5 m in this toy model. The springs share the load equally, because each one carries the same 6 N. A stiffer spring would move less.

The math

Step 1 in symbols: a spring element

A spring of stiffness kk stretched by Δ=uj−ui\Delta = u_j - u_i between nodes ii and jj stores energy 12kΔ2\frac{1}{2} k \Delta^2. Write the displacements as a vector u=(ui,uj)\mathbf{u} = (u_i, u_j). Then the element stiffness is

Ke=k(1−1−11).\mathbf{K}_e = k \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}.

Check that this reproduces the energy. We have u⊤Keu=k(ui2−2uiuj+uj2)=k(uj−ui)2\mathbf{u}^\top \mathbf{K}_e \mathbf{u} = k(u_i^2 - 2u_i u_j + u_j^2) = k(u_j - u_i)^2, so the energy is 12u⊤Keu\frac{1}{2} \mathbf{u}^\top \mathbf{K}_e \mathbf{u}. This is a Quadratic Form in the displacements.

Step 2 in symbols: assembly

For a structure with nodes 1,…,N1, \ldots, N, each element ee has a local matrix, and the global matrix K\mathbf{K} is the sum of the elements placed at their node positions:

K=∑ePe⊤KePe,\mathbf{K} = \sum_e \mathbf{P}_e^\top \mathbf{K}_e \mathbf{P}_e,

where Pe\mathbf{P}_e selects the rows and columns of the element's nodes. In words: add each element's entries into the global table at the row and column of the node they belong to. Entries that share a node add up, which is the 55 in the example.

Step 3 in symbols: the equilibrium equation

The structure's total energy is Π(u)=12u⊤Ku−f⊤u\Pi(\mathbf{u}) = \frac{1}{2}\mathbf{u}^\top \mathbf{K} \mathbf{u} - \mathbf{f}^\top \mathbf{u}, where f\mathbf{f} is the vector of external loads. Setting the gradient to zero gives Ku=f\mathbf{K}\mathbf{u} = \mathbf{f}. This is the equation to solve: the stiffness matrix times the displacements equals the loads. In the example, Ku=f\mathbf{K}\mathbf{u} = \mathbf{f} is the reduced system of step 4.

−1−0.500.5100.511.522.53displacement u (m)stored energy (J)
  • energy 1/2 * 5 * x^2
For one spring with k = 5 N/m, the stored energy is a parabola in the stretch. Equilibrium is the lowest point of the total energy, which is where K u = f.

Step 4 in symbols: fixed supports make K invertible

A structure with no supports can move as a rigid body, so K\mathbf{K} has a row of zeros in the direction of that motion and its determinant is 00. Fixing a node removes that freedom. Once enough nodes are fixed, K\mathbf{K} is positive definite (its quadratic form is positive for every nonzero displacement of the free nodes). Positive definite matrices are invertible, so the system Ku=f\mathbf{K}\mathbf{u} = \mathbf{f} has exactly one solution.

Worked examples

Example
1. One spring by hand

A spring with k=5k = 5 N/m joins two nodes. Node 1 is held fixed, and node 2 is pulled to u2=0.2u_2 = 0.2 m.

  1. Write the element matrix: K=5(1−1−11)=(5−5−55)\mathbf{K} = 5 \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} 5 & -5 \\ -5 & 5 \end{pmatrix}.
  2. Multiply by u=(0,0.2)\mathbf{u} = (0, 0.2): the first entry is 5⋅0−5⋅0.2=−15 \cdot 0 - 5 \cdot 0.2 = -1, and the second is −5⋅0+5⋅0.2=1-5 \cdot 0 + 5 \cdot 0.2 = 1.
  3. So f=(−1,1)\mathbf{f} = (-1, 1) N. This is the external force you must apply to hold the nodes there: push node 1 left by 1 N and node 2 right by 1 N.
  4. Check: the spring is stretched by 0.20.2 m, so its force is 5⋅0.2=15 \cdot 0.2 = 1 N, and the two forces are equal and opposite, as the entries show.

Interpretation: the matrix turns a displacement into the force needed to hold it, and the sign tells you the direction.

Example
2. The three-node chain

Use the chain from "How it works", with K\mathbf{K} reduced to (5−3−33)\begin{pmatrix} 5 & -3 \\ -3 & 3 \end{pmatrix} and loads (0,6)(0, 6).

  1. Solve the first equation for u2u_2: u2=3u3/5u_2 = 3u_3/5.
  2. Substitute into the second: −3⋅3u3/5+3u3=6-3 \cdot 3u_3/5 + 3u_3 = 6, which is −9u3/5+15u3/5=6-9u_3/5 + 15u_3/5 = 6, so 6u3/5=66u_3/5 = 6 and u3=5u_3 = 5.
  3. Then u2=3⋅5/5=3u_2 = 3 \cdot 5 / 5 = 3.
  4. Find the reaction at the wall: the first row of the full matrix gives 2⋅0−2⋅3=−62 \cdot 0 - 2 \cdot 3 = -6. The wall must push node 1 with −6-6 N, which balances the 6 N pull on the other end.
  5. Check that all forces balance: −6+0+6=0-6 + 0 + 6 = 0.

Interpretation: the free end moves 5 m and the middle node moves 3 m. The reaction at the wall equals the applied load, as it must.

Example
3. A steel bar with two elements

A steel bar of length L=1L = 1 m and cross-sectional area A=10−4A = 10^{-4} m2^2 has Young's modulus E=200E = 200 GPa, which is 200×109200 \times 10^9 Pa. It is fixed at one end, and a 1000 N load pulls the other end. It is split into two elements of length h=0.5h = 0.5 m, each with stiffness k=EA/hk = EA/h.

  1. Compute the element stiffness: k=(200×109)(10−4)/0.5=4×107k = (200 \times 10^9)(10^{-4}) / 0.5 = 4 \times 10^7 N/m.
  2. The global matrix for three nodes is K=4×107(1−10−12−10−11)\mathbf{K} = 4 \times 10^7 \begin{pmatrix} 1 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 1 \end{pmatrix}. Check: the middle node belongs to both elements, so its diagonal entry is 22.
  3. Fix node 1 and remove its row and column: 4×107(2−1−11)(u2u3)=(01000)4 \times 10^7 \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix}\begin{pmatrix} u_2 \\ u_3 \end{pmatrix} = \begin{pmatrix} 0 \\ 1000 \end{pmatrix}.
  4. The first row gives 2u2=u32u_2 = u_3. The second row gives 4×107(u3−u2)=10004 \times 10^7 (u_3 - u_2) = 1000. Put in u2=u3/2u_2 = u_3/2: 4×107⋅u3/2=10004 \times 10^7 \cdot u_3/2 = 1000, so u3=2000/(4×107)=5×10−5u_3 = 2000 / (4 \times 10^7) = 5 \times 10^{-5} m.
  5. Then u2=2.5×10−5u_2 = 2.5 \times 10^{-5} m.
  6. Check against the textbook formula δ=FL/(EA)=1000⋅1/(200×109⋅10−4)=1000/(2×107)=5×10−5\delta = FL/(EA) = 1000 \cdot 1 / (200 \times 10^9 \cdot 10^{-4}) = 1000 / (2 \times 10^7) = 5 \times 10^{-5} m. It matches the free-end displacement.

Interpretation: the bar stretches by 0.050.05 mm under 1 kN. Two elements reproduce the exact answer for this simple load, and finer meshes are needed when the load or geometry is more complicated.

Try it: A single spring with k=5k = 5 N/m has node 1 fixed and node 2 displaced to u2=0.4u_2 = 0.4 m. What force must be applied to hold it there? Answer: Ku=5(1−1−11)(0,0.4)=5(−0.4,0.4)=(−2,2)\mathbf{K}\mathbf{u} = 5\begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}(0, 0.4) = 5(-0.4, 0.4) = (-2, 2) N. Check: the stretch 0.40.4 m times 55 N/m is 22 N, matching the second entry.

Common mistakes and tradeoffs

"The stiffness matrix is just a list of spring constants." It is tempting to think each node has its own spring. In fact the off-diagonal entries couple neighbouring nodes, because a spring pulls on both of its ends. Ignoring the off-diagonal entries gives the wrong answer for any structure with more than one spring.

"You can invert the stiffness matrix as soon as you build it." A structure with no supports can move as a rigid body, so the matrix is singular. You must apply the boundary conditions first, by removing the fixed rows and columns, before solving.

"Assembly means stacking the element matrices." Assembly adds each element's entries at the global positions given by its node numbers. Entries from different elements that share a node add together, and this is the most common source of bugs in hand-built models.

When to use it. The stiffness method is right for small deformations of linear materials, where the load and the displacement are proportional. It is the basis of finite element analysis for bridges, frames and mechanical parts. Do not use it when the deformations are large, the material yields or flows, or the geometry changes as it bends. Those cases need nonlinear stiffness, which is updated at each step of the solution. For very large meshes, the matrix is mostly zeros, so a Sparse Matrix format and an iterative solver are used in place of dense Gaussian elimination.

History

Robert Hooke first published his law of elasticity in 1676 as an anagram, and in 1678 he revealed the solution, "ut tensio, sic vis" (as the extension, so the force), which states that stretch is proportional to force. Engineers used this rule for two centuries to analyse frames and trusses one piece at a time.

In the 1940s, Richard Courant showed that approximating a solution by simple piecewise functions on a triangulated region could solve the equations of elasticity. In the 1950s, aircraft engineers used matrix methods to analyse wings made of many interconnected parts, and the term "finite element" was introduced by Ray Clough in 1960. The stiffness matrix became the central object of the method because a computer could assemble and solve it for any structure, which made the technique practical for industry.

Recap

  • Hooke's law makes a spring's force proportional to its stretch, which gives the 2×22 \times 2 element matrix k(1−1−11)k \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}.
  • Element matrices are assembled into a global matrix K\mathbf{K} by node number, and entries from shared nodes add.
  • The structure's equilibrium is Ku=f\mathbf{K}\mathbf{u} = \mathbf{f}, with displacements u\mathbf{u} and loads f\mathbf{f}.
  • Fixing supports removes rigid-body motion, which makes K\mathbf{K} positive definite and invertible.
  • Solving the system gives the displacements, from which the forces in each element follow.

Read next: Finite Element Method applies this idea to continuous bodies by cutting them into elements, and Linear Elasticity gives the element matrices for solids. Sparse Matrix explains how large versions are stored and solved.

Check yourself

QuestionRecall: what is the stiffness matrix of a single spring of stiffness kk joining two nodes?Show answer

It is k(1−1−11)k \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}. The diagonal entries are the spring's stiffness, and the off-diagonal entries couple the two ends, with opposite signs because the spring pushes them in opposite directions.

QuestionComputation: a single spring with k=4k = 4 N/m has node 1 fixed and node 2 displaced to u2=0.5u_2 = 0.5 m. What is the force needed to hold node 2 there?Show answer

The stretch is 0.50.5 m, so the spring force is 4⋅0.5=24 \cdot 0.5 = 2 N. The force vector from Ku\mathbf{K}\mathbf{u} is 4(−0.5,0.5)=(−2,2)4(-0.5, 0.5) = (-2, 2) N, so node 2 needs a force of 22 N. Check: the two forces are equal and opposite.

QuestionWhy: why must the supports be applied before solving Ku=f\mathbf{K}\mathbf{u} = \mathbf{f}?Show answer

Without supports, the structure can move as a rigid body, which gives a zero direction in K\mathbf{K} and makes K\mathbf{K} singular, so there is no unique solution. Fixing a node removes that rigid motion, and the reduced matrix is positive definite and invertible.

QuestionApplied: an engineer assembles a global stiffness matrix by adding each element's entries at the row and column of its first node only. Why does this give a wrong answer, and what should be done instead?Show answer

Each element couples both of its nodes, so its entries belong at four positions: the two diagonal entries and the two off-diagonal entries that link its nodes. Adding only at the first node drops the coupling and the second node's stiffness. Each element's 2×22 \times 2 matrix should be added at the rows and columns of both of its nodes.

Sources