Stiffness matrix calculator

A stiffness matrix links every force on a structure to every displacement: F = K u. Build a small model of springs, truss bars, beams or a plane frame, and this calculator writes each element's stiffness matrix, assembles the global stiffness matrix, applies your supports and solves for the displacements, reactions and member forces, with every step shown. Free, no sign-up, runs in your browser.

Every preset checked against a hand solution and an independent solver · Updated 22 Nov 2026

Nodes: coordinates, supports (tick = restrained) and loads
Elements: node i → node j and properties

model · deformed shape, exaggerated

    Displacements
    Support reactions
    Member forces

    Step by step

    1. Element stiffness matrices

    Local [k]
    Global [K] = Tᵀ k T, labelled with its global DOFs

    2. Assemble the global stiffness matrix

    Each element adds its global matrix into the rows and columns of its two nodes' degrees of freedom. Highlighted: the selected element's terms. Dimmed: restrained DOFs, removed in step 3.

    Global stiffness matrix

    3. Apply the supports and solve

    Keep only the free rows and columns: Kff uf = Ff, where F holds the nodal loads plus the equivalent nodal loads of any UDL.

    Reduced system Kff · uf = Ff

    4. Reactions and member forces

    R = K u − F at the restrained DOFs. Member end forces in local axes: f = k (T ue) − feq, counter-clockwise moments positive.

    Member end forces, local axes

    What is a stiffness matrix?

    A stiffness matrix is the table that turns displacements into forces for a whole structure, F = K u. Each entry kij is the force at degree of freedom i when degree of freedom j moves by one unit and every other degree of freedom is held still. Each column is one of those unit-displacement states.

    A degree of freedom (DOF) is one way a node can move: slide along x (u), along y (v) or rotate (θ). One spring between two nodes has the simplest stiffness matrix there is. Push node i by one unit with node j held, and you need +k at i and −k at j to hold it there:

    Every structural analysis program, from a hand calculation to STAAD.Pro, ETABS or ANSYS, does the same thing at scale: one small matrix per element, added into one big matrix for the structure, supports applied, then a linear solve. That is the direct stiffness method, and the calculator above does it in front of you.

    How do you assemble the global stiffness matrix?

    Number the DOFs node by node, then add each element's matrix into the rows and columns of its nodes' DOFs. Where two elements share a node their terms add, which is why shared diagonal terms are the sum of the stiffnesses meeting there. The Springs preset above has three springs in series, k = 1000, 2000 and 3000 kN/m, both ends fixed and 10 kN pulling node 3:

    Row 2 reads 3000 = 1000 + 2000 because springs 1 and 2 both meet at node 2. Nodes 1 and 4 are fixed, so their rows and columns go, leaving two equations:

    The reactions come back from the deleted rows: R1 = −1000 × u2 = -1.818 kN and R4 = −3000 × u3 = -8.182 kN, which add to the 10 kN applied. The stiff right-hand spring takes 82% of the load in compression; the two left springs share the rest in tension, 1.818 kN each.

    In general, sort the DOFs into free (f) and supported (s) and partition:

    Programs often use the penalty method instead (a huge number on the diagonal of each restrained DOF), which keeps the matrix size fixed and handles support settlements easily. Both give the same answer to many digits.

    What are the stiffness matrices of a truss, beam and frame element?

    Truss bar. A pin-ended bar only carries axial force, EA/L along its length. At angle θ to the global x axis, its 4 × 4 global matrix in (ui, vi, uj, vj) is:

    Beam element. Two DOFs per node, transverse deflection and rotation, from cubic (Hermite) shape functions. It is exact for end loads in Euler-Bernoulli theory, so one element per span is enough:

    Plane frame element. The beam terms plus the bar's axial term, 6 × 6 in (u, v, θ) at each end, written in the member's own axes and turned into global axes with the rotation matrix T:

    Distributed loads. A UDL w on a beam or frame member goes in as equivalent nodal loads (the fixed-end reactions reversed), and the member's end forces are corrected for them afterwards:

    In this calculator w is positive when it pushes toward your right as you walk from node i to node j, which is downward on a beam drawn left to right.

    Worked example: a two-span continuous beam by the stiffness method

    The Beam tab opens on it: two 5 m spans, 10 kN/m on both, pinned at all three supports, steel with I = 50 × 10⁶ mm⁴ (EI = 10000 kN·m²). Three nodes with (v, θ) each make a 6 × 6 global matrix. All three deflections are restrained, so only the three rotations remain, with EI/L = 2000 kN·m and wL²/12 = 20.83 kN·m:

    The middle row has 8EI/L because two spans meet at node 2. The UDL's end moments cancel there and leave −wL²/12 at node 1 and +wL²/12 at node 3. By symmetry:

    Back-substituting gives R1 = R3 = 18.75 kN (3wL/8), R2 = 62.5 kN (5wL/4) and a hogging moment of -31.25 kN·m over the middle support (−wL²/8): the textbook values, and what the calculator prints. The step people miss is the fixed-end forces. Leave them out and the middle reaction is K u alone, 12.5 kN:

    The Propped cantilever preset is the other classic check: a fixed end, a prop at 6 m and 20 kN at midspan give a prop reaction of 6.25 kN (5P/16), a fixed-end moment of 22.5 kN·m (3PL/16) and 3.94 mm of deflection under the load (7PL³/768EI).

    What do the truss and frame presets check?

    Truss. The triangle is statically determinate: a pin, a roller and three bars. Its bar forces follow from equilibrium alone, so the stiffness method must reproduce the method of joints whatever A is. It does: bar 1-2 carries 11.67 kN in tension, bar 1-3 3.005 kN and bar 2-3 21.03 kN in compression (21 MPa on 1000 mm²), with reactions R1x = -10 kN, R1y = 2.5 kN and R2y = 17.5 kN. Make it indeterminate (add a bar or a support) and the forces start to depend on the bars' stiffnesses: that is where the stiffness method earns its keep.

    Frame. The portal is 4 m high and 6 m wide with fixed bases, 20 kN pushing the top sideways and 15 kN/m on the beam. With the members made axially rigid, our solver reproduces two hand methods: the joint rotation under the beam load from slope-deflection (1.687 × 10⁻³ rad) and the lateral stiffness of a fixed-base portal from Chopra's formula, 4.5 MN/m (ρ = 0.667). With the real areas the top sways 4.51 mm. For single-storey frames, the stiffness calculator condenses this to one number.

    What are the properties of a stiffness matrix?

    • Square, one row and column per DOF.
    • Symmetric, kij = kji (Maxwell-Betti reciprocal theorem).
    • Positive diagonal: pushing a DOF always takes a force in the same direction.
    • Singular before supports: its determinant is zero, one zero eigenvalue per rigid-body motion (1 for springs on a line, 2 for a beam, 3 for a plane truss or frame). The rows of the translation DOFs sum to zero.
    • Positive definite after enough supports, so the reduced system always has one answer. If the calculator reports a singular matrix, the model is a mechanism.
    • Banded and sparse: a DOF only couples to DOFs of nodes it shares an element with. Number nodes along the short direction of a structure and the band stays narrow, which is how big FE models stay solvable.

    What this calculator does not cover

    • Size. Up to 8 nodes and 12 elements: enough for textbook problems and hand checks, not for a building.
    • Loads. Nodal forces and moments plus a uniform load along beam and frame members. No point loads inside a member (put a node there), temperature loads, support settlements or self-weight.
    • Members. Linear elastic, small deflections, Euler-Bernoulli (no shear deformation), no internal hinges and no axial-bending interaction (P-delta).
    • 2D only. Space trusses and frames need 3 and 6 DOFs per node and a 3D rotation matrix.
    From the matrix to the software

    Every FEA package assembles and solves this matrix for you. Knowing what it does is how you set up models that make sense and spot results that don't. Skill-Lync's FEA courses go from these fundamentals to meshing and solving real components in industry tools.

    Frequently asked questions

    What is a stiffness matrix?

    The stiffness matrix K links every force on a structure to every displacement, F = K u. Entry kᵢⱼ is the force needed at degree of freedom i when degree of freedom j moves by one unit and every other one is held at zero. For one spring it is the 2 × 2 matrix [k −k; −k k].

    What is the size of the global stiffness matrix?

    Number of nodes × degrees of freedom per node. Springs on a line have 1 DOF per node, a plane truss 2 (u, v), a beam 2 (v, θ) and a plane frame 3 (u, v, θ). So a 3-node beam gives 6 × 6, and a 4-node portal frame 12 × 12, before any supports are removed.

    Why is the global stiffness matrix singular?

    Because a structure with no supports can move as a rigid body without any force: a line of springs can slide (1 zero-energy mode), a plane truss or frame can slide two ways and spin (3), a beam can translate and rotate (2). Removing the restrained rows and columns takes those modes out and makes the reduced matrix invertible.

    Why is the stiffness matrix symmetric?

    By Maxwell-Betti's reciprocal theorem: the force at i caused by a unit displacement at j equals the force at j caused by a unit displacement at i, so kᵢⱼ = kⱼᵢ for any linear elastic structure. Its diagonal terms are always positive, and after enough supports it is positive definite.

    What is the stiffness matrix of a beam element?

    In (v₁, θ₁, v₂, θ₂) it is (EI/L³)[12 6L −12 6L; 6L 4L² −6L 2L²; −12 −6L 12 −6L; 6L 2L² −6L 4L²], from Hermite cubic shape functions. Column 2, a unit rotation at end 1, needs a moment 4EI/L there and carries 2EI/L to the far end.

    How do you handle a distributed load in the stiffness method?

    Replace it by equivalent nodal loads, the reverse of the fixed-end reactions: wL/2 and wL²/12 at each end for a UDL. Solve with those, then get member end forces as k u minus the equivalent loads. Skipping that last step is the usual mistake: in our two-span beam it gives a middle reaction of 12.5 kN instead of 62.5 kN.

    What is the difference between the element and global stiffness matrix?

    An element matrix describes one member in its own axes. Rotated into global axes (K = TᵀkT) and added into the rows and columns of its nodes' degrees of freedom, all the element matrices sum to the global stiffness matrix of the whole structure. This calculator shows both for every element.

    Related on Skill-Lync

    Sources

    • D. L. Logan, A First Course in the Finite Element Method, 6th ed., Cengage: the spring, bar, plane truss and beam element stiffness matrices, assembly, and work-equivalent nodal loads for a uniform load (wL/2, wL²/12).
    • A. Kassimali, Matrix Analysis of Structures, 2nd ed., Cengage: the plane frame member stiffness matrix in local axes, the transformation K = TᵀkT, partitioning into free and restrained DOFs, and member end forces with fixed-end forces.
    • A. K. Chopra, Dynamics of Structures, Pearson, eq. 1.3.5: lateral stiffness of a one-storey frame with fixed bases, (24EIc/h³)(12ρ + 1)/(12ρ + 4), and Example 1.1 (96EIc/7h³).
    • Beam closed forms used as checks (two-span continuous beam under UDL; propped cantilever with a midspan load): American Wood Council, Design Aid No. 6: Beam Design Formulas with Shear and Moment Diagrams.
    • All numbers on this page: Skill-Lync, scripts/verify/stiffness_matrix.py, an independent numpy implementation that solves every preset and checks it against the hand solution, the method of joints, the beam formulas, slope-deflection and Chopra; this page's solver must match it at build time. 22 Nov 2026.
    Free counselling

    Go from the stiffness matrix to real FEA.

    CAE roles want engineers who can mesh, load and solve real parts and defend the results, not just invert a matrix. A Skill-Lync counsellor can map the course that fits the role you want.

    Talk to a CAE course counsellor

    Free. We call you back, usually the same day.

    By submitting you agree to our Terms and Privacy Policy.

    Talk to a career counsellor

    Talk to a career counsellor

    Free 20-minute call. We'll map the right course to where you want to work.

    By submitting you agree to our Terms and Privacy Policy.