Numerical Solutions for
ODE and PDE
Dr. Asha Sunilkumar
Classification of Second Order PDE
The general second order linear partial differential equation in two
independent variables x,y is of the form
𝐴𝑢𝑥𝑥 + 𝐵𝑢𝑥𝑦 + 𝐶𝑢𝑦𝑦 + 𝐷𝑢𝑥 +E 𝑢𝑦 + 𝐹𝑢 = 0
where A, B, C, D, E, F are general functions of x and y.
Such a PDE is said to be
(i) Elliptic if 𝐵2 − 4𝐴𝐶 < 0
(ii) parabolic if 𝐵2 − 4𝐴𝐶 = 0
(iii) hyperbolic if 𝐵2 − 4𝐴𝐶 > 0
Dr. Asha Sunilkumar
Examples
Classify the following equations:
1. 𝑢𝑥𝑥 + 4𝑢𝑥𝑦 + 4𝑢𝑦𝑦 − 𝑢𝑥 − 2 𝑢𝑦 = 0
2. 𝑥 2 𝑢𝑥𝑥 + (1 − 𝑦 2 )𝑢𝑦𝑦 = 0
3. (1 + 𝑥 2 )𝑢𝑥𝑥 +(5 + 2𝑥 2 )𝑢𝑥𝑡 + (4 + 𝑥 2 )𝑢𝑡𝑡 = 0
4. 𝑐 2 𝑢𝑥𝑥 − 𝑢𝑡𝑡 = 0
5. 𝑐 2 𝑢𝑥𝑥 − 𝑢𝑡 = 0
6. 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0
Dr. Asha Sunilkumar
Finite difference approximation to ordinary and partial derivatives
Consider the rectangular region R in the XY plane . Divide this region
into a rectangular network of sides ∆𝑥 = ℎ and ∆𝑦 = 𝑘. The points of
intersection of the dividing lines are called mesh points, nodal points or
grid points.
Then we have the finite difference approximations for the partial
derivatives in X-direction.
Dr. Asha Sunilkumar
𝜕𝑢 𝑢 𝑥+ℎ,𝑦 −𝑢(𝑥,𝑦)
𝑢𝑥 = = +𝑂 ℎ
𝜕𝑥 ℎ
𝑢 𝑥,𝑦 −𝑢(𝑥−ℎ,𝑦)
𝑢𝑥 = +𝑂 ℎ
ℎ
𝑢 𝑥+ℎ,𝑦 −𝑢(𝑥−ℎ,𝑦)
𝑢𝑥 = +𝑂 ℎ
2ℎ
𝜕2 𝑢 𝑢 𝑥−ℎ,𝑦 −2𝑢 𝑥,𝑦 +𝑢(𝑥+ℎ,𝑦)
𝑢𝑥𝑥 = = + 𝑂 ℎ2
𝜕𝑥 2 ℎ2
Dr. Asha Sunilkumar
Now along y-direction
𝜕𝑢 𝑢 𝑥,𝑦+𝑘 −𝑢(𝑥,𝑦)
𝑢𝑦 = = +𝑂 𝑘
𝜕𝑦 𝑘
𝑢 𝑥,𝑦 −𝑢(𝑥,𝑦−𝑘)
𝑢𝑦 = +𝑂 𝑘
𝑘
𝑢 𝑥,𝑦+𝑘 −𝑢(𝑥,𝑦−𝑘)
𝑢𝑦 = +𝑂 𝑘
2𝑘
𝜕2 𝑢 𝑢 𝑥,𝑦+𝑘 −2𝑢 𝑥,𝑦 +𝑢(𝑥,𝑦−𝑘)
𝑢𝑦𝑦 = 2 = + 𝑂 𝑘2
𝜕𝑦 𝑘2
Dr. Asha Sunilkumar
Numerical Solution of a PDE
That is, to draw lines 𝑥 = 𝑖ℎ, 𝑦 = 𝑗𝑘; 𝑖, 𝑗 = 1,2,3, … . .
Being parallel to Y-axis and X- axis respectively resulting into a
network of rectangles.
Write u(x,y) = u(ih,jk) as u(i, j)
𝑢𝑖+1,𝑗 −𝑢𝑖,𝑗 𝑢𝑖,𝑗+1 −𝑢𝑖,𝑗
Then 𝑢𝑥 = -----(1) 𝑢𝑦 =
𝑘
-------(4)
ℎ
𝑢𝑖,𝑗 −𝑢𝑖−1,𝑗 𝑢𝑖,𝑗 − 𝑢𝑖,𝑗−1
=
ℎ
------(2) = ---(5)
𝑘
𝑢𝑖+1,𝑗 −𝑢𝑖−1,𝑗 𝑢𝑖,𝑗+1 −𝑢𝑖,𝑗−1
= ------(3) = ---(6)
2ℎ 2𝑘
Dr. Asha Sunilkumar
𝑢𝑖+1,𝑗 −2𝑢𝑖,𝑗 +𝑢𝑖−1,𝑗
𝑢𝑥𝑥 = ------(7)
ℎ2
𝑢𝑖,𝑗+1 −2𝑢𝑖,𝑗 +𝑢𝑖,𝑗−1
𝑢𝑦𝑦 = --------(8)
𝑘2
The substitution of these finite difference approximations into a given
PDE approximates the PDE into a finite difference equation.
Dr. Asha Sunilkumar
Dr. Asha Sunilkumar