The Chartership Forum

Computational Engineering / How the stiffness method works

The element and its transformation

Where the 4×4 bar matrix comes from, why every row sums to zero, and why the global form contains no new physics.

Lesson review: expert verification remains open

This lesson has received a full-context editorial review and a check of its technical explanations. Selected arithmetic has been checked separately. This is not independent engineering sign-off.

Checks needed for project use

  • A computational engineering reviewer must check algorithms, convergence claims, statistical assumptions and numerical examples beyond the cases explicitly recorded.
  • Specialist review of each solver formulation, force-recovery load terms and normalised convergence tolerances remains required.

These are educational models and exercises. Check their assumptions before using the results. The full technical content and every diagram have not yet been independently verified.

Concrete and steel calculations retain their stated first-generation Eurocode teaching basis. Use the standards and amendments specified for your project; do not mix generations without an appropriate design basis.

Read the lesson register and outstanding review notes

Why this matters

Examining the stiffness matrix helps explain common modelling faults. Assembly shows how elements share degrees of freedom; boundary conditions identify known displacements; conditioning indicates sensitivity to numerical error. This module derives those steps for a small linear elastic truss so that the diagnostics in later modules have a clear physical basis.

By the end of this lesson you should be able to

  • Derive the two-node bar matrix from equilibrium and compatibility
  • Say what a zero row sum means physically
  • Build the global 4×4 as TᵀkT and check it against the closed form
  • Read the direction cosines off a pair of coordinates

What you should already know

  • Stress, strain and Young's modulus
  • Equilibrium at a joint
  • The stiffness method as theory — Structural Analysis Fundamentals covers the derivation this module uses computationally

Linear elastic displacement analysis

For the small-displacement, linear elastic models used here, equilibrium and the element force–displacement relations give Ku = f. Prescribed displacements supply the boundary conditions. Solving the remaining equations gives the unknown nodal displacements. Other finite element formulations may use additional unknowns or nonlinear equations.

The axial stiffness of a bar

For a uniform bar, k = EA/L: the force required for unit axial extension. Check each input before assembly. E must represent the intended material, A must use consistent units, and L must follow the intended node coordinates. An area entered in mm² where m² is expected introduces a factor of one million. A misplaced or unmerged node can change both length and connectivity.

From first principles

The two-node bar matrix

We want to show: Get from f = ku for a single spring to the 2×2 matrix a solver actually assembles.

A bar does not know where it is. It only knows how much it has been stretched. So the force it develops must depend on the difference between what its two ends have done, and not at all on their average position. Everything in the matrix that follows is that sentence written down.

Into global axes

A real truss has bars at every angle. The solver does not want a separate derivation for each; it wants one matrix expressed in the axes everything else uses.

The move is a change of viewpoint, not of physics. A bar at angle θ has direction cosines c = cos θ and s = sin θ, read directly off the two node coordinates. The axial extension is the projection of the global end displacements onto the bar:

e = c(u₂ₓ − u₁ₓ) + s(u₂ᵧ − u₁ᵧ)

Write that as a 2×4 transformation T, and the global element matrix is TᵀkT. Multiply it out and every entry is k times a product of direction cosines — c², cs, s² — with the same ± block pattern as before.

The important thing is what has not happened: no new physics has entered. The 4×4 global matrix contains exactly the information the 2×2 did, seen from a rotated viewpoint. If it ever seems to contain more, something has gone wrong.

Bar element in global axes
[k]global=TT[k]localT=EAL[c2cs−c2−cscss2−cs−s2−c2−csc2cs−cs−s2css2][k]_{\text{global}} = \mathbf{T}^{\mathsf{T}}[k]_{\text{local}}\mathbf{T} = \frac{EA}{L}\begin{bmatrix} c^2 & cs & -c^2 & -cs \\ cs & s^2 & -cs & -s^2 \\ -c^2 & -cs & c^2 & cs \\ -cs & -s^2 & cs & s^2 \end{bmatrix}

What it calculates: The stiffness of a bar expressed in the model's own coordinate directions

E
Young's modulus (kN/m²)
A
Cross-sectional area (m²)
L
Length, from the node coordinates (m)
c
cos θ — the x direction cosine (—)
s
sin θ — the y direction cosine (—)

This assumes

  • Linear elastic, small displacements, axial behaviour only
  • θ is measured from the global x axis to the line from node 1 to node 2 — so reversing the node order reverses c and s

In plain terms: Every entry is a stiffness times a product of direction cosines. A horizontal bar has s = 0, so its whole second and fourth rows vanish: it has no vertical stiffness whatever, which is exactly right and exactly why a horizontal bar cannot hold a node up.

Try it

Stiffness matrix assembler

Step through the solve. Every intermediate is a real table, in kN/m, divided by 1000 to keep it readable.

Structure

Element stiffnesses

Step 1 of 5 — Element stiffnesses

Element properties, with k = EA/L
ElementL (m)cos θsin θk (kN/m)
e13.0001.0000.00066667
e24.0001.0000.00050000

What each step is doing

  • Steps 1–2: no physics is added by the transformation. The global matrix is the axial matrix seen from a rotated viewpoint.
  • Step 3: assembly is addition, and nothing else. A node connected to nothing would leave a zero row here.
  • Step 4: a restraint deletes a row and a column, because that displacement was already known.
  • Step 5: displacements first, then everything else. The residual is the check that decides whether any of it is usable.

What this shows: Assembly is addition, and a restraint is a struck-out row — the two facts that make every connectivity and support fault in Module 12 obvious.

Worked example

Two restrained bars meeting at a loaded node

Given

  • Three nodes on a line: L at x = 0, M at x = 3 m, R at x = 7 m
  • Bar 1 from L to M, bar 2 from M to R
  • Both E = 200 × 10⁶ kN/m², A = 0.001 m²
  • L and R fully held; M held vertically only
  • A horizontal load of 100 kN applied at M

Find

The displacement of M and the force in each bar

    Predict first

    In that two-bar problem, the area of bar 1 is doubled and nothing else changes. What happens to the force in bar 2?

    Practice

    A steel bar has E = 200 × 10⁶ kN/m², A = 0.0025 m² and L = 5 m. Compute its axial stiffness in kN/m.

    Practice

    A bar runs from (0, 0) to (3, 4). Its stiffness is k = 80 000 kN/m. What is the value of the top-left entry of its 4×4 global stiffness matrix, k·c², in kN/m?

    Worked example

    Why this unrestrained bar matrix is singular

    Given

    • A two-node bar element with axial stiffness k, before any support is applied

    Find

    What happens if you try to solve it on its own

      Check yourself

      What does the transformation matrix actually do to an element stiffness?

      Check yourself

      Why is the stiffness matrix symmetric for the conservative linear elastic displacement model used here?

      Summary

      • k = EA/L, and each of the three inputs is a place a model goes wrong
      • The axial bar matrix maps a rigid-body translation to zero force; its rows therefore sum to zero
      • The global matrix is TᵀkT — the same physics from a rotated viewpoint
      • A horizontal bar has literally zero vertical stiffness, and the matrix says so
      • The two parallel resisting paths in this example share load in proportion to stiffness