4.7.21 · HinglishPartial Differential Equations

Intro to finite difference methods for PDEs

1,551 words7 min readRead in English

4.7.21 · Maths › Partial Differential Equations


WHAT is a finite difference method?

Notation convention (yeh yaad kar lo): subscript space hai, superscript time hai.


HOW do we turn a derivative into a difference? (Derivation from scratch)

Sab kuch Taylor's theorem se aata hai. ko ke aas-paas expand karo, step karke:

u(x_i+h) = u_i + h\,u_i' + \tfrac{h^2}{2}u_i'' + \tfrac{h^3}{6}u_i''' + O(h^4)\tag{A} u(x_i-h) = u_i - h\,u_i' + \tfrac{h^2}{2}u_i'' - \tfrac{h^3}{6}u_i''' + O(h^4)\tag{B}

First derivative — teen flavours

Forward difference. (A) se, solve karo: Yeh step kyun? Hum ko isolate karte hain aur ya usse zyada se multiply hone wali cheezein drop kar dete hain; pehla dropped term hai, isliye yeh first-order accurate hai, error .

Backward difference. (B) se: , yeh bhi .

Central difference. (A) mein se (B) ghataao. Even-power () terms cancel ho jaate hain: Yeh step kyun? term ka cancel hona wahi reason hai kyun central ek order zyada accurate hota hai same grid ke liye — ek free upgrade.

Second derivative

(A) aur (B) ko add karo. Odd-power (, ) terms cancel ho jaate hain: solve karo:

Figure — Intro to finite difference methods for PDEs

WHY does this work? (Accuracy ke peechhe ke numbers)


Worked Example 1 — Heat equation (explicit FTCS scheme)

Heat equation solve karo.

Step 1 — Node par time mein forward: Kyun? Time mein forward matlab naya value akela appear karta hai — hum ise explicitly solve kar sakte hain bina matrix invert kiye.

Step 2 — Space mein central: Kyun? Sabse achhi accuracy () bina kisi extra cost ke.

Step 3 — PDE mein substitute karo aur rearrange karo: Yeh step kyun? Right side par sab kuch known time level par hai, isliye hum time mein ek row ek baar march forward karte hain. Yahi FTCS (Forward-Time Central-Space) hai aur yeh explicit hai.


Worked Example 2 — One Poisson step (boundary value problem)

ko par ke saath solve karo, use karke (toh interior nodes ), .

Step 1 — Discretise karo: . Kyun? Present derivative ko central second-difference se replace karo.

Step 2 — Har interior node ke liye equations likho (, , ): Yeh step kyun? Boundary values known constants hain, isliye woh right-hand side par chale jaate hain. Hume ek chota linear system milta hai tridiagonal matrix ke saath:

Step 3 — Solve karo. Symmetry se . Eq.1 se: . Eq.2 mein sub karo: . Tab . Check: ka exact solution hai; par yeh deta hai — exact, kyunki true solution ek quadratic hai aur central scheme cubics ke liye exact hai.


Recall Feynman: ek 12-saal ke bachhe ko explain karo

Ek curve graph paper par socho. Tum sirf wahan dots mark karte ho jahan grid lines cross karti hain. Kisi dot par curve kitna steep hai yeh guess karne ke liye, tum bas left wale aur right wale dot ko dekhte ho aur poochhhte ho "unke beech height kitni change hui?" — wahi slope-from-neighbours hai. Yeh guess karne ke liye ki woh kitna bend karta hai, tum middle dot ko apne dono neighbours ke average se compare karte ho. Poora "finite difference" idea bas yeh hai: slopes aur bends exactly mat napo — paas wale dots se estimate karo. Jitne paas ke dots (chota ), utna acha guess. Khatraa: agar tum time mein bahut laalchi step forward lete ho, toh tumhare guesses errors ikattha karte hain aur picture explode ho jaati hai.


Flashcards

Finite difference method mein derivative ki jagah kya aata hai?
Paas ke grid values ka ek difference quotient, jo Taylor expansion se derive hota hai.
mein kaun sa index space hai aur kaun sa time?
Subscript = space (), superscript = time ().
ka central difference aur uska order?
, order .
ka forward difference aur uska order?
, order .
ka central second-difference?
, order .
Central first-difference kyun hai lekin forward sirf ?
Symmetric expansions ghataane se term cancel ho jaata hai, leading error hat jaata hai.
ke liye FTCS update?
, .
Explicit FTCS heat scheme ke liye stability condition?
.
Agar halve karo, toh error kaise change hota hai?
Lagbhag 4 ke factor se girta hai.
(BVP) discretise karne se kaisi system banti hai?
Ek tridiagonal linear system jisme boundary values RHS par chali jaati hain.

Connections

  • Taylor's Theorem — woh engine jo har difference formula aur uska error order generate karta hai.
  • Heat Equation — primary parabolic test case (FTCS, implicit schemes).
  • Wave Equation — hyperbolic case; time mein central use karta hai, CFL condition tak le jaata hai.
  • Laplace and Poisson Equations — elliptic BVPs jo tridiagonal/banded systems dete hain.
  • Von Neumann Stability Analysiskyun rule exist karta hai.
  • Tridiagonal Matrix Algorithm (Thomas) — FDM ke produce kiye linear systems ka fast solver.

Concept Map

cannot store infinite points

spacings h and k

subscript space superscript time

expand about x_i

isolate u prime

isolate u prime

subtract, u'' cancels

add, u' cancels

replace derivatives

replace derivatives

replace derivatives

derivatives become differences

computer solves

PDE with u x,t

Grid / mesh

Nodal values u i n

Index notation

Taylor theorem

Step by plus/minus h

Forward diff O h

Backward diff O h

Central diff O h squared

Second deriv O h squared

Algebraic system

Approximate solution