Omni Calculator logo

Stiffness Matrix Calculator

Created by Krishna Nelaturu
Reviewed by Steven Wooding
Last updated: Jan 18, 2024


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=AELk = \frac{A \cdot E}{L}

where:

  • kk — Stiffness of the bar;
  • AA — Cross-sectional area of the bar;
  • EE — Young's modulus of the bar; and
  • LL — 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.

Truss element in the global coordinate system.
Truss element in the global coordinate system.

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

Truss element in the local coordinate system.
Truss element in the local coordinate system.

This free-body diagram shows that:

  1. At equilibrium, the element forces P1P^{'}_1 and P3P^{'}_3 result in an equal and opposite axial reaction force NN in the truss element.
  2. Since the element displacements u2u^{'}_2 and u4u^{'}_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, P2P^{'}_2 and P4P^{'}_4 are zero.

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

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

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

P3=k(u3u1)P'_3 = k(u'_3 - u'_1)

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

P1=k(u3u1)=k(u1u3)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[1111][u1u3]=[P1P3]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 P2P^{'}_2 and P4P^{'}_4 are zero, we can expand the matrix equation to include them:

k[1010000010100000]Ke[u1u2u3u4]ae=[P1P2P3P4]fe\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:

  • Ke\mathbf{K^{e'}} — Local element stiffness matrix;
  • ae\mathbf{a^{e'}} — Local element displacement vector; and
  • fe\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 L\mathbf{L}, where:

LT=[cosϕsinϕ00sinϕcosϕ0000cosϕsinϕ00sinϕcosϕ]\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:

LTL=LLT=I\mathbf{L^T \cdot L = L \cdot L^T = I}

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

Ke=LTKeLKe=k[cos2ϕcosϕsinϕcos2ϕcosϕsinϕcosϕsinϕsin2ϕcosϕsinϕsin2ϕcos2ϕcosϕsinϕcos2ϕcosϕsinϕcosϕsinϕsin2ϕcosϕsinϕsin2ϕ]\scriptsize\! \begin{align*} \mathbf{K^e}\! &= \mathbf{L^T \cdot K^{e'} \cdot L}\\[1em] \mathbf{K^e}\! &= k\!\! \begin{bmatrix} \cos^2{\phi} & \hspace{-.7em} \cos{\phi}\sin{\phi} &\hspace{-.7em} -\!\cos^2{\phi} &\hspace{-.7em} -\!\cos{\phi}\sin{\phi} \\ \cos{\phi}\sin{\phi} & \hspace{-.7em}\sin^2{\phi}&\hspace{-.7em}-\!\cos{\phi}\sin{\phi} &\hspace{-.7em} -\!\sin^2{\phi}\\ -\!\cos^2{\phi}&\hspace{-.7em}-\!\cos{\phi}\sin{\phi} &\hspace{-.7em} \cos^2{\phi} &\hspace{-.7em} \cos{\phi}\sin{\phi}\\ -\!\cos{\phi}\sin{\phi}&\hspace{-.7em}-\!\sin^2{\phi}&\hspace{-.7em}\cos{\phi}\sin{\phi} &\hspace{-.7em} \sin^2{\phi} \end{bmatrix} \end{align*}