---
title: "Bar stiffness matrix and 2D truss element"
subject: "Computational Techniques in Civil Engineering"
chapter: 4
key: "semester_8/computational_techniques_in_civil_engineering:bar-stiffness-truss-rotation"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/bar-stiffness-truss-rotation
site: BCT Engineering
---

# Bar stiffness matrix and 2D truss element

Computational Techniques in Civil Engineering · Chapter 4: Finite element method

- Asked in: 2070 Magh, 10 marks
- Video: [TRUSS element (BAR element): Introduction and stiffness matrix 2](https://www.youtube.com/watch?v=CTzRo1gN9DA) — Ram Kinhikar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/bar-stiffness-truss-rotation
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-4

## Question

Formulate the stiffness matrix for a bar element. Rotate the same bar element and formulate the stiffness matrix for a 2D truss element.

## Short answer

Local bar stiffness is AE/L times [1 -1; -1 1]. For a 2D truss element rotated by theta, the global stiffness matrix is AE/L times [c^2 cs -c^2 -cs; cs s^2 -cs -s^2; -c^2 -cs c^2 cs; -cs -s^2 cs s^2], with c=cos theta and s=sin theta.

## Answer

A bar (rod) element carries only axial force. It has two nodes and one dof per node in its local axis; a 2D truss element is the same bar placed at an angle, with two dofs per node.

#### Part 1: Stiffness matrix of the bar element

```text
   1 o--------------------o 2  ---> x
     u1   (A, E, L)       u2
```
Assume a linear displacement field $u(x)=\alpha_1+\alpha_2x$. Applying $u(0)=u_1$ and $u(L)=u_2$:
$$
u(x)=N_1u_1+N_2u_2,\qquad N_1=1-\frac{x}{L},\quad N_2=\frac{x}{L}
$$
Strain:
$$
\varepsilon=\frac{du}{dx}=\begin{bmatrix}-\frac1L&\frac1L\end{bmatrix}\begin{bmatrix}u_1\\u_2\end{bmatrix}=[B]\{u\}
$$
Stress $\sigma=E\varepsilon$. The stiffness matrix from the strain energy (or the principle of minimum potential energy):
$$
[k]=\int_0^L[B]^TE[B]A\,dx=AE\int_0^L\begin{bmatrix}\frac1{L^2}&-\frac1{L^2}\\-\frac1{L^2}&\frac1{L^2}\end{bmatrix}dx
$$
$$
[k]=\frac{AE}{L}\begin{bmatrix}1&-1\\-1&1\end{bmatrix}
$$
Direct check: a unit displacement $u_1=1,\ u_2=0$ needs force $AE/L$ at node 1 and $-AE/L$ at node 2 (equilibrium). The matrix is symmetric and singular (rigid-body motion is possible until supports are added).

#### Part 2: Rotating the bar - 2D truss element

```text
                 v2 ^  u2 (global)
                    |/
   y ^           2 o
     |          /  
     |        / L      theta = angle of the bar
     |      /          from global x
     |    o 1
     |__theta_______> x
```
Let the bar make angle $\theta$ with the global $x$-axis, $c=\cos\theta=\dfrac{x_2-x_1}{L}$, $s=\sin\theta=\dfrac{y_2-y_1}{L}$. Global dofs: $\{d\}=[u_1\ v_1\ u_2\ v_2]^T$; local axial dofs: $\{d'\}=[u_1'\ u_2']^T$.

The local axial displacement at a node is the projection of the global displacement on the bar axis:
$$
\begin{bmatrix}u_1'\\u_2'\end{bmatrix}=\underbrace{\begin{bmatrix}c&s&0&0\\0&0&c&s\end{bmatrix}}_{[T]}\begin{bmatrix}u_1\\v_1\\u_2\\v_2\end{bmatrix}
$$
The strain energy $\tfrac12\{d'\}^T[k']\{d'\}=\tfrac12\{d\}^T[T]^T[k'][T]\{d\}$ must equal $\tfrac12\{d\}^T[k]\{d\}$, so
$$
[k]=[T]^T[k'][T]
$$
$$
[k]=\frac{AE}{L}\begin{bmatrix}c^2&cs&-c^2&-cs\\cs&s^2&-cs&-s^2\\-c^2&-cs&c^2&cs\\-cs&-s^2&cs&s^2\end{bmatrix}
$$

#### Properties
- Symmetric; every row sums to zero (equilibrium of a free element).
- Singular: three rigid-body modes in the plane (two translations and one rotation).
- $\theta=0$: only $u$ terms remain (horizontal bar). $\theta=90^\circ$: only $v$ terms remain (vertical bar).
- After finding the nodal displacements, the bar force is $F=\dfrac{AE}{L}\,(u_2'-u_1')=\dfrac{AE}{L}\begin{bmatrix}-c&-s&c&s\end{bmatrix}\{d\}$.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. For the 1D bar with u(x) = a1 + a2 x, what are the shape functions?
   A. N1 = x/L, N2 = 1 - x/L
   B. N1 = 1 - x/L, N2 = x/L
   C. N1 = 1 - x^2/L^2, N2 = x^2/L^2
   D. N1 = 1, N2 = x
   Answer: B. Applying u(0) = u1 and u(L) = u2 gives N1 = 1 - x/L and N2 = x/L. (Key point: Bar shape functions)

2. What is the bar element stiffness matrix?
   A. (AE/L) [1 1; 1 1]
   B. (AL/E) [1 -1; -1 1]
   C. (AE/L) [1 -1; -1 1]
   D. (EL/A) [1 -1; -1 1]
   Answer: C. [B] = [-1/L 1/L], so integrating [B]^T E [B] A over L gives (AE/L)[1 -1; -1 1]. (Key point: Bar stiffness)

3. How is the 2D truss element matrix obtained from the bar matrix?
   A. [k] = [T][k'] with no transpose
   B. [k] = [k'] [T]^T
   C. [k] = [T] [k'] [T]^T
   D. [k] = [T]^T [k'] [T] with [T] projecting global displacements onto the bar axis
   Answer: D. Equating strain energy in local and global dofs gives [k] = [T]^T[k'][T], where local u' = c u + s v at each node. (Key point: Transformation)

4. Which statement about the 2D truss element matrix is correct?
   A. It is symmetric and singular, with three rigid-body modes in the plane
   B. It is non-symmetric and invertible
   C. It is singular with only one rigid-body mode
   D. It is invertible because it has four dofs
   Answer: A. It is symmetric, rows sum to zero, and it is singular with two translations and one rotation as rigid-body modes. (Key point: Properties of truss matrix)

## Related in Computational Techniques in Civil Engineering

- [Truss element stiffness matrices](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Atruss-element-stiffness-matrices) — Computational Techniques in Civil Engineering, chapter 4
- [Plate stiffness matrix with two elements](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Astiffness-two-element-plate) — Computational Techniques in Civil Engineering, chapter 4
- [CST steel plate: stiffness, load vector, displacements](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acst-stiffness-load-displacement-c8) — Computational Techniques in Civil Engineering, chapter 4
- [CST plate: stiffness, load vector, displacements](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acst-stiffness-load-displacement-k8) — Computational Techniques in Civil Engineering, chapter 4
- [CST: stiffness, nodal displacement, stresses](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acst-plane-stress-b5) — Computational Techniques in Civil Engineering, chapter 4
- [Bar: nodal displacements, stresses, reactions](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Aaxial-bar-stepped-p300) — Computational Techniques in Civil Engineering, chapter 4

## Related in other subjects

- [Derive bar element stiffness matrix](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Abar-element-stiffness-derivation) — Finite Element Method, chapter 3
- [Stiffness matrix: element matrices, member forces, BMD](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Astiffness-element-matrices-600kn-bmd) — Theory of Structures II, chapter 3
- [Derive beam element stiffness matrix](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Abeam-element-stiffness-derivation) — Finite Element Method, chapter 3
- [Derive CST element stiffness matrix](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Acst-stiffness-matrix-derivation) — Finite Element Method, chapter 6
