Calculator
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
A working aid, not a design, engineering opinion or sealed document. No warranty: check every result independently. Terms of Use→
The structure and its solution
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
- Rx = 30 kip to the left, at node 2
- Largest bar force
- −37.5 kip in member 2
Structure, loads, reactions and deformed shape · ft, kip
Deformed shape magnified 600 times; the biggest movement, at any point, is 0.01841 in.
Arrow lengths are not to scale.
- The structure before loading
- Node, with its number
- Deformed shape, magnified 600 times
- Support holding x and y
- Load at a node (solid arrow)
- Reaction (dashed arrow, open head)
- The number beside an arrow or a ring is its size; for a load spread over a member, its intensity
- 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: 30 kip, horizontal, at node 2.
Node displacements
| Node | Along x (in) | Along y (in) | Total (in) |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 |
| 3 | +0.006466 | −0.01724 | 0.01841 |
Displacements are positive towards +x and +y, rotations counter-clockwise. Rotations are given in radians, with the degrees alongside.
Reactions
| Supports | Node | Along x (kip) | Along y (kip) |
|---|---|---|---|
| 1 | 1 | +10 | +7.5 |
| 2 | 2 | −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
| Bar | Nodes | Length (ft) | Axial force (kip) | State | Stress (ksi) | Elongation (in) |
|---|---|---|---|---|---|---|
| 1 | 1 – 3 | 10 | −12.5 | compression | −1.25 | −0.005172 |
| 2 | 2 – 3 | 10 | −37.5 | compression | −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.
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.
26 steps, none chosen yet
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 with E in ksi, A in in²; the calculation works with E in kip/ft², A in 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)
| x | y | |
|---|---|---|
| 1 | 0 | 0 |
| 2 | 16 | 0 |
| 3 | 8 | 6 |
Units: ft.
- A dot or a light 0 stands for zero: an exact zero, or a value too small to tell from rounding.
Connectivity: first and second node of each member (2 × 2)
| i | j | |
|---|---|---|
| 1 | 1 | 3 |
| 2 | 2 | 3 |
Section of each member (2 × 2)
| E | A | |
|---|---|---|
| 1 | 4,176,000 | 0.06944 |
| 2 | 4,176,000 | 0.06944 |
Units: E in kip/ft²; A in ft².
Degree-of-freedom numbers (3 × 2)
| x | y | |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 3 | 4 |
| 3 | 5 | 6 |
Restraints: 1 is held, 0 is free (3 × 2)
| x | y | |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 0 | 0 |
- A dot or a light 0 stands for zero: an exact zero, or a value too small to tell from rounding.
Prescribed displacement of every DOF (0 where nothing is prescribed) (6 × 1)
| u prescribed | |
|---|---|
| held 1x | 0 |
| held 1y | 0 |
| held 2x | 0 |
| held 2y | 0 |
| 3x | 0 |
| 3y | 0 |
Units: ft.
- held DOF
- A dot or a light 0 stands for zero: an exact zero, or a value too small to tell from rounding.
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)
| u1 | u3 | |
|---|---|---|
| u1 | axial term EA/L29,000 | axial term −EA/L−29,000 |
| u3 | axial term −EA/L−29,000 | axial term EA/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
This step holds a table of 2 × 2 and 1 value. They are drawn when you reach this step.
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θ
This step holds a table of 2 × 4 and 2 values. They are drawn when you reach this step.
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θ
This step holds a table of 2 × 4 and 2 values. They are drawn when you reach this step.
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²]
This step holds 4 tables (the largest 4 × 4). They are drawn when you reach this step.
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²]
This step holds 4 tables (the largest 4 × 4). They are drawn when you reach this step.
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
This step holds 2 tables (the largest 6 × 6). They are drawn when you reach this step.
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
This step holds 2 tables (the largest 6 × 6). They are drawn when you reach this step.
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
This step holds a table of 6 × 6. They are drawn when you reach this step.
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)
This step holds a table of 6 × 1. They are drawn when you reach this step.
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
This step holds a table of 6 × 1. They are drawn when you reach this step.
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]
This step holds 2 tables (the largest 6 × 6). They are drawn when you reach this step.
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
This step holds a table of 2 × 3. They are drawn when you reach this step.
Gaussian elimination works on the matrix KFF with the right-hand side written beside it as one more column: [KFF | rhs]. Each column of the elimination below changes it, and every change is the same change made to a row of the equations.
This step holds a table of 2 × 3. They are drawn when you reach this step.
Column 1 takes the diagonal entry of DOF 3x as its pivot, akk = 37,120 kip/ft. Each row below it gets a multiplier mik, 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.
- mik = aik/akk
- aij ← aij − mik·akj
This step holds 2 tables (the largest 2 × 3) and 1 value. They are drawn when you reach this step.
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
This step holds a table of 1 × 1 and 1 value. They are drawn when you reach this step.
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
This step holds a table of 2 × 1 and 1 value. They are drawn when you reach this step.
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
This step holds 2 tables (the largest 2 × 1) and 1 value. They are drawn when you reach this step.
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 inches.
- u = [uF; uR]
This step holds a table of 6 × 1. They are drawn when you reach this step.
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
This step holds a table of 4 × 4. They are drawn when you reach this step.
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
This step holds 3 tables (the largest 4 × 1) and 3 values. They are drawn when you reach this step.
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
This step holds 3 tables (the largest 4 × 1) and 3 values. They are drawn when you reach this step.
Three 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 check is held to a scale of its own and is within its tolerance when it is at most 1 × 10⁻⁸ of that scale plus the rounding of its own terms. The scale is the force scale, 50 kip (the largest of the loads added up, the largest reaction and the largest end force), for the sums of forces, the balance of each joint and K·u − P − R; that times the size of the structure for the moment; the work of the loads and the reactions added up in size, 0.02694 kip·ft, for the energy; and the size of its own equation for the residual of step 10. The rounding allowed is 100 roundings of the arithmetic times the sizes of the terms added up, at most 4.733 × 10⁻²⁷ kip here.
Balanced: every check is within its tolerance.
- ΣFx = 0
- ΣFy = 0
- ΣM = 0
- Pnodal + R − Σ fglobal = 0
- U = ½·uT·K·u = ½·uT·P + ½·uRT·R
- K·u = P + R
This step holds 2 tables (the largest 6 × 1) and 5 values. They are drawn when you reach this step.
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, the multiplier m_ik = a_ik/a_kk is the multiple of row k to take away, a_ij ← a_ij − m_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.
The arithmetic, and a pivot it cannot tell from zero. Every number is worked in about thirty significant figures, twice what a calculator keeps, and printed to the figures chosen; that is what lets a member a million times stiffer than its neighbours, a rigid link or an inextensible column, keep its figures. Beside every entry the tool keeps the largest error that rounding could have put in it, grown as the elimination goes, and a pivot no more than ten times its own error is taken as zero: the elimination stops there, shows the steps worked out until then and names the DOF. What that means depends on the movement the DOF allows, found from the rows already eliminated. If that movement strains no member, nothing in the structure resists it: the members can swing without stretching or shortening, and that is a mechanism, even with a very stiff member among them. If it strains a member, the null space of the matrix is searched for another movement that does not, and only if none is found is the structure called stable and its stiffnesses too far apart for thirty figures; it is refused as that, and not called a mechanism. A solution whose results could be wrong by a millionth of the largest of their kind or more, but by less than a tenth, is solved with a warning that says how many figures to trust.
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 held to a hundred-millionth of a scale of its own, with an allowance for the rounding in its terms: the sums, the joints and K·u − P − R against the largest force of the problem, the energy against the work done, and the residual against the equations it solved. A structure for which one of them is missed is refused as ill-conditioned, and no results are given for it.
Worked case 1, 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.
Worked case 1, the matrices. 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.
Worked case 1, the answer. 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.
Worked case 2, a cantilever. 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 m = (−6EI/L²)/(12EI/L³) = −L/2; taking m 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.
Units of an entry. 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).
Symmetry and zeros. 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 to a millionth of a millionth of the largest entry. 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.
Marks in the tables. 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.
What an entry means. 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. The tool does say when the displacements are not small: when the chord of a member turns past a tenth of a radian, when an end of a frame member turns past a tenth of a radian away from its chord, or when a member stretches or shortens by over a tenth of its own length, the numbers are those of the theory and not of the structure.
- 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 value is kept in the support’s row, ready for when that movement is held.
- 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. Each system lists its own typical moduli for steel and for aluminum, a few hundredths of one percent from the other system’s: switching the units swaps one listed modulus for the other and converts every other value exactly, so the two systems differ in the fourth figure of a result.
- 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 next to soft ones is what the thirty figures of the arithmetic are for: a rigid link or an inextensible column up to some twenty orders of magnitude stiffer than the rest is solved to eight figures or more. Beyond that the warning of the elimination says how many figures remain, and the checks of the last step catch what is left: a structure that misses one is refused as ill-conditioned, and one with not a figure left as a stiffness range. A stub of a member or members lying nearly along one line are warned of in the same way.
- 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. For a frame member f_1, f_2 and f_3 are the force along it, the force across it and the moment where it starts, and f_4, f_5 and f_6 the same where it ends; for a bar f_1 and f_2 are its two end forces. The forces inside the member, next to each end, follow from it: N = −f_1, V = f_2 and M = −f_3 at the first end, and N = f_4, V = −f_5 and M = f_6 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 US units, 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 SI units, 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 number is printed as 0 only when it is no larger than the rounding of the terms it was made of, in the assembly, the elimination and every step after it, so the numbers printed are the numbers computed: a small number that is real is shown, and rounding is never shown as a number. In the checks of the last step a sum under a billionth of its scale is printed as 0.
- 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


