FEM for structures — assembling global stiffness
3.6.19· Physics › Spacecraft Structures & Systems Engineering
Overview
Global stiffness matrix assembly finite element method ka dil hai. Hum local element stiffness matrices (jo element ke apne coordinate system mein already compute ho chuki hain) ko leke ek bade system matrix mein assemble karte hain jo poori structure ko represent karta hai. Isse ek complex continuous structure ek solvable discrete system of linear equations mein badal jaati hai: .
Spacecraft ke liye ye kyun important hai: Har structural analysis—launch loads se lekar thermal distortion tak—is assembly step par depend karta hai. Ek solar panel bracket, ek satellite bus, ya ek rocket interstage hazaron elements mein mesh hota hai, aur hume deformations, stresses, aur failure modes predict karne ke liye unhe sahi se assemble karna hota hai.
[!intuition] Core Idea
Structure ko springs ke network ki tarah socho. Har finite element (beam, truss bar, shell) ek spring jaisa hai jiska apna stiffness hai. Jab tum unhe nodes par connect karte ho, shared nodes par forces balance hone chahiye, aur displacements compatible honi chahiye (koi gaps ya overlaps nahi).
Assembly process:
- Har element apne connected nodes par global stiffness ke liye "vote" karta hai
- Hum shared nodes par saare element contributions ko add (superimpose) karte hain
- Result: ek badi matrix jahan row/column , globally degree-of-freedom (DOF) ko correspond karta hai
Key insight: Elements nodes share karte hain → unke stiffness matrices un DOFs par overlap karte hain → hum overlapping entries ko sum karte hain. Yahi direct stiffness method hai.
[!definition] Key Concepts
Global Stiffness Matrix : Ek square matrix of size , jahan mesh mein total DOFs ki sankhya hai. Entry DOF par force hai jo DOF par unit displacement ke karan hai (baaki saare DOFs fixed hain).
Element Stiffness Matrix : Element ki stiffness uske local coordinate system mein. Ek 2-node bar element ke liye jisme 2 DOFs per node hain (total 4 DOFs), ka size hota hai.
Degrees of Freedom (DOF): Independent displacement/rotation variables. Ek 3D node mein 6 DOFs hote hain: (translations) aur (rotations). Hum saare DOFs ko mesh across sequentially number karte hain.
Connectivity (Topology): Element-local node numbers se global node numbers ka mapping. Agar element global nodes 5 aur 12 ko connect karta hai, to hum exactly jaante hain ki ko mein kahan add karna hai.
[!formula] First Principles se Derivation
Step 1: Energy Principle (Assembly kyun kaam karta hai)
Structure ki total strain energy saare elements ki strain energies ka sum hai:
jahan element displacement vector hai (global displacement vector se extract kiya gaya).
Ye step kyun? Energy additive honi chahiye. Har element total mein independently contribute karta hai.
Boolean localization matrix use karte hue jo global DOFs se element DOFs extract karta hai:
Substitute karo:
Ye step kyun? Hum global stiffness identify karne ke liye global displacement vector ko factor out karte hain.
Kyunki global aur common hai, total energy ban jaati hai:
Global stiffness identify karo:
Ye step kyun? Quadratic form global stiffness matrix ko define karta hai. Transformed element stiffnesses ka sum hume deta hai.
Step 2: Practical Assembly Algorithm
Matrix multiplication expensive hai. Practice mein, hum scatter operation use karte hain:
Har element ke liye:
- compute karo (local coords mein, agar zarurat ho to global mein transform karo)
- Element ke nodes ke liye global DOF numbers dhundo:
- Har entry ko mein add karo
Algorithm in pseudo-code:
Initialize K = zeros(N, N)
for each element e:
k_e = element_stiffness(e)
dofs = global_dof_indices(e) # e.g., [3, 4, 9 10] for a 2-node bar
for in range(len(dofs)):
for j in range(len(dofs)):
K[dofs[i], dofs[j]] += k_e[i, j] # Scatter-add
Scatter-add kyun? Kyunki mostly zeros hota hai—ye sirf un DOFs par entries populate karta hai jinhein element touch karta hai. Direct addition matrix multiplication se faster hai.
Step 3: ki Properties
Symmetry: Agar har symmetric hai (Maxwell-Betti reciprocal theorem), to symmetric hai.
Sparsity: extremely sparse hai. Entry tabhi hoti hai jab DOF aur DOF ek hi element se belong karte hain. DOFs wale mesh ke liye, typical bandwidth 2D mein aur 3D mein hoti hai.
Positive semi-definite (BCs se pehle): . Rigid-body modes (zero strain ke saath translations/rotations) eigenvalues dete hain. Boundary conditions apply karne ke baad (DOFs fix karne ke baad), positive definite → invertible ho jaata hai.
[!example] Worked Example 1: Two-Bar Truss
Setup:
- -axis ke along series mein 2 bar elements
- 3 nodes: Node 1 (fixed), Node 2 (middle), Node 3 (free end, force )
- Har bar: length , area , Young's modulus
- Har node mein 1 DOF (horizontal displacement )
Element stiffness (1D bar):
Ye formula kyun? Hooke's law se: force . Dono nodes par equilibrium enforce karne se stiffness milti hai.
Global DOF numbering:
- Node 1 → DOF 1
- Node 2 → DOF 2
- Node 3 → DOF 3
Element 1 (Nodes 1-2):
(3×3) mein scatter karo:
Ye step kyun? Element 1, DOFs 1 aur 2 ko connect karta hai. Hum uska block global matrix ke rows/columns 1-2 mein rakhte hain.
Element 2 (Nodes 2-3):
Scatter:
Assembled global stiffness:
kyun hai? Node 2 dono elements ke beech shared hai. Dono contribute karte hain mein, to hum sum karte hain: .
Boundary condition apply karo: Node 1 fix karo → → row/column 1 remove karo:
Solve karo:
Doosri equation se: . Pehli se: .
Substitute karo: . Tab .
Physical check: Total elongation hai, jo series mein do bars se match karta hai: . ✓
[!example] Worked Example 2: 2D Truss with Coordinate Transformation
Setup:
- Do bar elements jo ek 90° corner bana rahe hain
- Node 1 origin par (fixed), Node 2 par, Node 3 par
- Element 1: horizontal (1→2), Element 2: vertical (2→3)
- Har node mein 2 DOFs:
- Global DOF numbering: Node ke DOFs (x) aur (y) hain
Local coordinates mein element stiffness (bar axis ke saath aligned):
Bar ke liye jo apne local axis ke saath aligned hai:
Ye zeros kyun? Ek bar sirf axial deformation resist karta hai. Transverse displacements (bar ke perpendicular) zero strain produce karte hain, isliye zero stiffness.
Transformation matrix : Global displacements ko local mein convert karta hai:
jahan bar axis ka global -axis se angle hai.
Global element stiffness:
Element 1 (horizontal, ):
DOFs: (Node 1: DOFs 1,2; Node 2: DOFs 3,4).
Element 2 (vertical, ):
Transformation ke baad:
DOFs: (Node 2: DOFs 3,4; Node 3: DOFs 5,6).
Assembly: ko zeros se initialize karo.
ko rows/cols mein scatter karo:
ko rows/cols mein scatter karo:
Result (BCs se pehle):
1 & 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ -1 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 & 0 & 1 \end{bmatrix}$$ **$K_{33} = 1$ aur $K_{44} = 1$ kyun?** Node 2 shared hai, lekin element 1 sirf $x$-direction (DOF 3) ko stiffen karta hai aur element 2 sirf $y$-direction (DOF 4) ko. Is geometry mein stiffness contributions mein koi overlap nahi hai. **BCs apply karo:** Node 1 fix karo ($u_1 = u_2 = 0$), applied loads ke under Node 2 aur Node 3 displacements ke liye solve karo. --- ## [!mistake] Common Mistakes aur Misconceptions ### Mistake 1: Coordinate Transformation Bhool Jana **Galat approach:** Local-axis stiffness matrix ko directly global assembly mein use karna, chahe element rotated ho. **Ye sahi kyun lagta hai:** Local stiffness simpler hai, aur aligned elements (horizontal/vertical) ke liye transformation identity hoti hai. **Ye galat kyun hai:** Agar ek element angle $\theta$ par hai, to uski axial stiffness *dono* global $x$ aur $y$ directions mein contribute karti hai. $\mathbf{T}^T \mathbf{k} \mathbf{T}$ skip karne se incorrect coupling milti hai. **Fix:** Hamesha $\mathbf{k}_{\text{local}}$ ko assembly se pehle global coordinates mein $\mathbf{k}_{\text{global}} = \mathbf{T}^T \mathbf{k}_{\text{local}} \mathbf{T}$ use karke transform karo. $\mathbf{T}$ ko element geometry (node positions) se compute karo. ### Mistake 2: Add karne ki jagah Overwrite karna **Galat approach:** $K[i,j] = k_e[a,b]$ instead of $K[i,j] += k_e[a,b]$. **Ye sahi kyun lagta hai:** "Element $e$, DOF pair $(i,j)$ par stiffness determine karta hai." **Ye galat kyun hai:** Multiple elements nodes share karte hain. Agar element 1 $K_{22} = 5$ set kare aur element 2 $K_{22} = 3$ overwrite kare, to combined stiffness galat ho jaayegi. Sahi value $5 + 3 = 8$ hai. **Fix:** `+=` (scatter-add) use karo. Har element incrementally contribute karta hai. Socho: "element $e$ global stiffness mein apna *vote add* karta hai." ### Mistake 3: DOF Numbering mein Confusion **Galat approach:** Inconsistent global DOF numbering—kabhi node-major (node1 ke saare DOFs, phir node 2..), kabhi DOF-major (saare $u_x$, phir saare $u_y$..). **Ye sahi kyun lagta hai:** Alag-alag texts alag conventions use karte hain. **Ye galat kyun hai:** Agar tumhara connectivity table node-major assume kare lekin tum DOF-major order mein assemble karo, to tum galat matrix locations par scatter karte ho → garbage results. **Fix:** Ek convention chuno aur usse stick karo. Node-major standard hai: Node $i$ with $d$ DOFs per node ka global DOFs $d(i-1)+1$ se $di$ tak hota hai. Ise apne code mein clearly document karo. ### Mistake 4: Storage mein Symmetry Ignore karna **Galat approach:** Bade $N$ ke liye puri $N \times N$ matrix store aur assemble karo. **Ye sahi kyun lagta hai:** Clearer indexing, simpler loops. **Ye galat kyun hai:** $N = 10^6$ DOFs ke liye, full storage $10^{12}$ doubles ≈ 8 TB hai. Real FEM codes memory exhaustion se mar jaate hain. **Fix:** Sparse storage use karo (CSR, skyline, ya banded format). Sirf non-zero entries store karo. Modern solvers (MUMPS, PARDISO) isi ki requirement rakhte hain. --- ## [!recall]- 12-Saal ke Bachche ko Explain karo Imagine karo tum straws se ek model bridge bana rahe ho. Har straw stiff hai—tum ek end dhakelo, doosra end dhakelta hai wapas. Ab tum straws ko connection points (nodes) par glue karte ho. Jab tum ek connection point par push karte ho, to ye baaki points ko affect karta hai kyunki straws unhe connect karti hain. "Stiffness matrix" ek badi spreadsheet jaisi hai jo track karti hai: "Agar main point A par push karun, to point B kitna wapas push karta hai?" Har straw (element) is spreadsheet ka ek hissa bharta hai. Agar do straws ek hi point par milti hain, to dono us point ke liye numbers likhti hain. Hum un numbers ko **add** karte hain (replace nahi!), kyunki dono straws milke resist kar rahi hain. Ek baar jab hamare paas puri spreadsheet ho, hum predict kar sakte hain: "Agar main point C par weight hang karun, to poora bridge kitna bend karega?" Yahi assembly ki power hai—simple pieces ko poori structure ke prediction mein combine karna. --- ## [!mnemonic] Memory Aid **"SLAPS"** assembly steps ke liye: - **S**tiffness: Har element ka $\mathbf{k}^{(e)}$ compute karo - **L**ocate: Connectivity se global DOF indices dhundo - **A**dd: Global $\mathbf{K}$ mein scatter-add karo (kabhi overwrite mat karo!) - **P**roperties: Symmetry, sparsity, bandwidth check karo - **S**olve: BCs apply karo, $\mathbf{K}\mathbf{u} = \mathbf{F}$ solve karo --- ## Connections - [[Finite Element Method Overview]] — Bada picture: discretization → assembly → solution - [[Element Stiffness Matrices]] — Bars, beams, shells ke liye $\mathbf{k}^{(e)}$ kaise derive karte hain - [[Coordinate Transformations in FEM]] — Local stiffness ko global frame mein rotate karna - [[Boundary Conditions in FEM]] — Constraints enforce karne ke liye $\mathbf{K}$ modify karna - [[Sparse Matrix Storage]] — Bade $\mathbf{K}$ ke liye efficient data structures - [[Direct vs Iterative Solvers]] — Assembly ke baad $\mathbf{K}\mathbf{u} = \mathbf{F}$ kaise solve karte hain - [[Mesh Refinement and Convergence]] — Ye ensure karna ki discrete model reality approximate kare --- ## #flashcards/physics FEM mein global stiffness matrix $\mathbf{K}$ kya hai? :: Ek square $N \times N$ matrix (N = total DOFs) jahan entry $K_{ij}$ DOF $i$ par force hai per unit displacement at DOF $j$. Ye poori structure ki stiffness represent karta hai. Assembly ke dauran hum element stiffnesses ko add kyun karte hain (overwrite nahi)? ::: Kyunki multiple elements nodes share karte hain. Har element shared DOFs par stiffness mein contribute karta hai. Add karna saare connected elements ki combined resistance capture karta hai. Direct stiffness method ka formula kya hai? ::: $\mathbf{K} = \sum_{e=1}^{ne} \mathbf{L}^{(e)T} \mathbf{k}^{(e)} \mathbf{L}^{(e)}$, jahan $\mathbf{L}^{(e)}$ Boolean localization matrix hai jo global DOFs se element DOFs extract karta hai. FEM assembly mein scatter operation kya hai? ::: Element stiffness matrix $\mathbf{k}^{(e)}$ ki har entry ko element ki connectivity ke basis par $\mathbf{K}$ mein corresponding global DOF positions par add karne ka process. Hume element stiffness matrices ko global coordinates mein transform kyun karna chahiye? ::: Kyunki elements arbitrary angles par oriented ho sakte hain. Local stiffness (element ke apne axis ke along) ko global $x,y,z$ directions ke saath align karne ke liye $\mathbf{k}_{\text{global}} = \mathbf{T}^T \mathbf{k}_{\text{local}} \mathbf{T}$ use karke rotate karna padta hai. $\mathbf{K}$ symmetric kyun hota hai? ::: Agar har element stiffness $\mathbf{k}^{(e)}$ symmetric hai (Maxwell-Betti reciprocal theorem se guaranteed: $i$ par force jo $j$ par displacement ke karan hai, $j$ par force ke equal hai jo $i$ par displacement ke karan hai), to sum $\mathbf{K}$ symmetric hota hai. $\mathbf{K}$ sparse kyun hota hai? ::: Entry $K_{ij} \neq 0$ tabhi hoti hai jab DOFs $i$ aur $j$ kam se kam ek common element se belong karte hain. Adhiktar DOF pairs kisi bhi element se connected nahi hote, isliye adhiktar entries zero hoti hain. FEM mein rigid-body mode kya hai? ::: Ek displacement pattern (poori structure ka translation ya rotation) jo zero strain energy produce karta hai. Boundary conditions apply karne se pehle, $\mathbf{K}$ singular hota hai aur rigid-body modes ke corresponding zero eigenvalues hote hain. Boundary conditions $\mathbf{K}$ ko kaise change karte hain? ::: DOFs fix karna $\mathbf{K}$ se corresponding rows aur columns remove karta hai, rigid-body modes eliminate karta hai aur matrix ko positive definite (invertible) banata hai. Series mein 2-bar truss ke liye, middle node mein dono bars se stiffness contribution kyun hoti hai? ::: Dono bars middle node se connect hoti hain. Element 1, $\frac{EA}{L}$ contribute karta hai aur element 2 bhi $\frac{EA}{L}$ contribute karta hai us node ke DOF ke diagonal entry mein, jo sum hokar $\frac{2EA}{L}$ ban jaata hai. FEM mein standard DOF numbering convention kya hai? ::: Node-major: Node $i$ with $d$ DOFs per node ke global DOFs $d(i-1)+1$ se $di$ tak hote hain. Example ke taur par, 2D mein node 3 (d=2) ke DOFs 5 aur 6 hote hain. Bade FEM problems ke liye sparse storage kyun use karna chahiye? ::: $N=10^6$ DOFs ke liye ek full $N \times N$ matrix ko ~8 TB memory chahiye. Sparse formats (CSR, skyline) sirf non-zero entries store karte hain, memory ko manageable size (~GB) tak reduce karte hain. ## 🖼️ Concept Map ```mermaid flowchart TD STRUCT[Continuous structure] -->|meshed into| ELEM[Finite elements] ELEM -->|each has| KE[Element stiffness k_e] KE -->|expressed in| LOCAL[Local coordinates] NODES[Shared nodes] -->|force balance and compatibility| ASSEMBLY[Direct stiffness method] KE -->|superimposed via| ASSEMBLY CONN[Connectivity mapping] -->|places k_e into| ASSEMBLY ENERGY[Strain energy additivity] -->|justifies| ASSEMBLY BOOL[Boolean localization L_e] -->|extracts DOFs| ENERGY ASSEMBLY -->|produces| K[Global stiffness K] K -->|forms system| SYS[K u equals F] SYS -->|solved for| RESULT[Deformations and stresses] DOF[Degrees of freedom] -->|index rows and columns of| K ``` ## 🔬 Deep Dive > [!intuition] Aur gehraai mein jao — visual, zero se > Is topic ke step-by-step 3Blue1Brown-style breakdowns. - [[3.6.19 D1 Foundations|D1 · Foundations — har symbol zero se]] - [[3.6.19 D2 Visual Walkthrough|D2 · Visual walkthrough — derivation pictures mein]] - [[3.6.19 D3 Worked Examples|D3 · Worked examples — har scenario]] - [[3.6.19 D4 Exercises|D4 · Exercises — graded, full solutions]] - [[3.6.19 D5 Question Bank|D5 · Question bank — concept traps]]