0% found this document useful (0 votes)
350 views39 pages

Vtuupdates - Numerical Solution of PDE

1) The document discusses numerical methods for solving partial differential equations (PDEs), specifically the finite difference method. 2) PDEs are classified based on the value of B^2 - 4AC as elliptic, parabolic, or hyperbolic. Common PDEs like the Laplace, heat, and wave equations are examined. 3) Finite difference approximations are developed for derivatives, reducing PDEs to a system of algebraic equations solved iteratively to obtain numerical solutions. Examples demonstrate solving the Laplace equation on rectangular meshes.

Uploaded by

Shanthi.V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
350 views39 pages

Vtuupdates - Numerical Solution of PDE

1) The document discusses numerical methods for solving partial differential equations (PDEs), specifically the finite difference method. 2) PDEs are classified based on the value of B^2 - 4AC as elliptic, parabolic, or hyperbolic. Common PDEs like the Laplace, heat, and wave equations are examined. 3) Finite difference approximations are developed for derivatives, reducing PDEs to a system of algebraic equations solved iteratively to obtain numerical solutions. Examples demonstrate solving the Laplace equation on rectangular meshes.

Uploaded by

Shanthi.V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Numerical Solution of Partial Differential Equations VTU Updates

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.

Classification of Second Order Equations


The general linear partial differential equation of the second order in two
independent variables is of the form

A(X,Y) + B (X,Y) +C(X,Y) + (X,Y,U,

Such a partial differential equation is said to be

(i) elliptic if B2 – 4AC < 0, (ii) parabolic if B2 – 4AC = 0, and

(iii)hyperbolic if B2 – 4AC > 0

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

2 One dimensional 𝑐2 0 0 0 Parabolic


heat equation:
𝑐2𝑢𝑥𝑥 − 𝑢𝑡 = 0
3 Two dimensional 1 0 1 -4 < 0 Elliptic
Laplace’s equation:
𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0

Finite difference approximation to ordinary and partial derivatives


Let y =y(x) and its derivatives be single valued continuous functions of x.
we have Taylors expansion,

+… (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)

Also we have by (1) + (2) we have


These three expressions for 𝑦′(𝑥) are the finite difference approximation
in terms of forward, backward and central difference respectively.
Also (1) + (2) by neglecting terms containing will give us,

𝑦(𝑥 + ℎ) − 𝑦(𝑥 − ℎ) = 2𝑦(𝑥) + ℎ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.

The substitution of these finite difference approximations into the given


PDE converts the
PDE into finite difference equations. we can solve this equation under
given set of conditions.
This will enable us to determine 𝑢𝑖,𝑗 explicitly at all the interior mesh
points. These values constitute a numerical solution to the given PDE.
NUMERICAL SOLUTION OF THE LAPLACE EQUATION IN TWO
DIMENSIONS

Laplace equation in two dimensions is ………..


(I)
We consider a rectangular region R for which 𝑢(𝑥, 𝑦) is known at the
boundary. Let us suppose that the region is such that it can be divided into
network of square mesh of side h.

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

That is , 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗−1+ + 𝑢𝑖,𝑗+1 =4𝑢𝑖,𝑗

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 accuracy of the values of 𝑢𝑖,𝑗 can be improved by successive


application of the formula
(2). We regard the obtained values of 𝑢𝑖,𝑗 as the initial approximation
denoted by 𝑢(0)𝑖,𝑗, then the first iteration is carried out by using the latest
iterative values available on hand where we have,

The procedure will be repeated till we get the values to the desired degree
of accuracy, this process is called liebmann’s iteration process

Example :1 Solve Laplace’s equation 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0 for the following


square mesh with boundary values as shown in the fig.

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

Further we compute 𝑢2, 𝑢4, 𝑢6, 𝑢8 by standard five point formula

These are considered as initial approximation values for Liebmanns


iteration. We compute 𝑢𝑖 (i=1 to 9) in the serial order by using the latest
iterative values on hand by applying S. F.

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

𝑢1 = 1031 𝑢2 = 1164 𝑢3 = 1025 𝑢4 = 1414 𝑢5 = 1301 𝑢6 =


1363

𝑢7 = 1025 𝑢8 = 1113 𝑢9 = 994

Example :2 Solve Laplace’s equation 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0 for the following


square mesh with boundary values as shown in the fig

Now we have a system of equations to be solved

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

4𝑢1 − 𝑢2 − 𝑢3 = 120 ……………….. (1)

− 𝑢1 + 4𝑢2 − 𝑢4 = 100 ………………… (2)

−𝑢1 + 4𝑢3 − 𝑢4 = 30 ………………… (3)

−𝑢2 − 𝑢3 + 4𝑢4 = 0 …………………. (4)

Let us eliminate 𝑢1 from (1) and (2); (2) and (3)

15𝑢2 − 𝑢3 − 4𝑢4 = 520 …………. (5)

4𝑢2 − 4𝑢3 = 70 …………. (6)

Now we will eliminate 𝑢4 from (4) and (5)

14𝑢2 − 2𝑢3 = 520 …………..(7)


Now solve (6) and (7)

2𝑢2 − 2𝑢3 = 35

14𝑢2 − 2𝑢3 = 520

∴ 𝑢2 = 40.4 , 𝑢3 = 22.9

Hence from (1) 𝑢1 = 45.825 and from (4) 𝑢4 = 15.825


Thus these are the required values at the interior mesh points.

Example :3 Solve Laplace’s equation 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0 for the following


square mesh with boundary values as shown in the fig.

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

Further we compute 𝑢2, 𝑢4, 𝑢6, 𝑢8 by standard five point formula

Thus the required mesh points corrected to two decimal points are

𝑢1 = 7.38 𝑢2 = 13.55 𝑢3 = 17.28 𝑢4 = 6.52 𝑢5 =


12.53 𝑢6 = 16.12

𝑢7 = 6.16 𝑢8 = 11.11 𝑢9 = 13.66


Example :4 Solve ∇2𝑢 = 0 in the square region bounded by the
coordinate axes and the lines 𝑥 = 4, 𝑦 = 4 with the boundary conditions
given by the analytical expressions,
(i) 𝑢(0, 𝑦) = 0 for 0≤𝑦≤4
(ii) 𝑢(4, 𝑦) = 12 + 𝑦 for 0≤𝑦≤4
(iii) 𝑢(𝑥, 0) = 3𝑥 for 0≤𝑥≤4
(iv) 𝑢(𝑥, 4) = 𝑥2 for 0≤𝑥≤4

Also employ Liebmann’s iteration process to compute the second iterative


of 𝑢(𝑥, 𝑦) correct to two decimal places.

We have ∇2𝑢 = 0 represented by in two dimensions.


We shall divide the square region in to 16 squares of side one unit.
We shall derive the values of 𝑢(𝑥, 𝑦) on the boundary from the given
expressions.

(i) 𝑢(0, 𝑦) = 0 for 0≤𝑦≤4


⇒ 𝑢(0,1) = 𝑢(0,2) = 𝑢(0,3) = 𝑢(0,4) = 0

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

(ii) 𝑢(4, 𝑦) = 12 + 𝑦 for 0≤𝑦≤4


⇒ 𝑢(4,1) = 13, 𝑢(4,2) = 14 , 𝑢(4,3) = 15 , 𝑢(4,4) = 16

(iii) 𝑢(𝑥, 0) = 3𝑥 for 0≤𝑥≤4


⇒ 𝑢(1,0) = 3 , 𝑢(2,0) = 6 , 𝑢(3,0) = 9 , 𝑢(4,0) = 12
(𝑖𝑣) 𝑢(𝑥, 4) = 𝑥2 for 0≤𝑥≤4

⇒ 𝑢(1,4) = 1 , 𝑢(2,4) = 4 , 𝑢(3,4) = 9 , 𝑢(4,4) = 16

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

Further we compute 𝑢2, 𝑢4, 𝑢6, 𝑢8 by standard 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

𝑢1 = 2.375 𝑢2 = 5.594 𝑢3 = 9.867 𝑢4 = 2.844 𝑢5 =


6.109 𝑢6 = 9.869
𝑢7 = 2.992 𝑢8 = 6.150 𝑢9 = 9.505
SECOND ITERATION

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Thus the required second iterative values corrected to three decimal points
are

𝑢1 = 2.36 𝑢2 = 5.58 𝑢3 = 9.86 𝑢4 = 2.87 𝑢5 = 6.12

𝑢6 = 9.87 𝑢7 = 3 𝑢8 = 6.16 𝑢9 = 9.51

Numerical Solution of the one dimensional heat


equation
1. Find the numerical solution of the parabolic equation when 𝒖(𝟎,
𝒕) =
𝟎 = 𝒖(𝟒, 𝒕) and 𝒖(𝒙, 𝟎) = 𝒙(𝟒 − 𝒙) by taking 𝒉 = 𝟏. Find the
values upto𝒕 =
𝟓.
The standard form of the one dimensional heat equation is 𝑢𝑡 = 𝑐2𝑢𝑥𝑥
and the given
equation is of the form

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

Consider the initial conditions 𝑢(𝑥, 0) = 𝑥(4 − 𝑥)

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

∴ 𝑢1,0 = 𝑢(1,0) = 3 ; 𝑢2,0 = 4 ; 𝑢3,0 = 3

(𝐹𝑖𝑟𝑠𝑡 𝑟𝑜𝑤 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑎𝑏𝑙𝑒 𝑖𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒𝑑)


Consider the relation

Also from (1)

(𝑇ℎ𝑖𝑟𝑑 𝑟𝑜𝑤 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑎𝑏𝑙𝑒 𝑖𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒𝑑)

Also from (1)

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Also from (1)

Also from (1)

Thus the required values of 𝑢𝑖,𝑗 are tabulated

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

2. Solve 𝒖𝒕 = 𝒖𝒙𝒙 subject to the conditions 𝒖(𝟎, 𝒕) = 𝟎, 𝒖(𝟏,


𝒕) = 𝟎 𝒖(𝒙, 𝟎, ) = 𝒔𝒊𝒏(𝝅𝒙) fo r 𝟎 ≤ 𝒕 ≤ 𝟎. 𝟏 by taking 𝒉
= 𝟎. 𝟐 . Write down the following values from the table.
a) 𝒖(𝟎. 𝟐, 𝟎. 𝟎𝟒) b) 𝒖(𝟎. 𝟒, 𝟎. 𝟎𝟖) c) 𝒖(𝟎. 𝟔, 𝟎. 𝟎𝟔)
Comparing the standard form of the heat equation

𝑐2𝑢𝑥𝑥 = 𝑢𝑡 with the given equation 𝑢𝑥𝑥 = 𝑢𝑡 we have 𝑐2 = 1

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

Consider the relation

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

(𝑆𝑒𝑐𝑜𝑛𝑑 𝑟𝑜𝑤 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑎𝑏𝑙𝑒 𝑖𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒𝑑)

Also from (1)

(𝑇ℎ𝑖𝑟𝑑 𝑟𝑜𝑤 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑎𝑏𝑙𝑒 𝑖𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒𝑑)

Also from (1)

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Also from (1)

Also from (1)

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Also from the table,

a) 𝒖(𝟎. 𝟐, 𝟎. 𝟎𝟒) = 𝟎. 𝟑𝟖𝟓 b) 𝒖(𝟎. 𝟒, 𝟎. 𝟎𝟖) = 𝟎. 𝟒𝟎𝟖 c) 𝒖(𝟎. 𝟔, 𝟎.


𝟎𝟔) = 𝟎. 𝟓𝟎𝟒

Numerical solution of the one dimensional wave


equation
We seek numerical solution of the wave equation

𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡

--- (1) subject to the boundary

conditions

𝑢(0, 𝑡) = 0 --- (2)


𝑢(𝑙, 𝑡) = 0 --- (3)
and the initial conditions
𝑢(𝑥, 0) = 𝑓(𝑥) --- (4)

𝑢𝑡(𝑥, 0) = 0 --- (5)


We shall substitute the finite difference approximation for the partial
derivatives present in

Taking , we have

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

𝑐2𝜆2[𝑢𝑖−1,𝑗 − 2𝑢𝑖,𝑗 + 𝑢𝑖+1,𝑗] = [𝑢𝑖,𝑗−1 − 2𝑢𝑖,𝑗 + 𝑢𝑖,𝑗+1]

𝑢𝑖,𝑗+1 = 2(1 − 𝑐2𝜆2)𝑢𝑖,𝑗 + 𝑐2𝜆2(𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗) − 𝑢𝑖,𝑗−1 --- (6)

For convenience let us choose λ such that 1 − 𝑐2𝜆2 = 0.

(6) ⇒ 𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1 --- (7)


This is called the explicit formula for the solution of the wave equation.
Further we express the initial condition

𝑢𝑡(𝑥, 0) = 0

or 𝒖𝒊,𝟏 = 𝒖𝒊,−𝟏 --- (8)

Putting 𝑗 = 0 in (7), we get

𝑢𝑖,1 = 𝑢𝑖−1,0 + 𝑢𝑖+1,0 − 𝑢𝑖,−1

𝑢𝑖,1 = 𝑢𝑖−1,0 + 𝑢𝑖+1,0 − 𝑢𝑖,1 {𝑓𝑟𝑜𝑚 (8)}

𝑢𝑖,1 + 𝑢𝑖,1 = 𝑢𝑖−1,0 + 𝑢𝑖+1,0

2𝑢𝑖,1 = 𝑢𝑖−1,0 + 𝑢𝑖+1,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

• Based on the given step sizes ℎ and 𝑘, we form the rectangular


network of sides ℎ and
𝑘.
• Given ℎ only we can get . The points of division of 𝑥 are

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

, … , 𝑥𝑛 = 𝑥0 + 𝑛ℎ and that of
𝑡 are 𝑡0, 𝑡1 = 𝑡0 + 𝑘 , 𝑡2 = 𝑡0 + 2𝑘 , … , 𝑡𝑛 = 𝑡0 + 𝑛𝑘.

• We instantly write the value of 𝑢𝑖,𝑗 with reference to the conditions


𝑢(0, 𝑡) = 0 and
𝑢(𝑙, 𝑡) = 0 [𝑉𝑎𝑙𝑢𝑒𝑠 𝑎𝑙𝑜𝑛𝑔 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑎𝑛𝑑 𝑙𝑎𝑠𝑡 𝑐𝑜𝑙𝑢𝑚𝑛 𝑎𝑟𝑒 𝑧𝑒𝑟𝑜]
• The values along the first row are obtained by direct computation
using the condition 𝑢(𝑥, 0) = 𝑓(𝑥)
• The values along the second row are obtained by the relation

• Rest of the values area found from the relation


𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1

Note: If the values of both 𝒉 and 𝒌 are small, we


use the below formula

𝑢𝑖,𝑗+1 = 2(1 − 𝑐2𝜆2)𝑢𝑖,𝑗 + 𝑐2𝜆2(𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗) − 𝑢𝑖,𝑗−1 --- (10)

Putting 𝑗 = 0
(10) ⇒ 𝑢𝑖,1 = 2(1 − 𝑐2𝜆2)𝑢𝑖,0 + 𝑐2𝜆2(𝑢𝑖−1,0 + 𝑢𝑖+1,0) − 𝑢𝑖,−1 ---(11)

Further we express the initial condition

𝑢𝑡(𝑥, 0) = 0

or 𝒖𝒊,𝟏 = 𝒖𝒊,−𝟏

(11) ⇒ 𝑢𝑖,1 = 2(1 − 𝑐2𝜆2)𝑢𝑖,0 + 𝑐2𝜆2(𝑢𝑖−1,0 + 𝑢𝑖+1,0) − 𝑢𝑖,1

𝟐𝒖𝒊,𝟏 = 𝟐(𝟏 − 𝒄𝟐𝝀𝟐)𝒖𝒊,𝟎 + 𝒄𝟐𝝀𝟐(𝒖𝒊−𝟏,𝟎 + 𝒖𝒊+𝟏,𝟎)

Putting 𝑗 = 1

(10) ⇒ 𝒖𝒊,𝟐 = 𝟐(𝟏 − 𝒄𝟐𝝀𝟐)𝒖𝒊,𝟏 + 𝒄𝟐𝝀𝟐(𝒖𝒊−𝟏,𝟏 + 𝒖𝒊+𝟏,𝟏) − 𝒖𝒊,𝟎

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Problems

1. Solve the wave equation subject to 𝑢(0, 𝑡) = 0 ,


𝑢(4, 𝑡) = 0, 𝑢𝑡(𝑥, 0) = 0 and 𝑢(𝑥, 0) = 𝑥(4 − 𝑥)

by taking ℎ = 1 , 𝑘 = 0.5 upto four steps.

Sol: Step size of 𝑥 : ℎ = 1 ; Step size of 𝑡 : 𝑘 = 0.5


Since 0 ≤ 𝑥 ≤ 4 , the points of division are 0,1,2,3,4. Since 𝑘 = 0.5 , the
values corresponding to 𝑡 upto four steps are 0,0.5,1,1.5 𝑎𝑛𝑑 2.
We have the following initial table. The values in the first and last column
are zero since

Consider 𝑢(𝑥, 0) = 𝑥(4 − 𝑥)

∴ 𝑢1,0 = 𝑢(1,0) = 3 ; 𝑢2,0 = 𝑢(2,0) = 4 ; 𝑢3,0 = 𝑢(3,0) = 3

To find second row elements

Consider

To find remaining row values we use

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1


Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 + 3 − 3 = 0 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔

𝑖 = 1, 𝑗 = 1} 𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = 2 + 2 − 4 = 0

{𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 1}

𝑢3,2 = 𝑢2,1 + 𝑢4,1 − 𝑢3,0 = 0 + 3 − 3 = 0 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 1}

Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0 + 0 − 2 = −2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 2}

𝑢2,3 = 𝑢1,2 + 𝑢3,2 − 𝑢2,1 = 0 + 0 − 3 = −3 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 2}

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = 0 + 0 − 2 = −2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 2}

Fifth row elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 0 − 3 − 0 = −3 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 3}

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = −2 − 2 − 0 = −4 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 3}

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = −3 + 0 − 0 = −3 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖

= 3, 𝑗 = 3} Thus the required values of 𝑢𝑖,𝑗 are tabulated

2. Solve numerically 𝑢𝑥𝑥 = 0.0625𝑢𝑡𝑡 , subject to the conditions

𝑢(0, 𝑡) = 0 = 𝑢(5, 𝑡) , 𝑢(𝑥, 0) = 𝑥2(𝑥 − 5) and

𝑢𝑡(𝑥, 0) = 0 by taking ℎ = 1 for 0 ≤ 𝑡 ≤ 1.

Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and

hence the given equation can be written as

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

i.e., 16𝑢𝑥𝑥 = 𝑢𝑡𝑡 , where 𝑐2 = 16 or 𝑐 = 4.

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 𝑢(𝑥, 0) = 𝑥2(𝑥 − 5)

∴ 𝑢1,0 = 𝑢(1,0) = −4 ; 𝑢2,0 = 𝑢(2,0) = −12 ; 𝑢3,0 = 𝑢(3,0) = −18 ;

𝑢4,0 = 𝑢(4,0) = −16

To find second row elements

Consider

To find remaining row values we use

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 − 11 + 4 = −7 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 1}

𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = −6 − 14 + 12 = −8 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 1}

𝑢3,2 = 𝑢2,1 + 𝑢4,1 − 𝑢3,0 = −11 − 9 + 18 = −2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 1}

𝑢4,2 = 𝑢3,1 + 𝑢5,1 − 𝑢4,0 = −14 + 0 + 16 = 2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 1}

Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0 − 8 + 6 = −2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 2}

𝑢2,3 = 𝑢1,2 + 𝑢3,2 − 𝑢2,1 = −7 − 2 + 11 = 2 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 2}

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = −8 + 2 + 14 = 8 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 2}

𝑢4,3 = 𝑢3,2 + 𝑢5,2 − 𝑢4,1 = −2 + 0 + 9 = 7 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 2} Fifth row


elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 0 + 2 + 7 = 9 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 3}

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = −2 + 8 + 8 = 14 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 3}

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = 2 + 7 + 2 = 11 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 3}

𝑢4,4 = 𝑢3,3 + 𝑢5,3 − 𝑢4,2 = 8 + 0 − 2 = 6 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 3}

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

hence the given equation can be written as 25𝑢𝑥𝑥 = 𝑢𝑡𝑡 ,

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.

∴ Values of 𝑥 are 0,1,2,3,4,5


Values of 𝑡 are 0,0.2,0.4,0.6,0.8,1
We have the following initial table. The values in the first and last
column are zero since 𝑢(0, 𝑡) = 0 = 𝑢(5, 𝑡)

To find first row elements

We have

∴ 𝑢1,0 = 𝑢(1,0) = 20 ; 𝑢2,0 = 𝑢(2,0) = 15 ; 𝑢3,0 = 𝑢(3,0) = 10 ;

𝑢4,0 = 𝑢(4,0) = 5

To find second row elements

Consider

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

To find remaining row values we use

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1


Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 + 15 − 20 = −5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 1}

𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = 7.5 + 10 − 15 = 2.5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 1}

𝑢3,2 = 𝑢2,1 + 𝑢4,1 − 𝑢3,0 = 15 + 5 − 10 = 10 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 1}

𝑢4,2 = 𝑢3,1 + 𝑢5,1 − 𝑢4,0 = 10 + 0 − 5 = 5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 1}

Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0 + 2.5 − 7.5 = −5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 2}

𝑢2,3 = 𝑢1,2 + 𝑢3,2 − 𝑢2,1 = −5 + 10 − 15 = −10 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 2}

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = 2.5 + 5 − 10 = −2.5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 2}

𝑢4,3 = 𝑢3,2 + 𝑢5,2 - 𝑢4,1 = 10 + 0 − 5 = 5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 2}

Fifth row elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 0 − 10 + 5 = −5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 3}

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = −5 − 2.5 − 2.5 = −10 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 3}

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = −10 + 5 − 10 = −15 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 3}

𝑢4,4 = 𝑢3,3 + 𝑢5,3 − 𝑢4,2 = −2.5 + 0 − 5 = −7.5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 3}

Last row elements

𝑢1,5 = 𝑢0,4 + 𝑢2,4 − 𝑢1,3 = 0 − 10 + 5 = −5 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 4}

𝑢2,5 = 𝑢1,4 + 𝑢3,4 − 𝑢2,3 = −5 − 15 + 10 = −10 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 4}

𝑢3,5 = 𝑢2,4 + 𝑢4,4 − 𝑢3,3 = −10 − 7.5 + 2.5 = −15 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 4}

𝑢4,5 = 𝑢3,4 + 𝑢5,4 − 𝑢4,3 = −15 + 0 − 5 = −20 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 4}

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

4. Solve , at the pivotal points given 𝑢(𝑥, 0) = 0 ;𝑢(0, 𝑡) = 0;

𝑢𝑡(𝑥, 0) = 0 and 𝑢(1, 𝑡) = 100𝑠𝑖𝑛(𝜋𝑡) in the range 0 ≤ 𝑡 ≤ 1 by

taking .

Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and

hence the given equation can be written as 𝑢𝑥𝑥 = 𝑢𝑡𝑡 , where 𝑐2 = 1 or 𝑐 = 1.


1

By data , we have .

The points of division of 𝑥 ( 𝑖𝑛 0 ≤ 𝑥 ≤ 1) as well as .


The condition 𝑢(𝑥, 0) = 0 means that the value of 𝑢 along the first row are zero and
𝑢(0, 𝑡) = 0 means that the value of 𝑢 along the first column are zero. The initial table
showing the values given and the values to be computed as below

We have seen the condition 𝑢𝑡(𝑥, 0) = 0 will lead us the formula

To find second row elements

Consider

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

and we do not have 𝑢5,0 on hand.

Hence
To find remaining row values we use

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1


Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 1, 𝑗 = 1}

𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = 0 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 2, 𝑗 = 1}

𝑢3,2 = 𝑢2,1 + 𝑢4,1 − 𝑢3,0 = 70.7 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 3, 𝑗 = 1}

𝑢4,2 = 𝑢3,1 + 𝑢5,1 − 𝑢4,0 {𝐵𝑦 𝑡𝑎𝑘𝑖𝑛𝑔 𝑖 = 4, 𝑗 = 1} is in applicable.

Hence .
Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0


𝑢2,3 𝑢1,2 𝑢3,2 𝑢2,1 70.7

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = 100

.
Last row elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 70.7

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = 100

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = 70.7

𝑢4,4 = 𝑢(𝑥4, 𝑡4) = 𝑢(1,1) = 100𝑠𝑖𝑛(𝜋) = 0

Thus the required values of 𝑢𝑖,𝑗 are tabulated

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

5. Solve the wave equation , given 𝑢(𝑥, 0) = 𝑢(5, 𝑡) = 0,


.
Find 𝑢 at 𝑡 = 2
given ℎ = 1, 𝑘 = 0.5.

Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and hence

the given equation can be written as 4𝑢𝑥𝑥 = 𝑢𝑡𝑡

Here

Since ℎ = 1 , we have
Step size of 𝑥: ℎ = 1 where 0 ≤ 𝑥 ≤ 5
Step size of 𝑡: 𝑘 = 0.5 where 0 ≤ 𝑡 ≤ 2 as required.

∴ Values of 𝑥 are 0,1,2,3,4,5


Values of 𝑡 are 0,0.5,1,1.5,2
We have the following initial table. The values in the first and last column are zero since

Consider 𝑢(𝑥, 0) = 𝑥(5 − 𝑥)

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

∴ 𝑢1,0 = 𝑢(1,0) = 4 ; 𝑢2,0 = 𝑢(2,0) = 6 ; 𝑢3,0 = 𝑢(3,0) = 6 ;

𝑢4,0 = 𝑢(4,0) = 4

To find second row elements

Consider

To find remaining row values we use

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1


Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 + 5 − 4 = 1

𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = 3 + 5 − 6 = 2 𝑢3,2 =

𝑢2,1 + 𝑢4,1 − 𝑢3,0 = 5 + 3 − 6 = 2

𝑢4,2 = 𝑢3,1 + 𝑢5,1 − 𝑢4,0 = 5 + 0 − 4 = 1

Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0 + 2 − 3 = −1

𝑢2,3 = 𝑢1,2 + 𝑢3,2 − 𝑢2,1 = 1 + 2 − 5 = −2

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = 2 + 1 − 5 = −2

𝑢4,3 𝑢3,2 𝑢5,2 𝑢4,1 2 + 0 − 3 = −1

Fifth row elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 0 − 2 − 1 = −3

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = −1 − 2 − 2 = −5

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = −2 − 1 − 2 = −5

𝑢4,4 = 𝑢3,3 + 𝑢5,3 − 𝑢4,2 = −2 + 0 − 1 = −3

Thus the required values of 𝑡 = 2 are −3, −5, −5, −3.

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

6. Solve , subject to the boundary conditions,


𝑢(0, 𝑡) = 0 = 𝑢(1, 𝑡); 𝑡 ≥ 0 and the initial conditions,

by taking

taking and . Carryout second level solutions in the


time scale.

Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and

hence the given equation can be written as 𝑢𝑥𝑥 = 𝑢𝑡𝑡 , where

𝑐2 = 1 or 𝑐 = 1.

By data , we have .

The points of division of 𝑥 ( 𝑖𝑛 0 < 𝑥 < 1 ) and .


We have the following initial table. The values in the first and last column are zero since
𝑢(0, 𝑡) = 0 = 𝑢(1, 𝑡).

Since both 𝒉 and 𝒌 are small, we use the below formula


1

Now,
16

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

To find second row elements

Consider 𝟐𝒖𝒊,𝟏 = 𝟐(𝟏 − 𝒄𝟐𝝀𝟐)𝒖𝒊,𝟎 + 𝒄𝟐𝝀𝟐(𝒖𝒊−𝟏,𝟎 + 𝒖𝒊+𝟏,𝟎)

To find third row elements

Consider 𝒖𝒊,𝟐 = 𝟐(𝟏 − 𝒄𝟐𝝀𝟐)𝒖𝒊,𝟏 + 𝒄𝟐𝝀𝟐(𝒖𝒊−𝟏,𝟏 + 𝒖𝒊+𝟏,𝟏) − 𝒖𝒊,𝟎

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

7.Solve with the boundary conditions 𝑢(𝑥, 0) = 0 = 𝑢(1, 𝑡),

𝑡 ≥ 0 and initial conditions


taking ℎ = 𝑘 = 0.2 at 𝑡 = 1.

Sol: The wave equation in the standard form is 𝑐2𝑢𝑥𝑥 = 𝑢𝑡𝑡 and hence

the given equation can be written as 𝑢𝑥𝑥 = 𝑢𝑡𝑡

Here
Step size of 𝑥: ℎ = 0.2 where 0 < 𝑥 < 1
Step size of 𝑡: 𝑘 = 0.2 where 𝑡 = 1 as required.

∴ Values of 𝑥 and 𝑡 are 0,0.2,0.4,0.6,0.8,1 The


values in the first and last column are zero since

𝑢(0, 𝑡) = 0 = 𝑢(1, 𝑡).

𝑢0,0 = 0 = 𝑢0,1 = 𝑢0,2 = 𝑢0,3 = 𝑢0,4 = 𝑢0,5

𝑢5,0 = 0 = 𝑢5,1 = 𝑢5,2 = 𝑢5,3 = 𝑢5,4 = 𝑢5,5


To find first row elements
Consider 𝑢(𝑥, 0) = 𝑠𝑖𝑛𝜋𝑥

.
To find second row elements

Consider

To find remaining row values we use

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

𝑢𝑖,𝑗+1 = 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 − 𝑢𝑖,𝑗−1


Third row elements

𝑢1,2 = 𝑢0,1 + 𝑢2,1 − 𝑢1,0 = 0 + 0.7695 − 0.5878 = 0.1817

𝑢2,2 = 𝑢1,1 + 𝑢3,1 − 𝑢2,0 = 0.4755 + 0.7695 − 0.9511 = 0.2939 𝑢3,2 =

𝑢2,1 + 𝑢4,1 − 𝑢3,0 = 0.7695 + 0.4755 − 0.9511 = 0.2939

𝑢4,2 = 𝑢3,1 + 𝑢5,1 − 𝑢4,0 = 0.7695 − 0.5878 = 0.1817

Fourth row elements

𝑢1,3 = 𝑢0,2 + 𝑢2,2 − 𝑢1,1 = 0 + 0.2939 − 0.4755 = −0.1816

𝑢2,3 = 𝑢1,2 + 𝑢3,2 − 𝑢2,1 = 0.1817 + 0.2939 − 0.7695 = −0.2939

𝑢3,3 = 𝑢2,2 + 𝑢4,2 − 𝑢3,1 = 0.2939 + 0.1817 − 0.7695 = −0.2939

𝑢4,3 = 𝑢3,2 + 𝑢5,2 − 𝑢4,1 = 0.2939 + 0 − 0.4755 = −0.1816

Fifth row elements

𝑢1,4 = 𝑢0,3 + 𝑢2,3 − 𝑢1,2 = 0 − 0.2939 − 0.1817 = −0.4756

𝑢2,4 = 𝑢1,3 + 𝑢3,3 − 𝑢2,2 = −0.1816 − 0.2938 − 0.2939 = −0.7693

𝑢3,4 = 𝑢2,3 + 𝑢4,3 − 𝑢3,2 = −0.2938 − 0.1816 − 0.2939 = −0.7693

𝑢4,4 = 𝑢3,3 + 𝑢5,3 − 𝑢4,2 = −0.2939 + 0 − 0.1817 = −0.4756

Last row elements

𝑢1,5 = 𝑢0,4 + 𝑢2,4 − 𝑢1,3 = 0 − 0.7693 + 0.1816 = −0.5877

𝑢2,5 = 𝑢1,4 + 𝑢3,4 − 𝑢2,3 = −0.4756 − 0.7693 + 0.2938 = −0.9511

𝑢3,5 = 𝑢2,4 + 𝑢4,4 − 𝑢3,3 = −0.7693 − 0.4756 + 0.2938 = −0.9511

𝑢4,5 = 𝑢3,4 + 𝑢5,4 − 𝑢4,3 = −0.7693 + 0 + 0.1816 = −0.5877

Thus the required values of 𝑡 = 1 are −0.5877, −0.9511, −0.9511,


−0.5877.

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Solution of Poisson’s Equation

Its method of solution is similar to that of the Laplace equation. Here the standard five-
point formula for (1) takes the form

𝒖𝒊−𝟏,𝒋 + 𝒖𝒊+𝟏,𝒋 + 𝒖𝒊,𝒋+𝟏 + 𝒖𝒊,𝒋−𝟏 − 𝟒𝒖𝒊,𝒋 = 𝒉𝟐𝒇(𝒊𝒉, 𝒋𝒉) … … . . (𝟐)


By applying (2) at each interior mesh point, we arrive at linear equations in the nodal
values ui, j. These equations can be solved by the Gauss-Seidal method.

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

The standard five-point formula for the given equation is

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

For 𝑢1 (𝑖 = 1, 𝑗 = 2) , (𝑖)gives 0 + 𝑢2 + 𝑢3 + 100 – 4𝑢1 = – 2


𝑖. 𝑒., – 4𝑢1 + 𝑢2 + 𝑢3 = – 102 (𝑖𝑖)

For 𝑢2 (𝑖 = 2, 𝑗 = 2), (𝑖)gives 𝑢1 + 100 + 𝑢4 + 100 – 4𝑢2 = – 4


𝑖. 𝑒. , 𝑢1 – 4𝑢2 + 𝑢4 = – 204 (𝑖𝑖𝑖)

For 𝑢3 (𝑖 = 1, 𝑗 = 1), (𝑖)gives 0 + 𝑢4 + 0 + 𝑢1 – 4𝑢3 = – 1

𝑖. 𝑒. , 𝑢1 – 4𝑢3 + 𝑢4 = – 1 (𝑖𝑣)

For 𝑢4 (𝑖 = 2, 𝑗 = 1) ), (i)gives 𝑢3 + 100 + 𝑢2 – 4𝑢4 =– 2

𝑖. 𝑒. , 𝑢2 + 𝑢3 – 4𝑢4 =– 102 (𝑣)

Subtracting (𝑣)from (𝑖𝑖), – 4𝑢1 + 4𝑢4 = 0,


𝑖. 𝑒. , 𝑢1 = 𝑢4
Then (𝑖𝑖𝑖)becomes 2𝑢1 – 4𝑢2 = – 204 (𝑣𝑖) and

(𝑖𝑣)becomes 2𝑢1 – 4𝑢3 = – 1 (𝑣𝑖𝑖)


Now (4) × (𝑖𝑖) + (𝑣𝑖) gives − 14𝑢1 + 4𝑢3 = – 612 (𝑣𝑖𝑖𝑖)

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

ui−1,j+ui+1,j+ui,j+1+ui,j−1−4ui,j=−10(𝑥2+𝑦2+ 10) (𝑖)

Equations (ii) and (v) show that u4 = u1. Thus the above equations reduce to

Now let us solve these equations by the Gauss-Seidal iteration method.


First iteration: Starting from the approximations u2 = 0, u3 = 0, we obtain

𝑢1(1) = 37.5

Second iteration:

𝑢1(2) = (64 + 49 + 150) ≈ 66

www.vtuupdates.com
Numerical Solution of Partial Differential Equations VTU Updates

Third iteration:

𝑢1(3) = (78 + 63 + 150) ≈ 73

Fourth iteration:

𝑢1(4) = (82 + 67 + 150) ≈ 75

Fifth iteration:

𝑢1(5) = (82.5 + 67.5 + 150) ≈ 75

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

You might also like