Skip to content

Calculator

Stiffness matrix, step by step, for plane trusses and frames

A plane truss or frame of up to 12 nodes, solved with the direct stiffness method and nothing hidden. Each member’s stiffness matrix in its own axes and then in the global axes, the assembled matrix of the structure, the load vector, the split into free and restrained degrees of freedom, the elimination, the reactions and what every member carries at its two ends, all written out with their numbers. Start from one of seven textbook problems, or enter a structure of your own.

Structure
Truss or frame, in a plane
Shown
Every matrix, step by step
Results
Displacements, reactions, end forces

Calculation sheet

Stiffness matrix, step by step, for plane trusses and frames

ttcivilstructural.com/resources/stiffness-matrix-step-by-step

The structure and its solution

Kind of structure
Units

Truss bars are pinned at both ends and carry axial force only: each node has two degrees of freedom, x and y, and loads act at nodes. Moments, rotation restraints, section inertias and member loads typed for frame members are kept, and ignored here.

Start from a textbook problem

Textbook answer: bar 1 carries −12.5 kip and bar 2 −37.5 kip (a minus sign is compression); the reactions are (10, 7.5) kip at node 1 and (−30, 22.5) kip at node 2.

This tool gives: bar 1 carries −12.5 kip and bar 2 −37.5 kip (a minus sign is compression); the reactions are (10, 7.5) kip at node 1 and (−30, 22.5) kip at node 2.

The check passes: the tool solved this problem and every value agrees with the textbook’s to within 1 × 10^−6 of the largest value of its kind.

Choosing a problem swaps your structure for one with a known answer, ready to edit. It keeps the units you chose; the kind of structure and the section become the problem’s.

Nodes

Each node is a point where members join or a support stands. Coordinates run rightward (x) and upward (y) from any origin you like. A node is numbered by its place in the list: deleting one moves every later node up a number.

Members

Each member is straight and keeps a single section from end to end. Its own axis points from the first node towards the second. A blank E, A or I takes the structure’s value, set in the section group below.

Supports

A support holds the movements ticked in its row, in the global directions. Pinned: x and y. Roller: y alone, or x alone. Fixed: x, y and rotation (frame members only). A held movement may be given a settlement, which moves the support itself instead of holding it still: inches or millimetres, and radians for a rotation. At least three movements must be held in all, or the structure can slide or turn as one piece.

Held movements
Held movements

Loads at nodes

Forces count positive along +x and +y, which makes a weight a negative Fy; moments count positive counter-clockwise (frames only). Several loads on one node simply add.

Section and material

Members with no section of their own take these values. A truss never needs I.

A listed modulus is a typical one; replace it with the real material’s.

Statically determinate

degree = bars + reactions − 2 × nodes = 2 + 4 − 2 × 3 = 0

Equilibrium alone gives the forces; the stiffness only decides how far things move. A count of zero or more does not prove the structure is stable; the elimination of step 10 does.

Largest node movement
0.01841 in at node 3
Largest reaction
37.5 kip at node 2
Largest bar force
−37.5 kip in member 2
On the drawing

Structure, loads, reactions and deformed shape · ft, kip

Deformed shape magnified 600 times; the biggest movement, at any point, is 0.0184 in.

  • The structure before loading
  • Node, with its number
  • Deformed shape, magnified 600 times
  • Support holding x and y
  • Load at a node, with its size
  • Reaction, with its size
  • DOF numbers of a node, in the order x, y; an underlined number is held
  • Member number

Reading the drawing: lines are members, circles are nodes with their numbers, and the supports stand where the held movements are. The line of dashes and dots is the deformed shape, magnified 600 times. Node 3 moves most, by 0.01841 in. Largest reaction: 37.5 kip, at node 2.

Node displacements

NodeAlong x (in)Along y (in)Total (in)
1000
2000
3+0.006466−0.017240.01841

Displacements are positive towards +x and +y, rotations counter-clockwise. Rotations are given in radians, with the degrees alongside.

Reactions

SupportsNodeAlong x (kip)Along y (kip)
11+10+7.5
22−30+22.5

Each support answers the structure with a reaction: a force, positive along +x or +y, or a moment, positive counter-clockwise. A dash marks a movement the support leaves free.

Bar forces

BarNodesLength (ft)Axial force (kip)StateStress (ksi)Elongation (in)
11 – 310−12.5compression−1.25−0.005172
22 – 310−37.5compression−3.75−0.01552

Tension is positive: the bar is pulled and lengthens; compression is negative. Stress is N divided by the area, and the elongation is the change of length, negative when the bar shortens.

Equilibrium check

Sum of forces along x
0 kip
Sum of forces along y
0 kip
Sum of moments about (8, 3)
0 kip·ft

Balanced: loads against reactions cancel, joint by joint as well, within 1 × 10^−8 of the force scale.

Here the analysis is linear and of first order, and members are straight: displacements stay small, the material stays linear elastic and, for frame members, bending and axial deformation count while shear deformation does not. It leaves out hinges inside members, elastic supports, supports on a slope, temperature changes and P-Δ effects. The numbers are analysis results only: there is no design check, no factor and no verdict here.

The worked solution

The solution is the direct stiffness method written out in 14 stages. Every step has a card of its own: the formula first, then the numbers of this structure. Everything in it is computed from the entries above, and every table can be copied into a spreadsheet.

Matrices as

These choices apply to every table of the worked solution at once. Symbols are shown for the matrices that have a formula, and the numbers for all of them. Automatic writes plain digits from 10^−4 to 10^7 and powers of ten outside that range; plain digits keep to plain from 10^−12 to 10^21.

The unknowns of the method are the movements of the nodes. A truss node can move along x and along y, and each of those movements is a degree of freedom (DOF), numbered in node order: the DOFs of node n are x = 2n − 1 and y = 2n.

Nodes: 3. Members: 2. DOFs: 6, of which 4 are held by supports and 2 are free to move.

Restraints are on the global DOFs: a 1 means the support holds that movement.

No support settles, so every held DOF has a displacement of 0.

The section was entered in ksi, in² and the calculation works in kip/ft², ft²; the conversion is done once, here, and every number after it is in kip and ft.

  • DOF(n, x) = 2n − 1
  • DOF(n, y) = 2n

Node coordinates (3 × 2)

Node coordinates
xy
100
2160
386

Units: ft.

  • A dot or a light 0 stands for an exact zero.

Connectivity: first and second node of each member (2 × 2)

Connectivity: first and second node of each member
ij
113
223

Section of each member (2 × 2)

Section of each member
EA
14,176,0000.06944
24,176,0000.06944

Units: E in kip/ft²; A in ft².

Degree-of-freedom numbers (3 × 2)

Degree-of-freedom numbers
xy
112
234
356

Restraints: 1 is held, 0 is free (3 × 2)

Restraints: 1 is held, 0 is free
xy
111
211
300
  • A dot or a light 0 stands for an exact zero.

Prescribed displacement of every DOF (0 where nothing is prescribed) (6 × 1)

Prescribed displacement of every DOF (0 where nothing is prescribed)
u prescribed
1x0
1y0
2x0
2y0
3x0
3y0

Units: ft.

  • held DOF
  • A dot or a light 0 stands for an exact zero.

Member 1 runs from node 1 to node 3. Its size and direction come from the coordinates of those two nodes: the run in each axis, the length from the two runs, and the direction as a cosine and a sine, with θ measured counter-clockwise from +x.

  • dx = xj − xi
  • dy = yj − yi
  • L = √(dx² + dy²)
  • c = cosθ = dx/L
  • s = sinθ = dy/L
  • c² + s² = 1
Run in x, dx
dx = xj − xi = 8 ft
Run in y, dy
dy = yj − yi = 6 ft
Length, L
L = √(dx² + dy²) = 10 ft
Direction cosine, c
c = dx/L = 0.8
Direction sine, s
s = dy/L = 0.6
Direction (degrees from +x)
θ = 36.87 °
Modulus, E
E = 4,176,000 kip/ft²
Area, A
A = 0.06944 ft²
Axial rigidity, EA
EA = E·A = 290,000 kip

Member 2 runs from node 2 to node 3. Its size and direction come from the coordinates of those two nodes: the run in each axis, the length from the two runs, and the direction as a cosine and a sine, with θ measured counter-clockwise from +x.

  • dx = xj − xi
  • dy = yj − yi
  • L = √(dx² + dy²)
  • c = cosθ = dx/L
  • s = sinθ = dy/L
  • c² + s² = 1
Run in x, dx
dx = xj − xi = −8 ft
Run in y, dy
dy = yj − yi = 6 ft
Length, L
L = √(dx² + dy²) = 10 ft
Direction cosine, c
c = dx/L = −0.8
Direction sine, s
s = dy/L = 0.6
Direction (degrees from +x)
θ = 143.1 °
Modulus, E
E = 4,176,000 kip/ft²
Area, A
A = 0.06944 ft²
Axial rigidity, EA
EA = E·A = 290,000 kip

In its own axis a bar behaves like a spring: its two end forces follow from the two end displacements through the matrix k, which is EA/L times a pattern of +1 and −1. The rows and columns are the displacements along the bar at node 1 and at node 3.

  • k = (EA/L)·[1 −1; −1 1]
  • k·ulocal = flocal

Local stiffness matrix k of member 1 (2 × 2)

Local stiffness matrix k of member 1
u1u3
u1EA/L29,000−EA/L−29,000
u3−EA/L−29,000EA/L29,000

Units: kip/ft.

  • axial terms, EA/L
Axial stiffness, EA/L
EA/L = 29,000 kip/ft

In its own axis a bar behaves like a spring: its two end forces follow from the two end displacements through the matrix k, which is EA/L times a pattern of +1 and −1. The rows and columns are the displacements along the bar at node 2 and at node 3.

  • k = (EA/L)·[1 −1; −1 1]
  • k·ulocal = flocal

Local stiffness matrix k of member 2 (2 × 2)

Local stiffness matrix k of member 2
u2u3
u2EA/L29,000−EA/L−29,000
u3−EA/L−29,000EA/L29,000

Units: kip/ft.

  • axial terms, EA/L
Axial stiffness, EA/L
EA/L = 29,000 kip/ft

The member’s matrix is in its own axis; the structure is in x and y. T turns the four global end displacements into the two along the bar: ulocal = T·uglobal, and its transpose turns end forces back: fglobal = TT·flocal. With c = 0.8 and s = 0.6, T = [c s 0 0; 0 0 c s].

  • ulocal = T·uglobal
  • fglobal = TT·flocal
  • c = cosθ
  • s = sinθ

Transformation matrix T of member 1 (2 × 4)

Transformation matrix T of member 1
1x1y3x3y
u1c0.8s0.60000
u30000c0.8s0.6
  • A dot or a light 0 stands for an exact zero.
Direction cosine, c
c = 0.8
Direction sine, s
s = 0.6

The member’s matrix is in its own axis; the structure is in x and y. T turns the four global end displacements into the two along the bar: ulocal = T·uglobal, and its transpose turns end forces back: fglobal = TT·flocal. With c = −0.8 and s = 0.6, T = [c s 0 0; 0 0 c s].

  • ulocal = T·uglobal
  • fglobal = TT·flocal
  • c = cosθ
  • s = sinθ

Transformation matrix T of member 2 (2 × 4)

Transformation matrix T of member 2
2x2y3x3y
u2c−0.8s0.60000
u30000c−0.8s0.6
  • A dot or a light 0 stands for an exact zero.
Direction cosine, c
c = −0.8
Direction sine, s
s = 0.6

Multiplying k·T first, and TT by that result, gives Ke: the same stiffness, written for the structure’s axes. Its rows and columns are named by the member’s global DOFs, listed in the code vector: 1x, 1y, 3x, 3y.

For a bar the product can be written once and for all in c and s: EA/L times a pattern made of c², cs and s², with signs. The last table fills that pattern in with this bar’s numbers.

It gives the same numbers as the product, to the figures shown.

  • Ke = TT·k·T
  • code = [DOF(i), DOF(j)]
  • Ke = (EA/L)·[c² cs −c² −cs; cs s² −cs −s²; −c² −cs c² cs; −cs −s² cs s²]

Product k·T of member 1 (2 × 4)

Product k·T of member 1
1x1y3x3y
u123,20017,400−23,200−17,400
u3−23,200−17,40023,20017,400

Units: kip/ft.

Member stiffness matrix in global axes Ke, member 1 (4 × 4)

Member stiffness matrix in global axes K_e, member 1
1x1y3x3y
1x18,56013,920−18,560−13,920
1y13,92010,440−13,920−10,440
3x−18,560−13,92018,56013,920
3y−13,920−10,44013,92010,440

Units: kip/ft.

Code vector of member 1: the global DOF number of each row (4 × 1)

Code vector of member 1: the global DOF number of each row
DOF number
1x1
1y2
3x5
3y6

The same matrix from the closed form, member 1 (4 × 4)

Every entry is the factor EA/L = 29,000 kip/ft times the symbol shown.

The same matrix from the closed form, member 1
1x1y3x3y
1xc²18,560cs13,920−c²−18,560−cs−13,920
1ycs13,920s²10,440−cs−13,920−s²−10,440
3x−c²−18,560−cs−13,920c²18,560cs13,920
3y−cs−13,920−s²−10,440cs13,920s²10,440

Units: kip/ft.

Multiplying k·T first, and TT by that result, gives Ke: the same stiffness, written for the structure’s axes. Its rows and columns are named by the member’s global DOFs, listed in the code vector: 2x, 2y, 3x, 3y.

For a bar the product can be written once and for all in c and s: EA/L times a pattern made of c², cs and s², with signs. The last table fills that pattern in with this bar’s numbers.

It gives the same numbers as the product, to the figures shown.

  • Ke = TT·k·T
  • code = [DOF(i), DOF(j)]
  • Ke = (EA/L)·[c² cs −c² −cs; cs s² −cs −s²; −c² −cs c² cs; −cs −s² cs s²]

Product k·T of member 2 (2 × 4)

Product k·T of member 2
2x2y3x3y
u2−23,20017,40023,200−17,400
u323,200−17,400−23,20017,400

Units: kip/ft.

Member stiffness matrix in global axes Ke, member 2 (4 × 4)

Member stiffness matrix in global axes K_e, member 2
2x2y3x3y
2x18,560−13,920−18,56013,920
2y−13,92010,44013,920−10,440
3x−18,56013,92018,560−13,920
3y13,920−10,440−13,92010,440

Units: kip/ft.

Code vector of member 2: the global DOF number of each row (4 × 1)

Code vector of member 2: the global DOF number of each row
DOF number
2x3
2y4
3x5
3y6

The same matrix from the closed form, member 2 (4 × 4)

Every entry is the factor EA/L = 29,000 kip/ft times the symbol shown.

The same matrix from the closed form, member 2
2x2y3x3y
2xc²18,560cs−13,920−c²−18,560−cs13,920
2ycs−13,920s²10,440−cs13,920−s²−10,440
3x−c²−18,560−cs13,920c²18,560cs−13,920
3y−cs13,920−s²−10,440cs−13,920s²10,440

Units: kip/ft.

The structure matrix K starts at zero and takes in each member in turn: K ← K + Ke. An entry goes to the row and column that the member’s code vector names (1x, 1y, 3x, 3y), so this member writes 16 numbers into K; where another member has already written in the same cell, the two add.

This is the first member, so K starts as its contribution alone.

  • K ← K + Ke

What member 1 writes into K (6 × 6)

What member 1 writes into K
1x1y2x2y3x3y
1x18,56013,92000−18,560−13,920
1y13,92010,44000−13,920−10,440
2x000000
2y000000
3x−18,560−13,9200018,56013,920
3y−13,920−10,4400013,92010,440

Units: kip/ft.

  • cells this member writes into K
  • A dot or a light 0 stands for an exact zero.

K after member 1 is added (6 × 6)

K after member 1 is added
1x1y2x2y3x3y
1x18,56013,92000−18,560−13,920
1y13,92010,44000−13,920−10,440
2x000000
2y000000
3x−18,560−13,9200018,56013,920
3y−13,920−10,4400013,92010,440

Units: kip/ft.

  • cells the members added so far have written into
  • A dot or a light 0 stands for an exact zero.

The structure matrix K starts at zero and takes in each member in turn: K ← K + Ke. An entry goes to the row and column that the member’s code vector names (2x, 2y, 3x, 3y), so this member writes 16 numbers into K; where another member has already written in the same cell, the two add.

The second table is K after members 1 to 2 have been added.

  • K ← K + Ke

What member 2 writes into K (6 × 6)

What member 2 writes into K
1x1y2x2y3x3y
1x000000
1y000000
2x0018,560−13,920−18,56013,920
2y00−13,92010,44013,920−10,440
3x00−18,56013,92018,560−13,920
3y0013,920−10,440−13,92010,440

Units: kip/ft.

  • cells this member writes into K
  • A dot or a light 0 stands for an exact zero.

K after members 1 to 2 are added (6 × 6)

K after members 1 to 2 are added
1x1y2x2y3x3y
1x18,56013,92000−18,560−13,920
1y13,92010,44000−13,920−10,440
2x0018,560−13,920−18,56013,920
2y00−13,92010,44013,920−10,440
3x−18,560−13,920−18,56013,92037,1200
3y−13,920−10,44013,920−10,440020,880

Units: kip/ft.

  • cells the members added so far have written into
  • A dot or a light 0 stands for an exact zero.

K is the sum of the contributions of all 2 members: K = ΣKe. A cell marked as shared has entries from two or more members, which are added; a cell that is not marked at all received nothing and is exactly zero.

K is symmetric, K = KT: the force at one DOF for a unit movement of another equals the force at the other for a unit movement of the first.

  • K = Σ Ke
  • K = KT

Assembled stiffness matrix K (6 × 6)

Assembled stiffness matrix K
1x1y2x2y3x3y
1x18,56013,92000−18,560−13,920
1y13,92010,44000−13,920−10,440
2x0018,560−13,920−18,56013,920
2y00−13,92010,44013,920−10,440
3x−18,560−13,920−18,56013,92037,1200
3y−13,920−10,44013,920−10,440020,880

Units: kip/ft.

  • cells with entries from two or more members
  • cells the members added so far have written into
  • A dot or a light 0 stands for an exact zero.

The load vector P gets one entry for each DOF: the force along x or y, or the moment about the node, applied there. Several loads at one node are summed.

1 load is applied at nodes.

  • Pnodal(d) = ΣF(d)

Loads at the nodes, Pnodal (6 × 1)

Loads at the nodes, P_nodal
Pnodal
1x0
1y0
2x0
2y0
3x20
3y−30

Units: kip.

  • A dot or a light 0 stands for an exact zero.

The load vector P has one entry per DOF; the held DOFs will be given the reactions they need later.

The loads at the nodes are the whole load vector: P = Pnodal.

  • P = Pnodal

Load vector P (6 × 1)

Load vector P
P
1x0
1y0
2x0
2y0
3x20
3y−30

Units: kip.

  • A dot or a light 0 stands for an exact zero.

Some DOFs are held by supports (R, for restrained) and the rest are free (F). Putting the free DOFs first, K, P and u split into blocks: K = [KFF KFR; KRF KRR], P = [PF; PR] and u = [uF; uR]. The unknowns are uF, the movements of the free DOFs, and later R, the forces the supports must supply.

Here 2 DOFs are free and 4 are held.

The held movements uR are known: zero where the support holds still.

  • K = [KFF KFR; KRF KRR]
  • P = [PF; PR]
  • u = [uF; uR]

Stiffness matrix with its free and held DOFs separated (6 × 6)

Stiffness matrix with its free and held DOFs separated
3x3y1x1y2x2y
3x37,1200−18,560−13,920−18,56013,920
3y020,880−13,920−10,44013,920−10,440
1x−18,560−13,92018,56013,92000
1y−13,920−10,44013,92010,44000
2x−18,56013,9200018,560−13,920
2y13,920−10,44000−13,92010,440

Heavy lines separate the free DOFs (first) from the held ones (last): the blocks are named in their corners.

Units: kip/ft.

  • held DOF
  • A dot or a light 0 stands for an exact zero.

Loads and displacements, free and held (6 × 2)

Loads and displacements, free and held
Pu
3x20?
3y−30?
1x00
1y00
2x00
2y00

Heavy lines separate the free DOFs (first) from the held ones (last): the blocks are named in their corners.

Units: P: kip; u: ft.

  • held DOF
  • A dot or a light 0 stands for an exact zero.

The rows of K·u = P + R that belong to free DOFs have no reaction in them (a reaction exists only at a held DOF). The held movements are known, so the terms that hold them move to the right, which leaves the unknown free movements alone on the left; the right side is called rhs.

No support moves, so KFR·uR = 0 and rhs = PF.

  • KFF·uF = PF − KFR·uR

What stands on the right of the reduced equations (2 × 3)

What stands on the right of the reduced equations
PFKFR·uRrhs
3x20020
3y−300−30

Units: kip.

  • A dot or a light 0 stands for an exact zero.

Gaussian elimination works on the matrix KFF with the right-hand side written beside it as one more column: [KFF | rhs]. Each pass below changes it, and every change is the same change made to a row of the equations.

Augmented matrix [KFF | rhs] (2 × 3)

Augmented matrix [K_FF | rhs]
3x3yrhs
3x37,120020
3y020,880−30

Units: kip/ft; right-hand side in kip.

  • A dot or a light 0 stands for an exact zero.

Pass 1 takes the diagonal entry of DOF 3x as its pivot, akk = 37,120 kip/ft. Each row below it gets a multiplier, its own entry in the pivot column divided by the pivot, and that multiple of the pivot row is subtracted from it, which makes the entry under the pivot zero.

1 row below the pivot is reduced.

  • lik = aik/akk
  • aij ← aij − lik·akj
Pivot
akk = 37,120 kip/ft

Multipliers of pass 1 (1 × 1)

Multipliers of pass 1
l = aik/akk
3y0
  • A dot or a light 0 stands for an exact zero.

Augmented matrix after pass 1 (2 × 3)

Augmented matrix after pass 1
3x3yrhs
3x37,120020
3y020,880−30

Units: kip/ft; right-hand side in kip.

  • the pivot
  • entries made zero in this pass
  • entries changed in this pass
  • A dot or a light 0 stands for an exact zero.

The matrix is now triangular, so the last unknown comes from its own row alone, and each earlier unknown from its row once the later ones are known: the right-hand entry minus the known terms of that row, divided by its pivot.

Unknown 2, the DOF 3y, comes out as −0.001437 ft, using the pivot 20,880 kip/ft.

  • uk = (bk − Σ akj·uj)/akk
Pivot
akk = 20,880 kip/ft

Unknowns found so far, this one first (1 × 1)

Unknowns found so far, this one first
u
3y−0.001437

Units: ft.

The matrix is now triangular, so the last unknown comes from its own row alone, and each earlier unknown from its row once the later ones are known: the right-hand entry minus the known terms of that row, divided by its pivot.

Unknown 1, the DOF 3x, comes out as 0.0005388 ft, using the pivot 37,120 kip/ft.

  • uk = (bk − Σ akj·uj)/akk
Pivot
akk = 37,120 kip/ft

Unknowns found so far, this one first (2 × 1)

Unknowns found so far, this one first
u
3x0.0005388
3y−0.001437

Units: ft.

The unknowns uF are put back into the original equations KFF·uF = rhs. The residual r = KFF·uF − rhs is what is left over in each: if the solution is right, all of it is zero, to rounding.

The largest residual is zero to the figures shown.

  • KFF·uF = rhs
  • r = KFF·uF − rhs

Solution uF and the residual of each equation (2 × 1)

Solution u_F and the residual of each equation
uF
3x0.0005388
3y−0.001437

Units: ft.

Solution uF and the residual of each equation (2 × 1)

Solution u_F and the residual of each equation
residual
3x0
3y0

Units: kip.

  • A dot or a light 0 stands for an exact zero.
Largest residual
max|KFF·uF − rhs| = 0

Putting the solved movements uF and the known held movements uR back in the order of the DOF numbers gives the full displacement vector u: u = [uF; uR].

Displacements are in ft and rotations in radians; the table of results above gives them in in.

  • u = [uF; uR]

Displacement vector u (6 × 1)

Displacement vector u
u
1x0
1y0
2x0
2y0
3x0.0005388
3y−0.001437

Units: ft.

  • held DOF
  • A dot or a light 0 stands for an exact zero.

At a held DOF the support supplies whatever force K·u = P + R leaves over: the held rows of K times the displacements, minus the loads at those DOFs. Its sign follows the global axes: positive along +x or +y, counter-clockwise for a moment.

  • R = KRF·uF + KRR·uR − PR

Reaction at each held DOF, with its parts (4 × 4)

Reaction at each held DOF, with its parts
KRF·uFKRR·uRPRR
1x100010
1y7.5007.5
2x−3000−30
2y22.50022.5

Units: kip.

  • A dot or a light 0 stands for an exact zero.

The two end displacements of the bar in its own axis come from the four global ones picked out by the code vector and turned by T. The end forces are k times them. The axial force is the bar’s stiffness EA/L times its change of length, positive when the bar is in tension; the stress is that force over the area, and the elongation is the change of length.

Bar 1 is in compression: it is pushed and shortens.

  • ue = u(code)
  • ulocal = T·ue
  • f = k·ulocal
  • N = f2 = (EA/L)(uj − ui)
  • σ = N/A
  • δ = uj − ui

End displacements of member 1 in global axes (4 × 1)

End displacements of member 1 in global axes
ue
1x0
1y0
3x0.0005388
3y−0.001437

Units: ft.

  • A dot or a light 0 stands for an exact zero.

End displacements of member 1 in its own axes (2 × 1)

End displacements of member 1 in its own axes
ulocal
u10
u3−0.000431

Units: ft.

  • A dot or a light 0 stands for an exact zero.

End forces of member 1 in its own axes (2 × 2)

End forces of member 1 in its own axes
k·ulocalf
u112.512.5
u3−12.5−12.5

Units: kip.

Axial force, N
N = f2 = −12.5 kip
Stress, σ = N/A
σ = N/A = −180 kip/ft²
Elongation, δ
δ = uj − ui = −0.000431 ft

The two end displacements of the bar in its own axis come from the four global ones picked out by the code vector and turned by T. The end forces are k times them. The axial force is the bar’s stiffness EA/L times its change of length, positive when the bar is in tension; the stress is that force over the area, and the elongation is the change of length.

Bar 2 is in compression: it is pushed and shortens.

  • ue = u(code)
  • ulocal = T·ue
  • f = k·ulocal
  • N = f2 = (EA/L)(uj − ui)
  • σ = N/A
  • δ = uj − ui

End displacements of member 2 in global axes (4 × 1)

End displacements of member 2 in global axes
ue
2x0
2y0
3x0.0005388
3y−0.001437

Units: ft.

  • A dot or a light 0 stands for an exact zero.

End displacements of member 2 in its own axes (2 × 1)

End displacements of member 2 in its own axes
ulocal
u20
u3−0.001293

Units: ft.

  • A dot or a light 0 stands for an exact zero.

End forces of member 2 in its own axes (2 × 2)

End forces of member 2 in its own axes
k·ulocalf
u237.537.5
u3−37.5−37.5

Units: kip.

Axial force, N
N = f2 = −37.5 kip
Stress, σ = N/A
σ = N/A = −540 kip/ft²
Elongation, δ
δ = uj − ui = −0.001293 ft

Three independent checks catch a mistake. Equilibrium: the loads and reactions cancel in the x direction, in the y direction and in moments about the centre of the structure (8, 3); so does every joint. Energy: the strain energy stored equals the work of the loads plus the work of the reactions through any settlement. Residual: K·u − P − R is zero at every DOF.

Each is judged against one tolerance: it passes when it is no larger than 1 × 10^−8 of the problem’s force scale, 60 kip.

Balanced: every check passes.

  • ΣFx = 0
  • ΣFy = 0
  • ΣM = 0
  • Pnodal + R − Σ fglobal = 0
  • U = ½·uT·K·u = ½·uT·P + ½·uRT·R
  • K·u = P + R
Sum of forces along x
ΣFx = ΣPx + ΣRx = 0 kip
Sum of forces along y
ΣFy = ΣPy + ΣRy = 0 kip
Sum of moments
ΣM = ΣM(P) + ΣM(R) = 0 kip·ft

Force left over at each DOF (6 × 1)

Force left over at each DOF
joint imbalance
1x0
1y0
2x0
2y0
3x0
3y0

Units: kip.

  • A dot or a light 0 stands for an exact zero.
Energy stored, ½uᵀKu
U = ½·uT·K·u = 0.02694 kip·ft
Work of loads and reactions, ½uᵀP + ½u_RᵀR
W = ½·uT·P + ½·uRT·R = 0.02694 kip·ft

Force left over at each DOF (6 × 1)

Force left over at each DOF
K·u − P − R
1x0
1y0
2x0
2y0
3x0
3y0

Units: kip.

  • A dot or a light 0 stands for an exact zero.

The calculation runs in your browser. Nothing you enter is sent to us.

Method

How the solution is built

The direct stiffness method turns a whole structure into one matrix equation, K·u = P + R, and solves it. K is the stiffness matrix of the structure, u the displacements of all its nodes, P the loads put on them and R the forces the supports add. The tool works as a person does on paper and prints every step, with its numbers, its symbols and the cells that matter marked. What follows is the same method, in the order the tool lists it.

Degrees of freedom (DOFs) come first (step 1). A truss node has two, a displacement along x and one along y; a frame node has a third, its rotation. They are numbered node by node: node n has DOFs 2n − 1 and 2n in a truss, and 3n − 2, 3n − 1 and 3n in a frame. That order is the order of the rows and columns of every global matrix and of every global vector, so the number of a row says which movement it is about. A DOF that a support holds is restrained, or held; every other one is free.

Each member is first taken in axes of its own (steps 2 and 3), with x̄ running along it from its first node i to its second node j. A bar, which carries axial force alone, has one movement at each end, and its matrix is k = (EA/L)·[1 −1; −1 1], where E is the modulus, A the area and L the length. A column of any stiffness matrix is the set of forces that hold a member in the shape of one unit movement, every other movement being zero. Here the first column says that shortening the bar by one unit takes a push of EA/L on each end.

A frame member is a beam-column with six movements, a displacement along x̄, one along ȳ and a turn at each end, so its matrix is 6 × 6. It is made of five numbers: EA/L for the axial terms and, for bending, 12EI/L³, 6EI/L², 4EI/L and 2EI/L, each cell taking the sign its position gives. Move the first end sideways by one unit and the member answers with a shear of 12EI/L³ and a moment of 6EI/L² at that end. Turn it by one unit and the moment there is 4EI/L, and 2EI/L at the far end.

Members point every way, so each is turned into the global axes before it is added (steps 4 and 5). With c = cosθ and s = sinθ for the member’s direction, pointing away from node i toward node j, the end movements in global axes give the local ones by u_local = T·u_global. The matrix T holds c and s; for a frame member it is [c s 0; −s c 0; 0 0 1] at each end, since a rotation is the same in every set of axes. The member’s matrix in global axes is K_e = T^T·k·T, with T^T the transpose of T. For a bar it is (EA/L)·[c² cs −c² −cs; cs s² −cs −s²; −c² −cs c² cs; −cs −s² cs s²], which the tool prints beside the product as a second route to the same figures.

Assembly adds the members up (step 6). Each member has a code vector: the numbers of the global DOFs that its own DOFs correspond to, in order, as in [1 2 5 6] for a bar from node 1 to node 3. The entry in row a and column b of K_e is added to K at row code(a) and column code(b), K ← K + K_e. Two members that meet at a node both add into the cells of that node’s DOFs, and their sum is the stiffness the joint offers to that movement. The tool shows each member’s contribution, the running K after it and, last, the whole K with the cells that more than one member reached marked.

Loads come next (step 7). A load at a node goes into the load vector P at the DOF it acts along, and a couple at a node goes to its rotation. A load on a member (frame mode) is a uniform load over its length, a point load or an axial load, each along the member’s own axes, and each is exchanged for its fixed-end forces f_FE: what two clamps would exert to keep both ends from moving. A uniform load w has wL/2 and wL²/12 (in size), an axial load q has qL/2 along the member at each end, and a point load P, with a and b the distances to its first and second ends, has Pb²(3a+b)/L³ and Pab²/L² at the first end and Pa²(a+3b)/L³ and Pa²b/L² at the second. The equivalent nodal loads, −T^T·f_FE, are their opposite in global axes and join P; the member’s end forces take f_FE back when they are found.

The DOFs are then split into free (F) and restrained (R), and K, P and u are cut into blocks to match (step 8). The free rows give K_FF·u_F = P_F − K_FR·u_R (step 9). Here u_R holds what the supports allow: zero, unless a support is given a settlement, which then acts as a load, −K_FR·u_R. The restrained rows are kept for later, when they give the reactions.

This reduced equation is solved by Gaussian elimination, without exchanging rows (step 10). At column k the pivot a_kk is the diagonal entry; for each row i below it, l_ik = a_ik/a_kk is the multiple of row k to take away, a_ij ← a_ij − l_ik·a_kj, which leaves zeros under the pivot. When the matrix is triangular the unknowns come from the bottom up, u_k = (b_k − Σ a_kj·u_j)/a_kk. No exchange is needed because K_FF is symmetric and positive definite when the structure is stable, so every pivot is positive.

A pivot under a billionth of the diagonal entry it started as is taken as zero. It means that nothing in the structure resists some movement: the members can swing without stretching or shortening, and that is a mechanism. The tool stops there, shows the steps worked out until then and names the DOF. A smallest pivot under a millionth of its start, but above a billionth, is solved with a warning: the structure is nearly a mechanism, and its displacements change a great deal if any one stiffness changes even a little.

The free displacements and the prescribed ones make up the whole vector u (step 11). The reactions come from the restrained rows, R = K_RF·u_F + K_RR·u_R − P_R, one for each restrained DOF (step 12). A reaction is the force or moment a support applies to the structure.

Each member then reads its end movements u_e from u through its code vector, turns them to local axes, u_local = T·u_e, and multiplies by its matrix, f = k·u_local, adding f_FE if it carries a load (step 13). For a bar, N = (EA/L)(u_j − u_i) in local axes; the tool also gives the stress N/A and the elongation. For a frame member, N, V and M at both ends follow from f with the signs given further down.

Step 14 tests the answer. Loads and reactions are added up along x, along y and as a moment taken about the centre of the box around the nodes; every joint is balanced against the end forces of the members that meet there; the strain energy U = ½·u^T·K·u is compared with the work ½·u^T·P + ½·u_R^T·R; and K·u − P − R is read at every DOF, with the elimination’s own residual. Each is measured against the size of the terms that make it up, with a limit of a hundred-millionth. A structure for which one of them is missed is refused as ill-conditioned, and no results are given for it.

A first worked case is the two-bar truss the page opens with. Nodes 1, 2 and 3 are at (0, 0), (16, 0) and (8, 6) ft. Bar 1 joins nodes 1 and 3, bar 2 joins nodes 2 and 3, and nodes 1 and 2 are pinned. Both bars have E = 29,000 ksi and A = 10 in², and node 3 carries 20 kip to the right and 30 kip down.

Each bar is 10 ft long, so EA = 290,000 kip and EA/L = 29,000 kip/ft. Bar 1 has c = 0.8 and s = 0.6; bar 2 runs from node 2 up to node 3, so c = −0.8 and s = 0.6. The DOFs are 1 and 2 at node 1, 3 and 4 at node 2, and 5 and 6 at node 3, so the code vectors are [1 2 5 6] and [3 4 5 6]. At DOFs 5 and 6, bar 1 adds 29,000 × [0.64 0.48; 0.48 0.36] and bar 2 adds 29,000 × [0.64 −0.48; −0.48 0.36]. The cross terms cancel, and K_FF = [37,120 0; 0 20,880] kip/ft.

With P_F = [20; −30] kip and the supports not moving, nothing lies under the diagonal to eliminate: u_5 = 20/37,120 and u_6 = −30/20,880, which are 0.00647 in to the right and 0.01724 in down. The reactions are R_1 = 10, R_2 = 7.5, R_3 = −30 and R_4 = 22.5 kip. N = (EA/L)(u_j − u_i) is −12.5 kip in bar 1 and −37.5 kip in bar 2, both in compression, and ΣFx = 20 + 10 − 30 = 0 and ΣFy = −30 + 7.5 + 22.5 = 0. By joint equilibrium at node 3, −0.8·N_1 + 0.8·N_2 + 20 = 0 and −0.6·N_1 − 0.6·N_2 − 30 = 0 give the same two forces.

A frame needs bending, so take one member of length L, fixed at node 1 and loaded by P downward at node 2. The load has no axial part: the axial row holds only EA/L, nothing couples it to the others and its movement comes out zero. The other two free rows, for v_2 and θ_2, are K_FF = [12EI/L³ −6EI/L²; −6EI/L² 4EI/L] with P_F = [−P; 0]. The multiplier is l = (−6EI/L²)/(12EI/L³) = −L/2; taking l times the first row from the second leaves EI/L where 4EI/L stood and −PL/2 on the right. Back-substitution gives θ_2 = −PL²/(2EI) and v_2 = −PL³/(3EI), the textbook rotation and deflection at the tip, and the reactions at node 1 are P upward and PL counter-clockwise.

Reading the matrices. Each matrix and vector has its rows and columns named by DOF: 3y is the y movement of node 3 and 2θ the rotation of node 2. Row d of K is the equation of equilibrium of DOF d. Column d is the set of forces, at every DOF, that hold the structure in the shape of a unit movement of DOF d, every other DOF being held still, so the entry in row a and column b is the force at a when b moves one unit.

The unit of an entry follows from its two DOFs: a force per length between two movements (kip/ft, or kN/m), a force per radian between a movement and a rotation (kip/rad, kN/rad), and a moment per radian between two rotations (kip·ft/rad, kN·m/rad).

K is symmetric: the force at a for a unit movement of b is the force at b for a unit movement of a, which is Maxwell and Betti’s reciprocity, and the tool tests it. No diagonal entry is negative. A zero off the diagonal means that moving one DOF asks no force at the other: no member joins their nodes, or the member that does has no stiffness across that direction (a horizontal bar and a movement across it), or terms cancelled, as the cross terms did in the example. Before supports are applied K has no inverse: a movement of the whole structure as a rigid body takes no force at all, so K·u is zero for it, whatever the loads. The supports remove those movements, and K_FF can be solved.

Within a member matrix the axial terms and the bending terms share no cell in local axes, because stretching a member does not bend it; the turn to global axes mixes them. The tool marks the axial and the bending terms of k, the cells where a member lands in the assembly and those that more than one member reached, and in the elimination the pivot, the cells it reduces to zero and those it changes.

The entries are physical stiffnesses. For a column of height h fixed at its foot, 12EI/h³ is the force that sways its top one unit with the top kept from turning. A beam that cannot turn, on two such columns that cannot shorten, makes a stiffness of 24EI/h³, so a horizontal force H sways it by Hh³/(24EI).

What it assumes

  • The material is taken as linear elastic and the analysis as first order. Equilibrium is set up on the geometry as drawn, displacements are treated as small, and second-order effects, P–Δ among them, and buckling are not modelled: a slender member in compression is not flagged.
  • Each member is prismatic: one section, and so one E, one A and one I, for its whole length. Bending follows the Euler–Bernoulli theory, in which sections stay plane and square to the axis; the distortion shear would cause is left out.
  • A bar is pinned at both ends and carries axial force alone, so a truss takes its loads at its nodes. Member loads typed in truss mode are kept and not used, and the tool says so.
  • In frame mode every member is joined rigidly to the nodes at both ends. Hinges and releases, springs and inclined supports are not offered here: a support holds a global movement, along x, along y or the rotation, and no other direction.
  • In frame mode a member’s own length also changes with its axial force, so a hand solution in which lengths cannot change will not match to the last figure.
  • Member loads are a uniform load over the whole member, a point load strictly between the ends and a uniform axial load, each along the member’s own axes. A load at an end goes in as a nodal load. There is no temperature load, and no self-weight unless it is entered as a load.
  • A support may be given a settlement along x, along y or as a rotation, on a DOF that it holds. A value typed on a DOF the support leaves free has no effect, and the tool warns of it.
  • The two moduli offered as starting points, for steel and for aluminum, are typical values: enter the modulus and the section of what is actually specified.
  • One static case is analysed at a time. Loads are taken as entered, with no factor and no combination; each combination of loads is a case to enter on its own.

What it leaves out

  • The results are displacements, reactions and member end forces, and that is all: no design code, no factored load, no member or connection sized. Judging a member is left to you.
  • Up to 12 nodes, 20 members, 12 supports, 40 nodal loads and 24 member loads, which is at most 36 DOFs. The cap keeps every matrix small, so that it can be read on a screen.
  • The elimination is printed column by column up to 12 free DOFs; with more, the tool gives its result and its residual and none of the columns.
  • A structure in which some movement meets no resistance, because the members can swing without stretching or shortening, is refused. The message names the DOF where the elimination broke down and the nodes that move. Two collinear truss bars meeting at a node with no support are the usual case: nothing resists a movement across their line, and a zero stands on the diagonal. To cure it, tie the node into the structure with another member, or hold it with a support.
  • Fewer than three restrained DOFs is refused before any solving, because a body in a plane needs three to stay in place. Three that still leave a movement of the whole structure, such as reactions on three parallel lines, are found by the elimination as a mechanism of the whole structure.
  • Each of these is refused, and the entry at fault is named: two nodes in one place; a member that starts and ends at one node; two members joining the same two nodes; a node that no member reaches; a structure in separate pieces; a member whose length is under a hundred-thousandth of the structure’s size; a point load not strictly inside its member; a section left blank where one is needed; and a number too large for the arithmetic.
  • A very stiff member beside very soft ones can leave the arithmetic short of figures. The checks of the last step measure that, and a structure that misses one is refused as ill-conditioned.
  • Truss member forces and Plane frame analysis solve the same kinds of structure without printing a matrix, and the second takes hinges, springs, inclined supports, temperature loads and larger structures. This one is for reading the method, and for comparing a small case with those.

Signs, units and the meaning of each result

  • The global axes run x to the right and y up. Loads and reactions are positive along +x and +y, so gravity is a negative y load; moments, rotations and couples are positive counter-clockwise. Nodes, members and rows are counted from 1.
  • A DOF is named by its node and its direction: 3x and 3y are the movements of node 3 along x and y, and 3θ is its rotation, in radians. Inside a member the local movements are u, v and θ at each end, named by the node: u1, v1, θ1, u3, v3, θ3.
  • The local axes of a member: x̄ points along it from its first node toward its second, and ȳ lies 90° counter-clockwise from x̄, on its left, so a horizontal member that runs left to right has ȳ up. The member loads w and P are positive along +ȳ, which makes gravity on such a member negative, and q is positive along +x̄. A point load acts at a, measured from the first node.
  • f holds what the two nodes apply to the member, in its local axes: [Fx_i, Fy_i, M_i, Fx_j, Fy_j, M_j] for a frame member and [f_i, f_j] for a bar. The forces inside the member, next to each end, follow from it: N = −Fx_i, V = Fy_i and M = −M_i at the first end, and N = Fx_j, V = −Fy_j and M = M_j at the second.
  • A member in tension has a positive N. V is positive when the forces acting on the part of the member on the first node’s side of the cut together push toward +ȳ. M is positive for tension at the −ȳ face, the underside of a horizontal member that runs left to right: sagging.
  • Worked case: member 1 runs from node 1 at (0, 0) to node 2 at (10, 0) ft, fixed at both ends, under w = −2 kip/ft. Its fixed-end forces are f_FE = [0, 10, 16.667, 0, 10, −16.667], so at the first end V = 10 kip and M = −16.667 kip·ft, and at the second V = −10 and M = −16.667: tension on the top face at both ends. Drawn from right to left, ȳ points down and the same load is w = +2; then V = −10 at the first end and 10 at the second, and M = 16.667 at both ends, the same top-face tension with the opposite sign.
  • A reaction is the force or moment a support applies to the structure, along a global axis: positive toward +x and +y, a moment positive counter-clockwise. In a bar, tension gives a positive N, the stress is N/A, and the elongation u_j − u_i, in local axes, is positive when the bar lengthens.
  • In the US set, a length is in feet and a force in kip; a line load is in kip/ft and a moment in kip·ft; E is in ksi, A in in² and I in in⁴, and a settlement in inches. In the SI set, a length is in metres and a force in kilonewtons; a line load is in kN/m and a moment in kN·m; E is in GPa, A in mm² and I in 10⁶ mm⁴, and a settlement in millimetres. A rotation, a settlement’s included, is in radians in both.
  • The matrices and vectors of the steps are in calculation units: feet and kip, or metres and kilonewtons, with E in kip/ft² and A in ft² (kN/m² and m²). The results tables show displacements in inches or millimetres and the stress of a bar in ksi or MPa.
  • A value under a billionth of the largest in its own matrix or vector is printed as 0, since it is rounding; the arithmetic keeps every figure.
  • The structure is written into the page’s address after #m=; pasting that address into a browser brings it back.

Use it as an engineer would

This calculator is an aid for people qualified to judge its results. It is not an engineering opinion on any structure, and it comes with no warranty. Check the results by independent means: a decision in a design rests on your own check, never on this calculator. Tercero Tablada Civil and Structural Engineering Inc. did not prepare, review or seal what is computed with it, and accepts no responsibility for its results or for how they are used.

Produced with the stiffness matrix calculator of Tercero Tablada Civil and Structural Engineering Inc. — ttcivilstructural.com/resources/stiffness-matrix-step-by-step