Numerical Solution of Partial Differential Equations: y e y DX Dy
Numerical Solution of Partial Differential Equations: y e y DX Dy
Dina Sami
5.1 Introduction
Where y is the dependent variable معتمد،متغير تابع, and x is the independent variable متغير مستقل.
What if there is more than one independent variable? Then the differential equation is called a
partial differential equation. An example of such an equation would be
2u 2u
3 + 2 = x2 + y2
x 2
y
Subject to certain conditions: where u is the dependent variable, and x and y are the
independent variables.
.اي معادلة تحتوي على معامالت تفاضلية جزئية لدالة ذات متغيرين مستقلين او اكثر تسمى بالمعادلة التفاضلية الجزئية
،وتظهر في العديد من الحاالت الفيزياوية والهندسية مثل مسألة انتقال الحرارة خالل عمود معدني واهتزاز االسالك وغيرها
.حيث تعتمد الدوال الموجودة في جميع هذه المسائل على متغيرين او اكثر
When writing PDEs, it is common to denote partial derivatives using subscripts. For example:
𝜕𝑢 𝜕2 𝑢 𝜕2 𝑢
= 𝑢𝑥 , = 𝑢𝑥𝑥 , = 𝑢𝑥𝑦
𝜕𝑥 𝜕𝑥 2 𝜕𝑥 𝜕𝑦
The order of a PDE is determined by the highest derivative in the equation. For example,
.رتبة المعادلة التفاضلية الجزئية تحدد برتبة اعلى اشتقاق يظهر فيها
𝝏𝒖 𝝏𝒖
+𝟐 = 𝒙𝟐 first-order PDE
𝝏𝒙 𝝏𝒚
𝝏𝒛 𝝏𝒛 𝟐
= 2y (𝝏𝒙) first-order PDE
𝝏𝒚
153
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
𝝏𝒛 𝝏𝒛
(𝝏𝒙) (𝝏𝒙) ➔ عند الضرب تجمع االسس
𝝏𝟐 𝒖 𝝏𝒖 𝟑
= ( 𝝏𝒛 ) Second-order PDE
𝝏𝒙 𝝏𝒚
𝝏𝒖 𝝏𝒖 𝝏𝒖
( 𝝏𝒛 ) ( 𝝏𝒛 ) ( 𝝏𝒛 ) ➔ عند الضرب تجمع االسس
𝝏𝟐 𝒖 𝝏𝟐 𝒖 𝝏𝟐 𝒖
+𝟑 + = sin x Second-order PDE
𝝏𝟐 𝒙 𝝏𝒚𝝏𝒙 𝝏𝟐 𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝝏𝒖
=2 . Second-order PDE
𝝏𝒚𝝏𝒙 𝝏𝒙 𝝏𝒚
𝝏𝒖 𝝏𝒖
𝒖 =𝒙 +𝒚 First-order PDE
𝝏𝒙 𝝏𝒚
Degree of a PDEs
The degree of a differential equation is the degree of the highest derivative, which occurs in
it. For example,
𝝏𝒖 𝝏𝒖
+𝟐 = 𝒙𝟐 First-degree PDE
𝝏𝒙 𝝏𝒚
𝝏𝒛 𝝏𝒛 𝟐
= 2y ( ) second-degree PDE
𝝏𝒚 𝝏𝒙
𝝏𝟐 𝒖 𝝏𝒖 𝟑
= ( 𝝏𝒛 ) Third-degree PDE
𝝏𝒙 𝝏𝒚
𝝏𝟐 𝒖 𝝏𝟐 𝒖 𝝏𝟐 𝒖
+𝟑 + = sin x First-degree PDE
𝝏𝟐 𝒙 𝝏𝒚𝝏𝒙 𝝏𝟐 𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝝏𝒖
=2 . Second-degree PDE
𝝏𝒚𝝏𝒙 𝝏𝒙 𝝏𝒚
𝝏𝒖 𝝏𝒖
𝒖 =𝒙 +𝒚 Second-degree PDE
𝝏𝒙 𝝏𝒚
154
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
𝝏𝒖 𝝏𝒖
+𝟐 = 𝒙𝟐 linear PDE
𝝏𝒙 𝝏𝒚
𝝏𝒛 𝝏𝒛 𝟐
= 2y (𝝏𝒙) nonlinear PDE
𝝏𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝟑
= ( 𝝏𝒛 ) nonlinear PDE
𝝏𝒙 𝝏𝒚
𝝏𝟐 𝒖 𝝏𝟐 𝒖 𝝏𝟐 𝒖
+𝟑 + = sin x linear PDE
𝝏𝟐 𝒙 𝝏𝒚𝝏𝒙 𝝏𝟐 𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝝏𝒖
=2 . nonlinear PDE
𝝏𝒚𝝏𝒙 𝝏𝒙 𝝏𝒚
𝝏𝒖 𝝏𝒖
𝒖 =𝒙 +𝒚 nonlinear PDE
𝝏𝒙 𝝏𝒚
𝝏𝒖 𝝏𝒖
+𝟐 = 𝒙𝟐 Nonhomogeneous PDE
𝝏𝒙 𝝏𝒚
𝝏𝒛 𝝏𝒛 𝟐
= 2y (𝝏𝒙) Homogeneous PDE
𝝏𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝟑
= ( 𝝏𝒛 ) Homogeneous PDE
𝝏𝒙 𝝏𝒚
𝝏𝟐 𝒖 𝝏𝟐 𝒖 𝝏𝟐 𝒖
+𝟑 + = sin x Nonhomogeneous PDE
𝝏𝟐 𝒙 𝝏𝒚𝝏𝒙 𝝏𝟐 𝒚
𝝏𝟐 𝒖 𝝏𝒖 𝝏𝒖
=2 . Homogeneous PDE
𝝏𝒚𝝏𝒙 𝝏𝒙 𝝏𝒚
155
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
𝜕𝑢 𝜕𝑢
𝒖 =𝒙 +𝒚 Nonhomogeneous PDE
𝜕𝒙 𝜕𝒚
Dimension of PDEs
Dimension of the equation represented the number of spatial variables. There are two types of
independent variables as the following:
For example,
1
𝑢𝑥𝑥 = 𝑢𝑡𝑡 one- dimension
𝑐2
156
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
2u 2u 2u
A + B + C +D=0 (1)
x 2 xy y 2
And can be classified as one of three types. This classification depends only on the coefficients of the
second order derivatives. Of course, we assume that at least one of the coefficients A, B, and C is not
zero. Where A, B, C, and D are real constants, is said to be
One of the simple examples of a parabolic PDE is the heat-conduction equation for a metal rod.
𝜕2 𝑢 𝜕𝑢
𝛼 2 = (heat equation) (1-D) (2)
𝜕𝑥 𝜕𝑡
Where:
u = T (x, t) = Temperature as a function of location, x and time, t
k
𝛼 = thermal diffusivity, is given by =
C
Where:
k = Thermal conductivity of rod material,
𝜌 = Density of rod material.
C = specific heat of the rod material.
157
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
158
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
159
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
The length L along the x − axis is divided into m equal segments, while the width W along the
y − axis is divided into n equal segments, hence giving
𝐿 𝑊
m= , n=
∆𝑥 ∆𝑦
Now we will apply the finite difference approximation of the partial derivatives at a general
interior node ( i, j ).
Equations (3) and (4) are central divided difference approximations of the second derivatives.
Substituting Equations (3) and (4) in Equation (2), we get
𝑢𝑖+1,𝑗 −2 𝑢𝑖,𝑗 + 𝑢𝑖−1,𝑗 𝑢𝑖,𝑗+1 −2 𝑢𝑖,𝑗 + 𝑢𝑖,𝑗−1
+ =0 (5)
(∆𝑥)2 (∆𝑦)2
160
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
Note1: elliptic PDEs involve partial derivatives with respect to spatial variables only, and as a
consequence solutions of such equations are determined by boundary conditions alone. Parabolic and
hyperbolic equations involve partial derivatives with respect to both spatial and time variables, so
solutions of such equations generally are determined from boundary and initial conditions.
Note2: A solution of an elliptic PDE (such as Laplace’s equation) can describe a physical system
whose state is in equilibrium (steady state); a solution of a parabolic PDE (such as the heat equation)
can describe a diffusional state, whereas a hyperbolic PDE (such as the wave equation) can describe a
vibrational state.
Gauss-Seidel Method:
This method is utilities the latest iterative value available and scans the mesh points symmetrically
from left to right along successive rows. The formula is given below.
161
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
2u 2u
+ =0
x 2 y 2
𝐿 3
m= = =3
∆𝑥 1
𝑊 3
n= = =3
∆𝑦 1
` `
162
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
Equations (1) to (4) represent a set of four simultaneous linear equations and solving them
gives the temperature at the four interior nodes. The solution is
𝑢1,1 = 120.625 ℃
𝑢2,1 = 120. 625 ℃
𝑢1,2 = 61.875 ℃
𝑢2,2 = 61.875 ℃
163
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
Insulated Conditions
If the right edge of the plate is insulated, then the temperatures on the right edge nodes also
become unknowns. The finite difference Equation (6) in this case for the right edge for the
nodes (m, j ) , j = 1,2,3,..n − 1; i = 1,2,.., m
However, the node (m + 1, j ) is not inside the plate. The derivative boundary condition needs to
be used to account for these additional unknown nodal temperatures on the right edge. This is
done by approximating the derivative at the edge node (m, j ) as
T Tm+1, j − Tm−1, j
(8)
x m, j 2(x)
giving
T
Tm +1, j = Tm −1, j + 2(x) (9)
x m, j
substituting Equation (11) in Equation (10), gives an equation to use at the Neuman Boundary
condition
164
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
Sol:
𝜕2 𝑢 𝜕2 𝑢
+ = 0
𝜕𝑥 2 𝜕𝑦 2
𝐿 2.4 𝑊 3
m= = =4 , n= = =5
∆𝑥 0.6 ∆𝑦 0.6
165
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
Now we can being to solve for the temperature at each interior node using:
1 1
𝑇1,1 = (𝑇2,1 + 𝑇0,1 + 𝑇1,2 + 𝑇1,0 ) , 𝑇2,1 = (𝑇3,1 + 𝑇1,1 + 𝑇2,2 + 𝑇2,0 )
4 4
1
𝑇3,1 = (𝑇4,1 + 𝑇2,1 + 𝑇3,2 + 𝑇3,0 )
4
1 1
𝑇1,2 = (𝑇2,2 + 𝑇0,2 + 𝑇1,3 + 𝑇1,1 ) , 𝑇2,2 = (𝑇3,2 + 𝑇1,2 + 𝑇2,3 + 𝑇2,1 )
4 4
1
𝑇3,2 = (𝑇4,2 + 𝑇2,2 + 𝑇3,3 + 𝑇3,1 )
4
1 1
𝑇1,3 = (𝑇2,3 + 𝑇0,3 + 𝑇1,4 + 𝑇1,2 ) , 𝑇2,3 = (𝑇3,3 + 𝑇1,3 + 𝑇2,4 + 𝑇2,2 )
4 4
1
𝑇3,3 = (𝑇4,3 + 𝑇2,3 + 𝑇3,4 + 𝑇3,2 )
4
1 1
𝑇1,4 = (𝑇2,4 + 𝑇0,4 + 𝑇1,5 + 𝑇1,5 ) , 𝑇2,4 = (𝑇3,4 + 𝑇1,4 + 𝑇2,5 + 𝑇2,3 )
4 4
1
𝑇3,4 = (𝑇4,4 + 𝑇2,4 + 𝑇3,5 + 𝑇3,3 )
4
1 1 1 0
𝑇3,1 = (100 + 𝑇2,1 + 𝑇3,2 + 50) = 42.57
4
1 1 0 0 1 1 0 11 0 1
𝑇1,2 = (𝑇2,2 + 75 + 𝑇1,3 + 𝑇1,1 ) = 26.56 , 𝑇2,2 = (𝑇3,2 + 𝑇1,2 + 𝑇2,3 + 𝑇2,1 ) = 11.71
4 4
1 1 1 0 1
𝑇3,2 = (100 + 𝑇2,2 + 𝑇3,3 + 𝑇3,1 ) = 38.57
4
1 1 0 0 1 1 0 11 0 1
𝑇1,3 = (𝑇2,3 + 75 + 𝑇1,4 + 𝑇1,2 ) = 25.39 , 𝑇2,3 = (𝑇3,3 + 𝑇1,3 + 𝑇2,4 + 𝑇2,2 ) = 9.27
4 4
1 1 1 0 1
𝑇3,3 = (100 + 𝑇2,3 + 𝑇3,4 + 𝑇3,2 ) = 36.96
4
166
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
1 1 0 1 1 0 1 1 1
𝑇1,4 = (𝑇2,4 + 75 + 300 + 𝑇1,3 ) = 100.09 , 𝑇2,4 = (𝑇3,4 + 𝑇1,4 + 300 + 𝑇2,3 )=
4 4
102.34
1 1 1 1
𝑇3,4 = (100 + 𝑇2,4 + 300 + 𝑇3,3 ) = 134.82
4
2nd iteration
2 1 1 1
𝑇1,1 = (𝑇2,1 + 75 + 𝑇1,2 + 50) = 42.96
4
2 −𝑇 1
𝑇1,1 1,1 42.96−31.25
|𝜀𝑎1,1 | = | 2
𝑇1,1
| × 100 = | 42.96
| × 100 = 27.26%
2 1 1 2 1
𝑇2,1 = (𝑇3,1 + 𝑇1,1 + 𝑇2,2 + 50) = 36.81
4
2 −𝑇 1
𝑇2,1 2,1 36.81−20.31
|𝜀𝑎2,1 | = | 2
𝑇2,1
| × 100 = | 36.81
| × 100 = 44.82%
2 1 2 1
𝑇3,1 = (100 + 𝑇2,1 + 𝑇3,2 + 50) = 56.34
4
2 −𝑇 1
𝑇3,1 3,1 56.34−42.57
|𝜀𝑎3,1 | = | 2
𝑇3,1
| × 100 = | 56.34
| × 100 = 24.44%
2 1 1 1 2
𝑇1,2 = (𝑇2,2 + 75 + 𝑇1,3 + 𝑇1,1 ) = 38.76
4
2 −𝑇 1
𝑇1,2 1,2 38.76−26.56
|𝜀𝑎1,2 | = | 2
𝑇1,2
| × 100 = | 38.76
| × 100 = 31.47%
2 1 1 2 1 2
𝑇2,2 = (𝑇3,2 + 𝑇1,2 + 𝑇2,3 + 𝑇2,1 ) = 30.85
4
2 −𝑇 1
𝑇2,2 2,2 30.85−11.71
|𝜀𝑎2,2 | = | 2
𝑇2,2
| × 100 = | 30.85
| × 100 = 62.04%
2 1 2 1 2
𝑇3,2 = (100 + 𝑇2,2 + 𝑇3,3 + 𝑇3,1 ) = 56.03
4
2 −𝑇 1
𝑇3,2 3,2 56.03−38.57
|𝜀𝑎3,2 | = | 2
𝑇3,2
| × 100 = | 56.03
| × 100 = 31.11%
167
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
2 1 1 1 2
𝑇1,3 = (𝑇2,3 + 75 + 𝑇1,4 + 𝑇1,2 ) = 55.78
4
2 −𝑇 1
𝑇1,3 1,3 55.78−25.39
|𝜀𝑎1,3 | = | 2
𝑇1,3
| × 100 = | 55.78
| × 100 = 54.48%
2 11 2 1 2
𝑇2,3 = (𝑇3,3 + 𝑇1,3 + 𝑇2,4 + 𝑇2,2 ) = 56.48
4
2 −𝑇 1
𝑇2,3 2,3 56.48−9.27
|𝜀𝑎2,3 | = | 2
𝑇2,3
| × 100 = | 56.48
| × 100 = 83.58%
2 1 2 1 2
𝑇3,3 = (100 + 𝑇2,3 + 𝑇3,4 + 𝑇3,2 ) = 86.83
4
2 −𝑇 1
𝑇3,3 3,3 86.83−36.96
|𝜀𝑎3,3 | = | 2
𝑇3,3
| × 100 = | 86.83
| × 100 = 57.43%
2 1 1 2
𝑇1,4 = (𝑇2,4 + 75 + 300 + 𝑇1,3 ) = 133.28
4
2 −𝑇 1
𝑇1,3 1,3 133.28−100.09
|𝜀𝑎1,4 | = | 2
𝑇1,3
| × 100 = | 133.28
| × 100 = 24.9%
2 1 1 2 2
𝑇2,4 = (𝑇3,4 + 𝑇1,4 + 300 + 𝑇2,3 ) = 156.14
4
2 −𝑇 1
𝑇2,3 2,3 156.14−102.34
|𝜀𝑎2,4 | = | 2
𝑇2,3
| × 100 = | 156.14
| × 100 = 34.45%
2 1 2 2
𝑇3,4 = (100 + 𝑇2,4 + 300 + 𝑇3,3 ) = 160.74
4
2 −𝑇 1
𝑇3,3 3,3 160.74−134.82
|𝜀𝑎3,4 | = | 2
𝑇3,3
| × 100 = | 160.74
| × 100 = 16.12%
The table below show the temperature distribution in the plate after ten iterations:
𝑇1,1 73.0239 𝑇1,3 119.0976
𝑇2,1 76.6127 𝑇2,3 137.3802
𝑇3,1 82.4837 𝑇3,3 130.8056
𝑇1,2 91.9585 𝑇1,4 172.9755
𝑇2,2 102.1577 𝑇2,4 198.1055
𝑇3,2 103.7757 𝑇3,4 182.2278
168
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
169
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
170
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
171
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
172
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
173
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
174
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami
175