Stiffness Matrix Calculator
Assemble the stiffness matrix of a bar, truss element or two-spring system and solve for the displacements and reactions under load.
🔩 What is a Stiffness Matrix?
A stiffness matrix collects the stiffness of a structure or a part of it into one table of numbers that links forces to displacements. For a structure with several degrees of freedom the relation is K u = F, where u lists the node displacements, F lists the forces applied at those nodes, and K is the stiffness matrix. Entry Kij is the force needed at degree of freedom i to cause a unit displacement at degree of freedom j while all other displacements are held at zero. This idea is the foundation of the direct stiffness method, the most common way to implement the finite element method, in which element matrices are assembled into one global matrix and solved with the boundary conditions applied.
The two simplest cases are covered here. A 2-node bar or truss element carries only axial force. Its stiffness is k = EA/L, with E the Young's modulus, A the cross-section area and L the length. In its own axis the matrix is k [[1, -1], [-1, 1]]. Rotated to an angle θ in the plane it becomes a symmetric 4 x 4 matrix with entries k times cos squared, sin squared and sin times cos. A 2-DOF spring system, a wall, two nodes and up to three springs, is the classic first example of assembly, with K = [[k1 + k2, -k2], [-k2, k2 + k3]]. These are the building blocks of larger truss, frame and spring-mass models, and they show every step of the method with numbers small enough to follow by hand.
A few facts are worth remembering. An element matrix on its own is singular: it has zero determinant because the element can translate as a rigid body without storing strain energy, so you must fix at least one node before solving. The matrix is symmetric, which follows from the reciprocity of linear elastic systems, and each row sums to zero. The matrix also depends only on geometry and material, not on the loads, so one matrix serves every load case. Finally, a bar element ignores bending. For beams and frames you need elements with rotational degrees of freedom and a larger matrix.
This calculator has two modes. Bar or truss element builds the local and global matrices from E, A, L and the angle, and with an optional axial force gives the elongation, stress, strain, strain energy and the node shift. Spring system assembles K, solves K u = F, and reports the displacements, wall reactions, spring forces and an equilibrium check. Both modes show their matrices in tables and have a chart.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Horizontal Steel Bar
E = 200 GPa, A = 500 mm², L = 2 m, θ = 0°, P = 50 kN
Example 2 — Aluminium Diagonal at 45 Degrees
E = 70 GPa, A = 300 mm², L = 1.5 m, θ = 45°, P = 20 kN
Example 3 — Vertical Timber Post
E = 10 GPa, A = 10,000 mm² (100 mm by 100 mm), L = 3 m, θ = 90°, P = 30 kN
Example 4 — Two Springs in Series with a Free End
k1 = 200 N/mm, k2 = 100 N/mm, k3 = 0, F1 = 500 N, F2 = 1000 N
Example 5 — Springs Fixed at Both Ends
k1 = 100 N/mm, k2 = 50 N/mm, k3 = 100 N/mm, F1 = 0, F2 = 600 N
Example 6 — Loading Only Node 1 (Node 2 Follows)
k1 = 40 kN/m, k2 = 60 kN/m, k3 = 0, F1 = 2 kN, F2 = 0
❓ Frequently Asked Questions
🔗 Related Calculators
What is the stiffness matrix of a 2-node bar element?
In local coordinates it is k [[1, -1], [-1, 1]] with k = EA/L, where E is Young's modulus, A the cross-section area and L the length. It relates the axial end forces to the axial end displacements. A steel bar with E = 200 GPa, A = 500 mm2 and L = 2 m has k = 50,000 kN/m.
How do you get the global stiffness matrix of a truss element?
Rotate the local matrix by the element angle. With c = cos(theta) and s = sin(theta) the 4 x 4 global matrix is (EA/L) times [c2, cs, -c2, -cs; cs, s2, -cs, -s2; -c2, -cs, c2, cs; -cs, -s2, cs, s2]. At 45 degrees every entry has magnitude k/2.
Why is the element stiffness matrix singular?
An unsupported element can move as a rigid body without storing any strain energy, so its stiffness matrix has zero determinant and no unique solution. You need boundary conditions, such as fixing one node, before you can solve K u = F.
What is the stiffness matrix of a two spring system?
For a wall, spring k1, node 1, spring k2, node 2 and an optional spring k3 to a second wall, K = [[k1 + k2, -k2], [-k2, k2 + k3]]. With k3 = 0 node 2 is free. The determinant is k1 k2 + k1 k3 + k2 k3.
How do I solve for displacements from the stiffness matrix?
Solve K u = F. For two degrees of freedom, u1 = (F1 (k2 + k3) + k2 F2) / det and u2 = (k2 F1 + (k1 + k2) F2) / det, with det = k1 k2 + k1 k3 + k2 k3. For k1 = 200, k2 = 100 N/mm, F1 = 500 N and F2 = 1000 N this gives 7.5 mm and 17.5 mm.
How do I find the support reactions?
Reaction at a wall equals minus the spring stiffness times the node displacement, R = -k u. In the default example the left wall reaction is -1500 N, balancing the applied 500 N and 1000 N. The calculator checks that the forces sum to zero.
Why does node 2 move the same amount as node 1 when F2 is zero?
If k3 = 0 and no load acts on node 2, spring 2 carries no force, so it does not stretch and node 2 simply follows node 1. With k1 = 40, k2 = 60 kN/m and F1 = 2 kN both nodes move 50 mm.
What is the difference between a truss element and a beam element?
A truss (bar) element carries only axial force, so each node has two translations in 2D and the matrix is 4 x 4. A beam element also carries bending and shear and adds rotations, giving a 6 x 6 matrix. This calculator covers the bar and spring cases.
What units should I use for stiffness?
Use the selectors. Young's modulus can be GPa or MPa, area mm2, cm2 or m2, length m or mm, spring stiffness N/m, N/mm or kN/m, and loads N or kN. The selectors only tell the calculator how to read your number, and they never change what you typed.
How does the angle change the stiffness matrix?
The axial stiffness k does not change, but how it spreads across the x and y degrees of freedom does. A horizontal element has only K11 = k, a vertical element only K22 = k, and at 45 degrees K11, K22 and K12 all have magnitude k/2.
How do I get the elongation of a bar from its stiffness?
Divide the axial force by the stiffness, delta = P / k = P L / (E A). A 50 kN force on the 50,000 kN/m steel bar gives 1.000 mm, a stress of 100 MPa and a strain of 500 microstrain.