We now have element stiffness matrices. But a real structure consists of many elements connected together. How do we combine these individual matrices into a single global system that represents the entire structure?
This process is called assembly, and it's based on two fundamental principles:
Compatibility: Shared nodes have the same displacement
Equilibrium: Forces at each node must balance
The Assembly Concept
Consider a bar divided into 3 elements with 4 nodes:
Sponsored
Master CATIA, NX, LS-DYNA, HyperMesh, ANSYS
The exact tools used by Mahindra, Bosch & TATA ELXSI
$K_{22} = k_1 + k_2$ — contributions from both elements add
Off-diagonal terms connect only adjacent nodes
The matrix is symmetric and banded
The Assembly Algorithm
The assembly process follows these steps:
Step 1: Define Element Connectivity
Create a table mapping each element to its global node numbers:
Element
Local Node 1
Local Node 2
1
1
2
2
2
3
3
3
4
This connectivity table tells us where each element's entries go in the global matrix.
Step 2: Initialize Global Matrix
Create a zero matrix of size $n \times n$, where $n$ = total number of DOFs.
For our 4-node 1D problem: $[K_{global}]$ is $4 \times 4$, initialized to zeros.
Step 3: Loop Over Elements
For each element $e$:
Get the element stiffness matrix $[K_e]$
Get the global node numbers from connectivity table
Add each entry $K_e(i,j)$ to the corresponding position in $[K_{global}]$
Step 4: The Scatter Operation
For element $e$ connecting global nodes $I$ and $J$:
$$K_{global}(I,I) \mathrel{+}= K_e(1,1)$$
$$K_{global}(I,J) \mathrel{+}= K_e(1,2)$$
$$K_{global}(J,I) \mathrel{+}= K_e(2,1)$$
$$K_{global}(J,J) \mathrel{+}= K_e(2,2)$$
The "+=" means we add to the existing value, not replace it.
Connectivity and DOF Mapping
Hover over elements to see their connectivity. Click elements to highlight their contribution to the global matrix.
For 2D and 3D Elements
The same principle applies, but with more DOFs per node:
🎯3,000+ Engineers Placed
Sponsored
Harshal
Fiat Chrysler
Abhishek
TATA ELXSI
Srinithin
Xitadel
Ranjith
Core Automotive
Gaurav
Automotive Company
Bino
Design Firm
Aseem
EV Company
Puneet
Automotive Company
Vishal
EV Startup
More Success Stories
2D (2 DOFs per node):
Node $i$ has DOFs: $2i-1$ (x-direction), $2i$ (y-direction)
A 3-node triangle has a $6 \times 6$ element stiffness matrix
Assembly scatters into a larger global matrix
3D (3 DOFs per node):
Node $i$ has DOFs: $3i-2$, $3i-1$, $3i$
A 4-node tetrahedron has a $12 \times 12$ element stiffness matrix
Assembly Rules (Direct Stiffness Method)
Two simple rules govern the assembled matrix:
Rule 1: Diagonal Terms
$$K_{ii} = \sum_{\text{elements at node } i} K_e(\text{local } i, \text{local } i)$$
The diagonal entry for DOF $i$ is the sum of direct stiffnesses from all elements connected to that DOF.
Rule 2: Off-Diagonal Terms
$$K_{ij} = \sum_{\text{elements connecting } i \text{ and } j} K_e(\text{local } i, \text{local } j)$$
The off-diagonal entry is the sum of coupling stiffnesses from elements that connect DOFs $i$ and $j$.
If no element connects nodes $i$ and $j$, then $K_{ij} = 0$.
Properties of the Assembled Matrix
The global stiffness matrix has important properties:
1. Symmetric
$$K_{ij} = K_{ji}$$
This comes from Maxwell-Betti reciprocity and is preserved by assembly.
2. Sparse
Most entries are zero. Only DOFs connected by elements have non-zero coupling.
For a mesh with $n$ nodes and average connectivity $m$:
Matrix size: $n \times n$
Non-zeros: approximately $m \times n$
Sparsity: $(n^2 - mn)/n^2 \approx 1 - m/n$
For large $n$, the matrix is very sparse (often >99% zeros).
3. Banded
If nodes are numbered sequentially along the structure, the matrix has a band structure. The bandwidth depends on the maximum node number difference in any element.
4. Positive Semi-Definite
Before applying boundary conditions, the matrix is singular (rigid body modes exist). After fixing enough DOFs, it becomes positive definite.
Assembly in Code
Here's the assembly algorithm in pseudocode:
# Initialize global matrix
K_global = zeros(n_dofs, n_dofs)
F_global = zeros(n_dofs)
# Loop over elements
for e in elements:
K_e = compute_element_stiffness(e)
nodes = connectivity[e] # Global node numbers
# Scatter element matrix to global
for i in range(nodes_per_element):
I = nodes[i] # Global node
for j in range(nodes_per_element):
J = nodes[j] # Global node
K_global[I, J] += K_e[i, j]
This is $O(n_{elements} \times n_{nodes/element}^2)$ — very efficient.
Global matrix properties: Symmetric, sparse, banded, positive semi-definite
Bandwidth depends on node numbering — good numbering improves solver efficiency
What's Next
We now have the global system $[K]\{u\} = \{F\}$, but it's singular — we haven't applied boundary conditions yet. In the next lesson, we'll learn how to apply constraints and solve the system.
Career Growth
3,000+ Engineers Placed in Top Companies
Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.