Assembling the Structure Stiffness Matrix

Assembly is the step the method is named after, and it is the simplest one: every member's 6×6 matrix is added into the big matrix at the rows and columns belonging to the joints it connects. No solving, no algebra — bookkeeping, done directly. What makes it interesting is what the result inherits.

Two members that share a joint add their stiffnesses at that joint. That single sentence is assembly, and it is why the structure resists more than any of its members does alone.

Numbering the freedoms

Each joint owns three consecutive equation numbers in a plane frame. With joints numbered from 1, joint n owns

3n − 2  (global X),   3n − 1  (global Y),   3n  (rotation Z)
degree of freedom numbering

A member from joint i to joint j therefore maps its six local positions onto these six global equations:

Member rows 1, 2, 3Structure rows 3i−2, 3i−1, 3i — the freedoms of joint i.
Member rows 4, 5, 6Structure rows 3j−2, 3j−1, 3j — the freedoms of joint j.

That list of six numbers is the member's connectivity, and it is the whole of the topology as far as the arithmetic is concerned. Everything else — where the joints are, how long the member is, which way it points — went into k already.

The scatter

For each member, for each of its 36 terms, add it where the connectivity says:

K[da][db] += k[a][b]

with d the six destination numbers. Note the +=. A term is added to whatever is already there, never assigned; that addition at shared rows and columns is where the members become a structure.

The three-joint frame

A portal frame with joints A (base), B and C (the two eaves) and D (the other base): the column A–B fills rows and columns for A and B, the beam B–C fills B and C, the column C–D fills C and D. In block form, one block per joint:

K =
ABCD
AkABkAB00
BkABkAB+kBCkBC0
C0kBCkBC+kCDkCD
D00kCDkCD

Each block is 3×3, so this is a 12×12 matrix. The diagonal blocks carry the sum of every member meeting at that joint. The off-diagonal blocks are non-zero only where two joints are connected by a member — A and D are not, so their block is empty.

What the assembled matrix is like

  • Symmetric. Each member matrix is symmetric and addition preserves that, so only half needs storing and the solution can use methods that need symmetry.
  • Sparse, and banded if numbered well. A term is non-zero only where two joints share a member. Number the joints so that connected ones have close numbers and the non-zeros huddle near the diagonal; the bandwidth that results decides the solving time. Numbering a long frame across instead of along it is the classic way to make a fast analysis slow.
  • Positive on the diagonal. Every diagonal entry is a sum of positive member stiffnesses. A zero on the diagonal means a freedom nothing resists.
  • Singular — so far. Nothing has been said about supports yet, so the whole structure can still float away: three rigid body motions, three zero eigenvalues, no unique solution. The supports are what remove them, in the next guide.

Where models go wrong at this step

Assembly is mechanical, but it is where two modelling mistakes become visible.

Members that cross without meeting

Two members drawn over each other but not sharing a joint contribute to different rows entirely. The structure looks braced on screen and is not. This is why the analysis tool warns when a node lies on a member without splitting it: the picture and the connectivity disagree, and the connectivity wins.

A joint nothing holds in one direction

A joint where every member is collinear — the middle of a straight line of members — has no stiffness at all across the line if those members are pin-ended. The row is empty, the matrix is singular, and the program reports a mechanism. The fix is modelling, not numerics: brace it, restrain it, or do not release it.

What the load vector does at the same time

The right-hand side is assembled the same way and in the same pass: joint loads go straight into their own rows, and each member's equivalent joint loads (the reversed fixed end forces from the previous guide, rotated into global axes) are added into the rows of the joints at its ends. One loop over the members builds both sides of the equation.

When there are several load cases, the left-hand side is built once and the right-hand side once per case. That asymmetry is the reason a program can offer twenty load combinations for almost the price of one: the expensive half — building and factorising K — does not depend on the load at all.

Next: applying the supports, solving the system, and turning u back into reactions, member forces and diagrams.