# Stiffness Matrix Calculator

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:

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:

- At equilibrium, the element forces $P^{'}_1$ and $P^{'}_3$ result in an equal and opposite axial reaction force $N$ in the truss element.
- 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:

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

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

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

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:

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:

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:

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