Skip to content
Physics

Stiffness Matrix Calculator

Enter the element type and section properties to get the local element stiffness matrix and, for inclined elements, the rotation transformation matrix and assembled global stiffness matrix. The calculator covers 2D truss (axial-only, 4x4), 2D beam (bending, 4x4 Euler-Bernoulli), and 2D frame (combined, 6x6) elements. Results update instantly as you type and a worked steps panel shows how every coefficient is derived.

Your details

Choose the structural element type. Truss carries axial force only. Beam carries shear and bending. Frame combines all three.
Elastic modulus of the material. Steel is ~200 GPa, concrete ~30 GPa, aluminium ~70 GPa.
Area of the element cross-section. Required for truss and frame elements; ignored for pure beam elements.
Second moment of area about the bending axis. Required for beam and frame elements.
Length of the element between its two nodes.
Angle of the element measured counter-clockwise from the global x-axis. Use 0 for a horizontal element. This is used to compute the transformation matrix and global stiffness matrix.
degrees
Flexural coefficient EI/L^3
7,407,111.1111N/m

Primary bending coefficient driving the shear terms

k[1,1]7,407,111.1111
Axial stiffness AE/L-
Local stiffness matrix[7.41e+6, 1.11e+7, -7.41e+6, 1.11e+7] [1.11e+7, 2.22e+7, -1.11e+7, 1.11e+7] [-7.41e+6, -1.11e+7, 7.41e+6, -1.11e+7] [1.11e+7, 1.11e+7, -1.11e+7, 2.22e+7]
Global stiffness matrix[7.41e+6, 1.11e+7, -7.41e+6, 1.11e+7] [1.11e+7, 2.22e+7, -1.11e+7, 1.11e+7] [-7.41e+6, -1.11e+7, 7.41e+6, -1.11e+7] [1.11e+7, 1.11e+7, -1.11e+7, 2.22e+7]
Transformation matrix T[1.000, 0, 0, 0] [0, 1.000, 0, 0] [0, 0, 1.000, 0] [0, 0, 0, 1.000]
Local DOF order[v1, theta1, v2, theta2]
AE/L (axial)-
12EI/L³ (bending)7,407,111.1111

Beam element stiffness matrix assembled successfully.

  • Your element is a 4x4 Euler-Bernoulli beam element. The matrix captures shear forces and bending moments at each end, with four degrees of freedom: transverse displacement and rotation at each node.
  • The primary bending coefficient 12EI/L^3 = 7.407e+6 N/m. This governs transverse shear stiffness at the nodes.
  • The element is horizontal (0 degrees), so the local and global stiffness matrices are identical - no rotation is needed.

Next stepTo analyze a full structure, assemble the individual element global stiffness matrices by adding overlapping DOF entries. Then apply boundary conditions (set known displacements) and solve K * d = F for the unknown nodal displacements.

What is a stiffness matrix?

A stiffness matrix is the fundamental building block of the direct stiffness method (also called the finite element method for structural analysis). It relates the nodal forces and moments of a single structural element to the nodal displacements and rotations through the equation F = K * d, where F is the vector of forces, K is the stiffness matrix, and d is the vector of displacements. Each entry K[i,j] represents the force at DOF i when a unit displacement is applied at DOF j and all other DOFs are held fixed. Assembling the individual element matrices into a global structure stiffness matrix and then solving the system gives the unknown displacements of every node in the structure.

How the Euler-Bernoulli beam stiffness matrix is derived

The classic 4x4 beam element stiffness matrix comes from integrating the virtual work equation for an Euler-Bernoulli beam (which assumes plane sections remain plane and ignores shear deformation). The cubic Hermite shape functions that exactly satisfy the beam differential equation produce four coefficients - 12EI/L^3, 6EI/L^2, 4EI/L, and 2EI/L - that populate the matrix. The 12EI/L^3 terms link transverse shear to transverse displacement; the 4EI/L and 2EI/L terms link bending moment to nodal rotations; and the 6EI/L^2 terms are coupling terms between displacement and rotation. These are exact for a uniform prismatic beam with no distributed load within the element.

Truss, beam, and frame: choosing the right element type

A 2D truss element carries only axial forces, so its local stiffness matrix has a simple 2x2 block (AE/L) expanded to 4x4 by including the transverse DOFs, which have zero stiffness locally. It must be inclined in 2D space and transformed to global coordinates. A 2D beam element adds bending and shear (4x4) but assumes the member is connected by pins at the joints for axial load transfer - axial DOFs are not included. A 2D frame element is the most general: it combines axial stiffness and bending stiffness in a 6x6 matrix, making it suitable for rigid-jointed frames where both axial and flexural forces are transferred at the connections.

The transformation matrix and global stiffness

The local stiffness matrix is derived in the element coordinate system (the x-axis along the element). When a member is inclined at angle theta to the global x-axis, a transformation matrix T (built from direction cosines c = cos(theta) and s = sin(theta)) is used to rotate the local matrix into global coordinates: K_global = T^T * K_local * T. This global element matrix can then be directly assembled into the structure stiffness matrix by adding the element coefficients to the appropriate global DOF positions. For a horizontal element (theta = 0), the transformation matrix is the identity and K_global equals K_local.

Degrees of freedom (DOF) by element type

Element typeMatrix sizeDOF orderForces/moments carried
2D Truss4x4[u1, v1, u2, v2]Axial force only
2D Beam4x4[v1, theta1, v2, theta2]Shear + bending moment
2D Frame6x6[u1, v1, theta1, u2, v2, theta2]Axial + shear + bending

DOF labels define what each row and column of the stiffness matrix corresponds to.

Frequently asked questions

What units should I use for inputs?

The calculator accepts a range of units and converts them to SI internally. You can enter Young's modulus in GPa (typical for steel and metals), MPa (concrete, polymers), Pa, ksi, or psi. Area can be in cm2, mm2, m2, or in2. Second moment of area (I) can be in cm4, mm4, m4, or in4. Length can be in m, mm, cm, ft, or in. All matrix coefficients in the output are in SI base units (N/m for the translational stiffness terms, N for the shear-moment coupling terms, and N-m for the rotational stiffness terms).

Why is the stiffness matrix singular?

A free (unrestrained) element stiffness matrix is always singular - its determinant is zero. This is because no boundary conditions have been applied, so the structure is free to translate and rotate as a rigid body without any internal deformation. When you apply supports (set displacement DOFs to zero) by deleting the corresponding rows and columns, the reduced stiffness matrix becomes positive definite and invertible, allowing you to solve for the remaining unknown displacements.

What is the difference between local and global stiffness matrices?

The local stiffness matrix is derived in the element's own coordinate system, with the x-axis running along the element's length. The global stiffness matrix is the same physical element but expressed in the structure's global coordinate system (a fixed x-y frame). For horizontal elements the two are identical. For inclined elements you apply the transformation K_global = T^T * K_local * T using the rotation matrix T built from the inclination angle. Only global-coordinate element matrices can be directly added together into the structure stiffness matrix.

How do I assemble the global structure stiffness matrix from element matrices?

Each element has a global DOF map that relates its local DOF indices to the global DOF numbering of the full structure. For each element, you loop over its DOF pairs (i,j) and add K_global[i,j] of that element to K_structure[global_i, global_j]. Shared DOFs (nodes shared between two or more elements) accumulate contributions from all elements connected at that node. After assembly, you apply boundary conditions and solve the reduced system.

Does this calculator handle Timoshenko (shear-deformable) beams?

No - this calculator uses the classical Euler-Bernoulli (Kirchhoff) beam formulation, which is accurate for slender beams where the span-to-depth ratio is 5 or greater. Timoshenko beam theory includes additional terms related to shear deformation and is needed for short, deep beams or sandwich panels. The coefficients differ from the Euler-Bernoulli values computed here.

Sources

Written by Dr. Tomás Okafor, PhD Physicist · Lagos, Nigeria

Physicist specializing in classical mechanics, bringing 17 years of research and applied dynamics expertise to every calculator he reviews.

Search 3,500+ calculators

Loading search…