# Stiffness Matrix Calculator

Created by Krishna Nelaturu
Reviewed by Steven Wooding
Last updated: Nov 01, 2023

Our stiffness matrix calculator will help you determine the element stiffness matrices for the truss, beam, and frame elements. Truss, beam, and frame elements are the most basic elements used in finite element analysis in solid mechanics.

If you were wondering how to calculate the stiffness matrix for these three elements, you've come to the right place! In this article, we aim to teach you the following:

• Truss elements and calculating the stiffness matrix for truss elements.
• Beam elements and calculating beam stiffness matrix.
• Frame elements and calculating frame stiffness matrix.

Familiarity with spring stiffness will be a good base for the article below. We recommend you go through our spring rate calculator before diving in!

## Calculating stiffness matrix for truss elements

Trusses are bars joined end to end to form a rigid structure such that only axial forces are acting on each bar. Typically, truss structures are used in supporting roofs. You can also see them used in bridges.

The stiffness of a bar is given by:

$k = \frac{A \cdot E}{L}$

where:

• $k$ — Stiffness of the bar;
• $A$ — Cross-sectional area of the bar;
• $E$ — Young's modulus of the bar; and
• $L$ — Length of the bar.

If you need help with Young's modulus calculation, our Young's modulus calculator can help you.

Let us learn how to calculate the stiffness matrix of a truss element. Consider the free body diagram of a truss element tilted at an angle $\phi$ to the global x-axis.

It is easier to analyze the element in its local coordinate system and then transform our equations into the global coordinate system.

This free-body diagram shows that:

1. At equilibrium, the element forces $P^{'}_1$ and $P^{'}_3$ result in an equal and opposite axial reaction force $N$ in the truss element.
2. Since the element displacements $u^{'}_2$ and $u^{'}_4$ are lateral, they do not result in any axial reaction forces in the element. This is valid because we assume the displacements are small. Thus, $P^{'}_2$ and $P^{'}_4$ are zero.

Similar to spring, the reaction force $N$ in the truss member is given by:

$N = k(u'_3 - u'_1)$

From the diagram, we note that the element force $P^{'}_3 = N$. Hence we can write:

$P'_3 = k(u'_3 - u'_1)$

Again, from the diagram, we note that the element force $P^{'}_1 = -N$. Thus, we write:

$P'_1 = -k(u'_3 - u'_1) = k(u'_1 - u'_3)$

Putting the two axial element force equations in a matrix, we get:

$k\begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix} \begin{bmatrix} u'_1 \\ u'_3 \end{bmatrix} = \begin{bmatrix} P'_1 \\ P'_3 \end{bmatrix}$

Combining this with our understanding that the element forces $P^{'}_2$ and $P^{'}_4$ are zero, we can expand the matrix equation to include them:

$\small \underbrace{k\begin{bmatrix} 1 &0 & -1 &0 \\ 0 & 0&0 &0\\ -1 &0 & 1 &0\\ 0&0&0&0 \end{bmatrix}}_{\mathbf{K^{e'}}} \underbrace{\begin{bmatrix} u'_1 \\ u'_2\\ u'_3\\ u'_4 \end{bmatrix}}_{\mathbf{a^{e'}}} = \underbrace{\begin{bmatrix} P'_1 \\ P'_2 \\ P'_3\\ P'_4 \end{bmatrix}}_{\mathbf{f^{e'}}}\\$

where:

• $\mathbf{K^{e'}}$ — Local element stiffness matrix;
• $\mathbf{a^{e'}}$ — Local element displacement vector; and
• $\mathbf{f^{e'}}$ — Local element force vector.

To convert the equation (and our stiffness matrix) from the local to the global coordinate system, we introduce a transformation matrix $\mathbf{L}$, where:

$\scriptsize \mathbf{L^T} = \begin{bmatrix} \cos{\phi} & -\sin{\phi} & 0&0 \\ \sin{\phi} & \cos{\phi}&0 &0\\ 0&0 & \cos{\phi} & -\sin{\phi}\\ 0&0&\sin{\phi} & \cos{\phi} \end{bmatrix}$

Where $\phi$ is the angle of orientation of the element with respect to the global x-axis.

This transformation matrix is an orthogonal matrix, which means that:

$\mathbf{L^T \cdot L = L \cdot L^T = I}$

The formula for the element stiffness matrix $\mathbf{K^e}$ of a truss element in the global coordinate system is obtained by: