Vtuupdates - Numerical Solution of PDE
Vtuupdates - Numerical Solution of PDE
MODULE -4
NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL
EQUATIONS
Introduction:
Partial differential equations arise in the study of many
branches of applied mathematics, e.g., in fluid dynamics, heat transfer,
boundary layer flow, elasticity, quantum mechanics, and electro-
magnetic theory. Only a few of these equations can be solved by
analytical methods which are also complicated by requiring use of
advanced mathematical techniques. In most of the cases, it is easier to
develop approximate solutions by numerical methods. Of all the
numerical methods available for the solution of partial differential
equations, the method of finite differences is most commonly used. In
this method, the derivatives appearing in the equation and the boundary
conditions are re- placed by their finite difference approximations. Then
the given equation is changed to a system of linear equations which are
solved by iterative pro coendures. This process is slow but produces
good results in many boundary value problems. An added advantage of
this method is that the computation can be carried by electronic
computers. To accelerate the solution, some- times the method of
relaxation proves quite effective.
Now let us examine the nature of three PDEs which are under our
discussion.
Sl.no P.D.E A B C 𝐵2 − 4𝐴𝐶 Nature of the
PDE
1 One dimensional 𝑐2 0 -1 4𝑐2 > 0 Hyperbolic
wave equation:
𝑐2𝑢𝑥𝑥 − 𝑢𝑡𝑡 = 0
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
+… (1)
+… (2)
Assuming h to be small we shall neglect terms containing ℎ2, ℎ3, … …in
(1) and (2) so that we have
from (1)
from (2)
Or
This is the finite difference approximation for 𝑦′′(𝑥)
Extension to the Partial derivatives
Let 𝑢 = 𝑢(𝑥, 𝑦) be a function of two independent variables. The finite
difference approximation for the first order partial derivatives: 𝑢𝑥 , 𝑢𝑦 and
second order partial derivatives : 𝑢𝑥𝑥 , 𝑢𝑦𝑦 are as follows.
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
…… (1)
……. (2)
…… (3)
…… (4)
…….. (5)
…….. (6)
……. (7)
……. (8)
NUMERICAL SOLUTION OF A PDE
Consider a rectangular region R in the x, y plane. Let us divide
this region into a network of rectangular network of sides h and
k as shown in Figure. In other words, we draw lines x=ih, y=jk ;
i, j = 1,2,3…..being parallel to the Y –axis and X-axis
respectively resulting into a network of rectangles.
The points of intersection of the dividing lines are called mesh
points, nodal points, or grid points
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
We write 𝑢(𝑥, 𝑦) = 𝑢(𝑖ℎ, 𝑗𝑘) and finite difference approximation for the
partial derivatives given by (1) to (8) are put in the following modified
form.
ui , j+ ui+ , j+
–1 1 1 1
𝑢𝑖,𝑗+1
𝑢𝑖 ,𝑗
Ui-1, j 𝑢𝑖,𝑗 ui+
1, j ui , j 1
–1 – ui+ , j
1 –1
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑢𝑖,𝑗−1
Now we will substitute the finite difference approximation for the partial
derivatives present in equation (I)
Hence we have
Or ……….
(2)
This is called the Standard five-point formula
Since the Laplace equation remains invariant when the coordinates are
rotated through an angle 45° we can also have the formula in the form
……….
(3)
It is observed that the value of 𝑢𝑖,𝑗 is the average of its values at the four
neighbouring diagonal mesh points. It is also called diagonal five-point
formula.
The procedure will be repeated till we get the values to the desired degree
of accuracy, this process is called liebmann’s iteration process
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Here 𝑢5 is located at the center of the region and hence by the standard
five point formula,
Next we shall compute 𝑢1, 𝑢3, 𝑢7, 𝑢9 by the diagonal five point formula
Also 𝑢7 = 1125 = 𝑢9
First iteration
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
= 1300.7813
= 1362.7930
= 1025.3906
= 993.8965
Thus the required first iterative values to the nearest integer are as follows
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
2𝑢2 − 2𝑢3 = 35
∴ 𝑢2 = 40.4 , 𝑢3 = 22.9
Here 𝑢5 is located at the center of the region and hence by the standard
five point formula,
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Next we shall compute 𝑢1, 𝑢3, 𝑢7, 𝑢9 by the diagonal five point formula
Thus the required mesh points corrected to two decimal points are
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
We shall represent these values on the square region and let 𝑢1, 𝑢2, 𝑢3,
𝑢4 ….be the interior mesh points of the region
Here 𝑢5 is located at the center of the region and hence by the standard
five point formula,
Next we shall compute 𝑢1, 𝑢3, 𝑢7, 𝑢9 by the diagonal five point formula
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
FIRST ITERATION
Thus the first iterative values corrected to three decimal points are
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Thus the required second iterative values corrected to three decimal points
are
Since
The values of x in 0 ≤ 𝑥 ≤ 4 with ℎ = 1 are 0,1,2,3,4 and the
values of t with 𝑘 = 1 are 0,1,2,3,4,5
We have the following initial table wherein the values in the first and
last column are zero since 𝑢(0, 𝑡) = 0, 𝑢(4, 𝑡) = 0
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Since
The values of x in 0 ≤ 𝑥 ≤ 1 with ℎ = 0.2 are 0,0.20.4,0.6,0.8 and 1.
Also the values of t in the given range 0 ≤ 𝑡 ≤ 0.1 are
0,0.020.04,0.06,0.08 and 0.1
We have the following initial table , where in the values in the first and
ladt column are zero
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡
conditions
Taking , we have
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑢𝑡(𝑥, 0) = 0
--- (9)
Further 𝑢(0, 𝑡) = 0 and 𝑢(𝑙, 𝑡) = 0 means 𝑢0,𝑗 = 0 and 𝑢𝑙,𝑗 = 0 which
implies that the values along the first and last column are zero.
𝑢(𝑥, 0) = 𝑓(𝑥) means 𝑢𝑖,0 = 𝑓(𝑥) gives the values of 𝑢 along the first
row.
Finally 𝑢𝑡(𝑥, 0) = 0 modified into the form (9) giving 𝑢𝑖,1,will give us the
values of 𝑢 along the second row. These values will help us to obtain the
rest of the value of 𝑢 at the mesh points by the explicit formula (7).
Thus we are able to determine 𝑢(𝑥, 𝑡) at all interior mesh points.
Working procedure for problems
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
, … , 𝑥𝑛 = 𝑥0 + 𝑛ℎ and that of
𝑡 are 𝑡0, 𝑡1 = 𝑡0 + 𝑘 , 𝑡2 = 𝑡0 + 2𝑘 , … , 𝑡𝑛 = 𝑡0 + 𝑛𝑘.
Putting 𝑗 = 0
(10) ⇒ 𝑢𝑖,1 = 2(1 − 𝑐2𝜆2)𝑢𝑖,0 + 𝑐2𝜆2(𝑢𝑖−1,0 + 𝑢𝑖+1,0) − 𝑢𝑖,−1 ---(11)
𝑢𝑡(𝑥, 0) = 0
or 𝒖𝒊,𝟏 = 𝒖𝒊,−𝟏
Putting 𝑗 = 1
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Problems
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
{𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 1}
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Since ℎ = 1 , we have
Step size of 𝑥: ℎ = 1 where 0 ≤ 𝑥 ≤ 5
Step size of 𝑡: 𝑘 = 0.25 where 0 ≤ 𝑡 ≤ 1 as required.
∴ Values of 𝑥 are 0,1,2,3,4,5
Values of 𝑡 are 0,0.25,0.5,0.75,1
We have the following initial table. The values in the first and last
column are zero since 𝑢(0, 𝑡) = 0 = 𝑢(5, 𝑡)
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
3. Solve 25𝑢𝑥𝑥 = 𝑢𝑡𝑡 , at the pivotal points given 𝑢(0, 𝑡) = 0 = 𝑢(5, 𝑡),
by taking ℎ = 1.
Compute 𝑢(𝑥, 𝑡) for 0 ≤ 𝑡 ≤ 1.
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and
where 𝑐2 = 25 or 𝑐 = 5.
Since ℎ = 1 , we have
Step size of 𝑥: ℎ = 1 where 0 ≤ 𝑥 ≤ 5
Step size of 𝑡: 𝑘 = 0.2 where 0 ≤ 𝑡 ≤ 1 as required.
We have
𝑢4,0 = 𝑢(4,0) = 5
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑢3,5 = 𝑢2,4 + 𝑢4,4 − 𝑢3,3 = −10 − 7.5 + 2.5 = −15 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 4}
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
taking .
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and
By data , we have .
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Hence
To find remaining row values we use
Hence .
Fourth row elements
.
Last row elements
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and hence
Here
Since ℎ = 1 , we have
Step size of 𝑥: ℎ = 1 where 0 ≤ 𝑥 ≤ 5
Step size of 𝑡: 𝑘 = 0.5 where 0 ≤ 𝑡 ≤ 2 as required.
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑢4,0 = 𝑢(4,0) = 4
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
by taking
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and
𝑐2 = 1 or 𝑐 = 1.
By data , we have .
Now,
16
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and hence
Here
Step size of 𝑥: ℎ = 0.2 where 0 < 𝑥 < 1
Step size of 𝑡: 𝑘 = 0.2 where 𝑡 = 1 as required.
.
To find second row elements
Consider
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Its method of solution is similar to that of the Laplace equation. Here the standard five-
point formula for (1) takes the form
1)Solve the Poisson equation 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = – 81𝑥𝑦, 0 < 𝑥 < 1, 0 < 𝑦 <
1 given that 𝑢(0, 𝑦) = 0, 𝑢(𝑥, 0) = 0 , 𝑢(1, 𝑦) = 100, 𝑢(𝑥, 1) = 100 and ℎ = 1/3.
Solution:
Here h = 1/3 , using given data 𝑢(0, 𝑦) = 0, 𝑢(𝑥, 0) = 0 , 𝑢(1, 𝑦) = 100, 𝑢(𝑥, 1) = 100
ui−1,j + ui+1,j + ui,j+1 + ui,j−1 − 4ui,j = h2f(ih, jh) = ℎ2 [– 81(𝑖ℎ . 𝑗ℎ)] = ℎ4 (– 81)𝑖𝑗 =
– 𝑖𝑗 (𝑖)
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
𝑖. 𝑒. , 𝑢1 – 4𝑢3 + 𝑢4 = – 1 (𝑖𝑣)
2)Solve the equation ∇2𝑢 = −10(𝑥2 + 𝑦2 + 10) over the square with sides x = 0 =
y, x = 3 = y with 𝑢 = 0 on the boundary and mesh length = 1
Solution:
Here h = 1. , using given data x = 0 = y, x = 3 = y
The standard five-point formula for the given equation
is
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Equations (ii) and (v) show that u4 = u1. Thus the above equations reduce to
𝑢1(1) = 37.5
Second iteration:
www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates
Third iteration:
Fourth iteration:
Fifth iteration:
Since these values are the same as those of fourth iteration, we have
𝑢1 = 75 𝑢2 = 82.5 𝑢3 = 67.5
3) Solve the Poisson’s equation ∇2𝑢 = 8𝑥2𝑦2 for the square mesh of given Figure with u(x, y)
= 0 on the boundary and mesh length = 1.
www.vtuupdates.com