10

Boundary Value Problems in Ordinary and Partial Differential Equation

10.0 INTRODUCTION

The areas of applications of partial differential equations is too large compared to ordinary differential equations. Partial differential equations occur especially in problems involving wave phenomena and heat conduction. In practical problems we seek to obtain unique solution of ordinary and partial differential equations subject to certain specific conditions which are called boundary value conditions. The differential equation with boundary value conditions is called a boundary-value problem.

For a differential equation when conditions are prescribed at the same point, we call them as initial conditions. When conditions are prescribed at different points, we call them as boundary conditions. The initial conditions and boundary conditions together are known as boundary-value conditions.

For example: For the one-dimensional wave-equation Eqn1 the conditions Eqn2 and Eqn3 which are prescribed at different points are called boundary conditions.

But the conditions Eqn4, which are prescribed at the same point are initial conditions.

All the four conditions Eqn5, Eqn6, Eqn7 Eqn8 together are called boundary-value conditions.

The partial differential equation with these four conditions is called a boundary-value problem.

Certain types of boundary value problems can be solved by replacing the derivatives or partial derivations by approximate differences and thus reducing them to a difference equation. Thereby the given boundary value problem is converted to a system of linear equations which are solved by iteration methods.

10.1 FINITE DIFFERENCE METHODS FOR SOLUTION OF SECOND ORDER ORDINARY DIFFERENTIAL EQUATIONS

Consider the boundary value problem Eqn9 with the boundary conditions Eqn10, Eqn11. We divide the interval Eqn12 into n equal subintervals of width h, by the points Eqn13 where Eqn14

Let Eqn15 be the corresponding values of y. In this method, the derivatives in the differential equations are replaced by their finite difference approximations, namely,

Eqn16

Substituting these values in the given differential equation we get a difference equation, which can be solved using the boundary conditions.

Note: (1) is called forward difference approximation, where as (2) is a central difference approximation for yi′ and (3) is called central difference approximation for yi″.

WORKED EXAMPLES

Example 1

Using the finite difference method, find y(0.25), y(0.5) and y(0.75) satisfying the differential equation Eqn17 subject to the boundary conditions Eqn18

Solution

Given Eqn19

Here Eqn20

We know Eqn21

C10U015

Eqn22(1)

Given Eqn23

If i = 1, then (1)

Eqn24(2)

If i = 2, then (1)

Eqn25(3)

If i = 3, then (1)

Eqn26(4)

Solve (2), (3), (4) to find y1, y2, y3

Eqn27(5)

Eqn27A

Eqn27B

Substituting in (3), Eqn27C

Thus, Eqn28

Note: The equations (2), (3), (4) could be solved by Gauss elimination method.

Example 2

Solve the equation Eqn29 with the boundary conditions Eqn30

Solution

Given Eqn31

Eqn32

C10U016

We shall divide the interval (0, 1) into 4 equal parts

Eqn33

We know Eqn34

∴ the equation becomes

Eqn35

Eqn36

Eqn37

Eqn38

The equations are Eqn38A(1)

Eqn38B(2)

Eqn38C(3)

We use Gauss elimination method to find y1, y2 and y3

Eqn39(4)

Eqn39A(6)

Eqn39B

Eqn39C

Example 3

Solve xy + y = 0, y (1) = 1, y (2) = 2 with Eqn41 by using finite difference method.

Solution

Given Eqn42

Eqn43 and Eqn44

Since Eqn45

C10U017

Eqn46

We know

Eqn47

∴ the equation becomes

Eqn49, i = 1, 2, 3

Eqn49.b eps Eqn49A

Eqn49B Eqn49AA

Eqn49C Eqn49AAA

∴ the equations are

Eqn50(1)

Eqn50A(2)

Eqn50B(3)

Eqn50C(4)

Eqn50D(5)

Adding, Eqn50EAEqn50E(6)

 

Subracting,

669

From(5), Eqn671

From(6), Eqn672

Thus

Eqn52

Exercises 10.1

  1. Solve the boundary value problem for Eqn53 by finite difference method Eqn54
  2. Solve by finite difference method:
  3. Eqn56 by taking Eqn57
  4. Using finite difference method, solve the differential equation Eqn58 Eqn58awith Eqn59
  5. Solve the equation Eqn60, with Eqn61 taking Eqn62 using finite difference method.
  6. Solve Eqn63, given Eqn64 taking Eqn65, using finite difference method.
  7. Solve the equation Eqn66 and Eqn67 using finite difference method.

Answers 10.1

(1)Take n = 4, y(0.5) = 0.1403 (2) 0.062, 0.250, 0.562 (3) –0.5556, –0.8889, –1

(5) 0.1389 (5) y(0,5) = 0.4706 (6) 0.2, 0.4, 0.6, 0.8

10.2 NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS

We have seen numerical solution of second order ordinary differential equations by replacing the derivatives by the approximate differences. Similarly partial differential equations are also solved numerically by finite difference method. The partial derivatives appearing in the equation and the boundary conditions are replaced by their finite difference approximations. Thereby the given equation is converted into a system of a linear equations which are solved by iteration methods.

10.2.1 Classifications of Second Order Partial Differential Equations

Let u be a function of two independent variables x and y. Consider the partial differential equation of u of the form

Eqn69(1)

where A, B, C are functions of x and y or constants.

The second degree terms are linear whereas the part Eqn70 may be non-linear. So the equation (1) is called a second order quasi-linear equation. Incase Eqn71 is linear then (1) is called a second order linear equation.

At a point (x, y) in the xy-plane, the equation (1) is

  1. elliptic if Eqn72
  2. Parabolic if Eqn73
  3. Hyperbolic if Eqn74

Note:

  1. If at all points of a region R if Eqn75, then the equation is elliptic or parabolic or hyperbolic in R.
  2. It is quite possible an equation elliptic in one region may be parabolic in another region and hyperbolic in yet another region.

WORKED EXAMPLES

Example 1

Test the nature of (i) Eqn76

(ii) Eqn77

(iii) Eqn78

(iv) Eqn79

Solution

(i) Given Eqn80

HereEqn81

Eqn82

So, the equation is elliptic if Eqn83 ie. at all points on the right side of y-axis satisfying the equation. The equation is hyperbolic if Eqn84 ie. at all points on the left side of y-axis satisfying the equation and parabolic if Eqn85 ie at all points of y-axis satisfying the equation.

(ii) Given Eqn86

Here Eqn87

Eqn675

Eqn676eps

So, the equation is hyperbolic in the Eqn89 and Eqn90 quadrants, elliptic in the Eqn91 and Eqn92 quadrants and parabolic at all points in the x-axis and y -axis which satisfy the equation.

(iii) Given Eqn93

Here Eqn94

Eqn95

∴ the equation is hyperbolic for all (x, y) satisfying the equation

(iv) Given Eqn96

Here Eqn97

Eqn98

If Eqn99 then Eqn100 (as Eqn101 for all Eqn102)

Eqn109a Eqn103 or Eqn104 for all Eqn102

∴ the equation is hyperbolic if Eqn106 or Eqn107 and for all Eqn102

If Eqn669 (as x2 > 0 ∴ x ≠ 0)

Eqn109a Eqn109

∴ the equation is elliptic if Eqn110 andEqn102

If Eqn112 then Eqn113 or Eqn114

∴ the equation is parabolic if Eqn115

ie. on the y-axis or on the line Eqn116 or Eqn117

Depending on the nature of the equations, methods of solving will differ.

Some well known equations, we consider for numerical solution are the following:

  1. Eqn118 is Laplace’s equation

    ie. two dimensional heat equation in steady-state. It is elliptic type.

  2. Eqn118Poisson’s equation.

    It is elliptic type

  3. Eqn120 one dimensional wave equation.

    It is hyperbolic type

  4. Eqn121 one dimensional heat equation.

    It is parabolic type.

10.2.2 Finite Difference Approximations to Partial Derivatives

Consider a rectangular region in the xy-plane with sides parallel to the axes.

Divide this region into a network of rectangles of sides h and k units by drawing lines Eqn122 Eqn123, Eqn124, 1, 2, 3, ... The points of intersection of these family of lines are called mesh points or lattice points or grid points.

The point of intersection of Eqn125 Eqn126 is called the grid point Eqn127

If u is a function of two independent variables x and y then the value of Eqn128 at the grid point Eqn129 is denoted by Eqn130. Thus Eqn131

Consider Eqn132, where x is a variable and Eqn133 is fixed then Eqn134 is single variable function.

The Taylor’s series expansion of it in the neighbourhood of Eqn135 is

Eqn136

Put Eqn137, then

Eqn138

If h is small, we approximate as

Eqn139(1)

Replacing h by −h in (1), we get

(1) ∴ Eqn140(2)

Eqn141

This is called the forward difference approximation for Eqn142

(2) ∴Eqn143

This is called the backward difference approximation for Eqn144

(1) − (2) ∴Eqn677

Eqn145

This is called the central difference approximation to Eqn146.

The central difference approximation is better than the forward and backward difference approximations.

In the same way the approximation for 2nd derivative is

Eqn147

Using backward difference approximations for Eqn148 and Eqn149 we get

Eqn150

and Eqn151

Eqn152a Eqn152

In the same way, the first and second partial derivatives w.r.to y can be obtained.

The forward difference approximation is

Eqn153

The backward difference approximation is

Eqn154

The central difference approximation is

Eqn155

and Eqn156

Since Eqn157, the above formulae can be written as

Eqn678 – forward difference

Eqn679 – backward difference

Eqn681 – central difference

Eqn682 – forward difference

Eqn683 – backward difference

Eqn684 – central difference

Eqn685

Eqn686

10.2.3 Solution of Laplace Equation Eqn159

Given the equation Eqn160, the solution Eqn161 is satisfied by every point in a region subject to certain boundary conditions. Consider a rectangular region R for which Eqn162 is known at the boundary. For simplicity, take R to be a square region and divide it into small square regions of side h.

Replacing Eqn163 and Eqn164 by differences

C10F001

Eqn165

the equation becomes

Eqn687

Eqn166(1)

This shows that the value of u at any interior mesh point is the average value of the four adjacent mesh points on the lines through Eqn167

C10F002

ie. the average of the mesh point values above, below, left and right of Eqn168

The formula (1) is called the standard five point formula (SFPF)

We know that Laplace equation remains invariant when the coordinate axes are rotated through Eqn169. So we can also use the following formula.

Eqn170(2)

This shows that the value of Eqn171 is the average of the values of the four mesh points through the diagonals of Eqn172.

C10F003

Figure 10.3

The formula (2) is called the diagonal five point formula (DFPF) as in Fig 10.3.

Now to find the initial values of u at the interior mesh points, we first find Eqn173 at the centre of the square by taking the mean of the 4 boundary values at the ends of the horizontal and vertical through Eqn174.

Eqn152a Eqn175

Next we compute the initial values of the centers of the large squares with Eqn176 as a corner.

ie. we find Eqn177 by DFPF

Eqn178

The values at the remaining four mesh points Eqn179 are got by using SFPF

Thus, we have

Eqn180

Having got all the values of Eqn181, the accuracy of these values are improved by any one of the following iteration methods.

1. Gauss Jacobi method:

If Eqn182 be the Eqn183 iterative value of Eqn184, then an iterative procedure to SFPF is given by

Eqn185

2. Gauss-Seidel method

The iterative formula for SFPF is given by

Eqn186

Here we use the latest available iterative values and hence the rate of convergence will be faster by this method. Infact, it is nearly twice faster than Jacobi method.

The application of Gauss-Seidel iteration to solve boundary value problems was due to Liebmann. So this method is known as Liebmann’s method.

Note: It can be proved that the error in the diagonal formula is four times than in the standard formula. So, as far as possible we use the standard five point formula.

WORKED EXAMPLES

Example 1

Determine by iteration method the values at the interior lattice points of a square region of the harmonic function u whose boundary values are given as shown in the figure below

C10U001

Solution

Since u is harmonic, it satisfies Laplace equation

Eqn187

Let u1, u2, u3, … , u9 be the values of u at the interior points.

We find the initial values of u1, u2, …, u9.

Then by iteration improve these values.

Eqn188

We now start the iteration to improve these values. We start with u1 and proceed along horizontal.

Liebmann’s iteration formula is

Eqn189

I Iteration: SFPF

Eqn190a

Eqn190

II Iteration:

Eqn191

III Iteration:

Eqn693

Eqn192

We notice that II and III iteration values are almost same

Eqn193

Remark: We have worked out elaborately. We can find the values of u’s at each grid point indicating the values at the point itself as in the table schematically.

Using the latest available values.

C10U002

Example 2

Given the values of u(x, y) on the boundary of the square in the figure, evaluate the function u(x, y) satisfying the Laplace equation — 2u=0 at the pivotal points of the figure by Gauss-Seidel method.

C10U003

Solution

C10U004

To get the initial values of u1, u1, u3, u4 we can not use either SFPF or DFPF to find any values. So we shall assume u4 = 0 as the initial value.

Then

Eqn195

I Iteration:

Eqn196

II Iteration:

Eqn197

III Iteration:

Eqn198

IV Iteration:

Eqn199

V Iteration:

Eqn200

We take u1 = 1208, u2 = 792, u3 = 1042, u4 = 458

Example 3

By iteration method, solve the elliptic equation Eqn201 over a square region of side 4, satisfying the boundary conditions

Eqn202 Eqn202a

By dividing the square into 16 square mashes of side 1 and always correcting the computed values to two places of decimals, obtain the values of u at 9 interior pivotal points.

Solution

Given equation is Eqn203

The boundary condition Eqn204 gives all boundary values zero on y-axis.

Eqn205, Eqn207a means on x-axis the values are 0, 3, 6, 9, 12

Eqn206, Eqn207a gives the values on x = 4 as 12, 13, 14, 15, 16.

Eqn207, Eqn207a means on y = 4 the boundary values are 0, 1, 4, 9, 16.

C10U005

Let us take the 9 interior grid points as u1, u2, u3, …, u9

First we have to find the initial values.

Eqn208

The other four values u2, u4, u6, u8 can be found by SFPF

Eqn209

I Iteration:

Eqn210

II Iteration:

Eqn211

Eqn212

III Iteration:

Eqn213

Eqn214

From the II and III iterations we can take the values of u correct to 2 places as

Eqn215

10.2.4 Poisson Equation

An equation of the form Eqn216 is called Poisson’s equation.(1)

Proceeding as in Laplace equations we get the standard five point formula for poisson equation as

Eqn217(2)

By applying (2) at each interior mesh point, we obtain a system of linear equations in the Pivotal values i.j.

We solve by Gauss-Siedel method

method Eqn218

WORKED EXAMPLES

Example 4

Solve the Poisson equation

2u = -10(x2 + y2 + 10), 0 ≤ x ≤ 3, 0 ≤ y ≤ 3, u = 0

on the boundary.

Solution

Given

Solve the Poisson equation

Eqn220

The region is a square bounded by x = 0, x = 3, y = 0, y = 3

Divide it into a square mesh with side h = 1.

Let u1, u2, u3, u4 be the values of u at the interior mesh points A, B, C, D

Eqn221a

Eqn109a

C10U006

Eqn222 (1)

Eqn224(2)

Eqn224a(3)

Eqn224b(4)

Eqn224c(5)

Eqn224d(2)′

Eqn224e(3)′

Eqn224f(4)′

Eqn224g(5)′

C10U015

Note: In the above problem Eqn227which is symmetric in x and y. That is when x and y are interchanged the equation is not changed. So the function is symmetric about the line y = x. So the solution is symmetric about y = x.

The boundary conditions are also symmetric

Eqn228

This is the reason we got u1 = u4

This observation will be helpful in solving, when the number of mesh points are more in a square.

Example 5

Solve Eqn229.png in the square mesh given u = 0 on the four boundaries dividing the square into 16 subsquares of length 1 unit.

Solution

Given Eqn230

Here h = 1

Let Eqn231 be the values of u at the interior grid points.

Choose u5 as origin and the x, y axes along the lines u5 u6 and u5 u2

C10U007

Since the equation is symmetric in x and y and the boundary values are same when x and y are interchanged.

The values of u at the mesh points symmetric about y = x and about the axes will be the same

Eqn232

Hence we have to find only u1, u2, u5

The difference equation given by the SFPF for poisons equation is

Eqn233(1)

Eqn152a Eqn234(2)

Eqn234a(3)

Eqn234b

Eqn235(4)

Eqn235a

Eqn235b

Example 6

Solve the poisson equation Eqn236 Given that Eqn236a

Solution

Given Eqn237

The equation is symmetric about x and y.

When x and y are interchanged it is unaffected and so symmetric about y = x.

The boundary conditions are also symmetric about y = x.

Let u1, u2, u3, u4 be the values of u at the mesh points.

C10U008

Eqn238

The difference equation by SFPF is

Eqn239(1)

Eqn239b

Now

Eqn239c(1)

Eqn239d(2)

Eqn239e(3)

Substitute for u4 in (1) we get

Eqn239f(4)

Eqn239g(5)

Eqn240

10.3 ONE DIMENSIONAL HEAT EQUATION

The one dimensional heat equation is Eqn241

(where c is the specific heat of the material, r is the density and k is the thermal conductivity).

It is a parabolic equation.

Eqn242

Eqn242a(1)

We shall see two methods to solve for u(x, t) subject to the boundary conditions.

Eqn243(2)

Eqn243a(3)

the initial conditions u(x, 0) = f(x), 0 < x < l(4)

10.3.1 Schmidt’s Method [Explicit Method]

Consider a rectangular mesh in the x-t plane with side lengths h in the x-direction and k in the t-direction. Let us denote the mesh point (x, y) = (ih, jk) as simply i, j.

Then we have the approximate relations of differences

Eqn244

Substituting in the equations (1), we get

Eqn245

Eqn246

whereEqn247 is the mesh ratio parameter.

Eqn248(5)

The boundary conditions can be written as

Eqn249

and the initial condition can be written as

ux,0 = f(ih), i = 1,2,3,...

We choose the time interval k in such a way that the coefficient of ui,j in (5) is zero.

Eqn250

Then the equation becomes

Eqn251(6)

This equation is called the Bender-Schmidt recurrence equation.

Note:

  1. The equation (6) gives the value of u at the (i, j + 1)th interior mesh point as the average of the values of u at the surrounding points xi + 1 and x i − 1 at previous time tj
    C10U009
  2. Schmidt method is called the explicit method because each subsequent computation u at t = tj + 1 is explicitly given from the previous u-value at t = tj
  3. Bender-Schmidt method is valid only for Eqn252. To obtain more accurate results h should be small and hence k should be very small. This makes the computation pretty long because many time-intervals would be required to cover the prescribed region. The solution will become unstable if λ exceeds Eqn253. The reason for this in the explicit method is the difference in orders of the finite-difference approximations for the spatial derivative Eqn254 and the time derivative Eqn255.

The next method, proposed by Crank and Nicolson in 1947 is a technique that makes these finite difference approximations of the same order. This method does not restrict λ and also reduces the amount of computations.

10.3.2 Crank-Nicolson Method [Implicit Method]

One dimensional heat equations is Eqn256(1)

where Eqn257 with boundary conditions Eqn258 and the initial condition Eqn259

In this method Eqn260 is replaced by the average of its central-difference approximations on the jth and (j + 1)th time rows.

Eqn261

and Eqn262

∴ the equation (1) becomes

Eqn263

Put Eqn264

Eqn265(2)

This is called the Crank-Nicolson difference formula

Note:

  • The left hand side of the formula contains three unknown values of u at the (j + 1)th time level while all the three values on the right hand side are known values of u at the jth level.
  • Hence Crank-Nicolson formula is called a 2-level implicit relation because it does not give the value of u at t = tj + 1 directly in terms of u at t = tj
  • To simplify the scheme, we choose k such that l = 1 Eqn266
  • The Crank-Nicolson formula becomes

Eqn267(3)

If there are n internal mesh points on each row then the formula (2) gives a system of n simultaneous equations for the n unknown values in terms of the known boundary values. These equations can be soled by Gauss Seidel method. Similarly the values at the other internal mesh points on each row can be found.

WORKED EXAMPLES

Example 1

Solve Eqn268 and Eqn269.png and, choosing h = k = 1 and using Bender-Schmidt formula find the values upto t = 5.

Solution

Eqn270

We have to choose Eqn271

Bender-Schmidt recurrence formula for Eqn272 is

Eqn273Eqn273a(1)

x varies from 0 to 4 ∴ i = 0, 1, 2, 3, 4, j ≥ 0

The boundary value conditions become

Eqn274

We shall tabulate the meshpoint values of u

If j = 0, then Eqn275

If i = 1, then Eqn276

If i = 2, then Eqn277

If i = 3, then Eqn278

Similarly for j = 1, 2, 3, 4, 5. The values can be found and they are tabulated.

Now we shall tabulate the mesh point value of u

new2

Example 2

Find the values of the function u(x, t) satisfying the differential equation Eqn279.pngand the boundary conditions

u(0, t) = 0 = u(8, t) and Eqn280 at the points x = i, i = 0, 1, 2, 3, 4,...8 and Eqn281 j = 0, 1, 2, 3, 4, 5.

Solution

Given

Eqn282

Eqn283

Given i = 0, 1, 2, …, 8 and j = 0, 1, 2, 3, 4, 5

Eqn284, So, Eqn285

Bender-Schmidt recurrence formula for Eqn286 is

Eqn287

The boundary conditions are Eqn288

and Eqn289

For i = 0, 1, 2, …, 8, we get Eqn290

Eqn291

These are the entries in the first row. Similarly we can find the other rows mesh points.

Now we shall tabulate the mesh point values of u

new2

Example 3

Solve Eqn292.png and u(x, 0) = 4(4 - x) choosing h = k = 1 using Bender-schmidt formula.

Solution

Given Eqn293

Here a =1 ∴ a2 = 1 Eqn294

The Bender-Schmidt formula for Eqn295 is

Eqn296

Since l = 1, the equation becomes

Eqn297(1)

Now x = ih = i, y = jk = j, Eqn298 Eqn299

new2

which are the first row mesh points. Similarly the other rows mesh points are computed.

Now we shall tabulate the mesh point values of u

new2

Example 4

Solve Eqn305.png with u(x, 0) = x (1 − x), 0 < x < 1,

u(0, t) = u(1, t) = 0 Eqn306 t > 0. Using explicit method with Eqn307 for 3 time steps.

Solution

Given Eqn308

Here Eqn309

Here k is not given. We shall choose k such that Eqn310

But Eqn311

Eqn312

Then Bender-Schmidt formula is

Eqn313

The boundary condition are Eqn314

Eqn315

Eqn316

Eqn317

These values are the first row mesh points.

For 3 time steps the mesh point values are given in the table

new2

Example 5

Solve the equation Eqn318 with the conditions u(0, t) = 0, u(4, t) = 8 and Eqn318.pngwith the conditions u(0, t) = 0, u(4, t) = 8 and Eqn319, taking Eqn320 and Eqn321 upto 5 time units.

Solution

Given Eqn322

Eqn323a

Since Eqn325 we have to use the general Schmidt’s formula

Eqn326

Eqn327 Eqn328

Eqn329

Eqn330

The boundary value conditions are u(0, t) = 0 ∴ u0,j = 0 Eqn306 j = 0, 1, 2, 3, 4, 5

When x = 4, t = 8, Eqn331

Eqn332

new2

Now we shall tabulate the mesh point value of u

new2

Example 6

Using Crank-Nicolson’s implicit scheme, solve 16 ut = uxx, 0 < x < 1, t > 0, given that u(x, 0) = 0, u(0, t) = 0, u(1, t) = 100t, compute u for one-time step.

Solution

Given uxx = 16 ut

Here Eqn333

Here (0, 1) is divided, choose Eqn334.

Choose k such that Eqn335

Since l = 1, we use the simplified form of Crank-Nicolson formula

Eqn336

Boundary value conditions are

Eqn337

Eqn337a

We have to compute the values of u for only one time step.

Put j = 0, i = 0, 1, 2, 3, 4.

Eqn338

new2

Substituting for u1 and u3 in (2), we get

Eqn109a Eqn339

Eqn347a

Example 7

Solve Eqn340 given that u(x, 0) = 20, u(0, t) = 0, u(5, t) = 100. Compute u for one time step with h=1 by Crank-Nicolson method.

Solution

Given Eqn341

Here Eqn342

k is not given, so choose k such that l = 1 Eqn343

Since l = 1, the simplified Crank-Nicolson formula is used to compute only one time step.

Eqn344(1)

where x = i h = i, t = k j = j

Eqn345

On the line x = 0, u = 0 for all t. That is for all j

new2

Using formula (1)

Eqn347

Substituting (5) in (4),

Eqn348(6)

Substituting (2) in (3),

Eqn349 (7)

Eqn350

Eqn351

Eqn351a

Example 8

Solve Eqn352 subject to the conditions u(x, 0) = sin p x, 0x1 u(0, t) = u(1, t) = 0, using Crank-Nicolson method taking Eqn352.png

Solution

Given uxx = ut

Eqn354

Crank-Nicolson formula is

Eqn355

Since Eqn356, we get

Eqn357

Multiply by 4,

Eqn358(1)

The boundary conditions are Eqn359

Eqn360

new2

Eqn363

We shall find one time step values.

Putting j = 0, i = 1 in (1), we get

Eqn364(1)

Putting j = 0, i= 2, in (1) we get,

Eqn365

Eqn366

Substituting in (1), we get Eqn367

Thus we have computed the value of u for one time step.

Eqn368

Example 9

Using Crank-Nicolson scheme Solve Eqn369 given u(x, 0) = u(0, t) = 0, u(1, t) = t, choosing h = 0.5, Eqn370

Solution

Given Eqn371

Here

Eqn372

So we have to use Crank-Nicolson general formula

Eqn373

Putting Eqn374

Multiply by 2, Eqn375 (1)

Eqn375a

The boundary value conditions are

Eqn376

We shall find one-step values.

new2

Putting j = 0, i = 1 in (1), we get

Eqn379

Example 10

Solve by Crank-Nicolson’s method Eqn380 for 0 < x < 1, t > 0 given that u(0, t) = 0, u (1, t) = 0 and u(x, 0) = 100x(1 - x). Compute u for one time step with Eqn380.png

Solution

Given uxx= ut

Here Eqn382 Eqn383

So, we choose k such that Eqn383a

Since l = 1, we use Crank-Nicolson simplified formula

Eqn384(1)

The boundary value conditions are

Eqn385

We have to compute on time step values of u

Eqn386

new2

Putting i = 1, j = 0 in (1), we get

Eqn387(2)

Putting i = 2, j = 0 in (1), we get

Eqn388(3)

Putting i = 3, j = 0 in (1), we get

Eqn389Eqn390(4)

From (2) and (4), we get u1,1 = u3,1

∴ (3) ∴ u2,1 Eqn391

∴ 4u2,1 Eqn392

∴ 4u2,1 Eqn393[Using (2)]

Eqn394

Eqn395

u2,1 = 14.29

Eqn397

and u3,1 = 9.82

Thus Eqn398

Example 11

Obtain the Crank-Nicholson finite difference method by taking Eqn399 Hence, find u(x, t) in the rod for two time steps for the heat equation Eqn400.png given u(x, 0) = sin px, u(0, t) = 0, u(1, t) = 0. Take h = 0.2.

Solution

Given Eqn696

For derivation of Crank-Nicholson formula for one dimensional heat equation Eqn401 where Eqn402 refer page [In this question c is a]

Here Eqn404 and h = 0.2

Now l = 1 Eqn405

Since l = 1, we use the simplified Crank-Nicolson formula

Eqn406(1)

where x = i h = 0.2 i, t = k j = 0.04 j and 0 ≤ x ≤ 1

When x = 0, i = 0 and when x = 1, Eqn407i = 0, 1, 2, 3, 4, 5

The boundary value conditions are Eqn408

Eqn409

and u(x, 0) = sin pxu(0.2i, 0) = sinp (0.2i) = sinEqn410

Eqn411

On the line x = 0, u = 0Eqn412t ie. when i = 0, u = 0 Eqn413j

and on the line x = 1, u = 0Eqn414j ie. when i = 5, u = 0 Eqn415j

For two time steps we have to compute for j = 0, 1, 2

Eqn416

Eqn418

We shall tabulate the values

new2

We shall now compute the unknown u’s.

Putting j = 0 in (1) we get the second row values of u’s

Eqn421

Eqn422

Eqn423

Eqn424(2)

Put i = 2, then Eqn425

Eqn426

Eqn427(3)

Put i = 3, then Eqn428

Eqn429

Eqn430(4)

Put i = 4, then Eqn431

Eqn432

Eqn433(5)

Substituting (5) in (4) we get

Eqn434

Eqn435

Eqn436

Eqn437(6)

Now substituting (2) in (3), we get

Eqn438

Eqn439(7)

(6) × 15 ∴ 225u3,1 106.5945

(7) × 4 ∴ 16u3,1 − 60u2,1 = −28.4264

Subtracting we get, 209u3,1 = 135.0209 ∴ u3,1 = 0.6460

Substituting in (6), we get

15(0.6460) − 4u2,1 = 7.1063

∴ 4u2,1 = 15(0.6460) − 7.1063 = 2.5837

Eqn439a

Eqn440

To find the third row values of u, put j = 1 in (1)

Eqn441

Put i = 1, then Eqn442

Eqn443

Eqn444(8)

Put i = 2, then Eqn445

Eqn446

Eqn447(9)

Put i = 3, then Eqn448

Eqn449

Eqn450(10)

Put i = 4, then Eqn451

Eqn452

Eqn453(11)

Substituting (11) in (10) we get,

Eqn454

Eqn455

Eqn456(12)

Substituting (8) in (9), we get,

Eqn457

Eqn458

Eqn459

Eqn460(13)

(12) × 15 ∴ 225u3,2 − 60u2,2 = 72.402

(13) × 4 ∴ 16u3,2 − 60u2,2 = −19.3068

Subtracting we get, 209 u3,2 = 91.7088 ∴ u3,2 = 0.4388

∴ 15u2,2 = 4(0.4388) + 4.8267 = 6.5819 ∴ u2,2 = 0.4388

Eqn461

and

Eqn462

Thus the two time step values are given in the table

new2

 

10.4 ONE-DIMENSIONAL WAVE EQUATION

One dimensional wave equation (of vibrating string) is

Eqn464(1)

This is hyperbolic type.

We shall solve this for u(x, t) using finite difference method subject to the boundary conditions.

u(0, t) = 0, u(l, t) = 0(2)

and the initial conditions

u(x, 0) = f (x), ut(x, 0) = 0(3)

Assume equal interval h for x variable and equal interval k for t variable and x = ih, t = jk and u(x, t) = u(ih, jk) = ui,j

We know the partial derivatives in terms of differences

Eqn465

Eqn466

∴ the equation (1) becomes

Eqn467

Eqn468

Let Eqn469 then the equation becomes

Eqn470

Eqn471(4)

This equation is an explicit formula for the solution of the wave equation because it gives the value of u at t = tj + 1, explicitly in terms of the values of u at t = tj and t = tj − 1

The simplest form of the equation (4) is obtained by putting

Eqn472

∴ the equation (4) becomes,

Eqn473(5)

The boundary conditions are

Eqn474

and Eqn475 if l = nh

The initial conditions are u(x, 0) = f(x) ∴ u(ih, 0) = f(ih)

ui ,0 = f(ih), i = 0, 1, 2, 3 ,…

We shall use central difference approximation for

Eqn476

When t =0, ut(x,0) = 0 ∴ Eqn703Eqn477

When j = 0, Eqn478

Eqn479 for all i

Putting j = 0 in (5), we get Eqn480

Eqn481

∴−1,0

Eqn482

For i = 1, 2, 3, …, we get the values of u in the second row.

Note: The period of vibration of the string of length l given by Eqn483 is Eqn484 we have to find the values of u at the mesh points for one period, unless otherwise specified.

WORKED EXAMPLES

Example 1

Solve 16uxx = utt, u(0, t) = u(5, t) = 0, u(x, 0) = x2(5 - x), ut(x, 0) = 0 taking h = 1 and upto one half of the period of vibration.

Solution

Given 16uxxutt = 0

Here a2 = 16 ∴ a = 4.

Now Eqn485

Choose l = 1 and h = 1, then Eqn486

Since l = 1, the simplest difference equation is

Eqn487(1)

Now x = ih =i, t = jk = Eqn488 u(x, y) = u Eqn489 = ui,j

From the boundary conditions u(0, t) = u(5, t) = 0, it is obvious 0 ≤ x ≤ 5 and length of the string l = 5

∴ period of vibration Eqn490

Half the period = 1.25 secs.

So, we have to find values of t upto t = 1.25 ∴ Eqn491 = 1.25 ∴ j = 5

Eqn492(2)

Eqn493(3)

Eqn494

Eqn495(4)

When t = 0, Eqn496Eqn496a

Since Eqn496b t = 0 ∴ j = 0

When j = 0, Eqn498 (5)

(2) ∴ Eqn499

(3) ∴ Eqn500

(4) ∴ Eqn501

Putting j = 0 in (1), we get Eqn502

Eqn503[Using (5)]

∴−1,0

Eqn504(6)

new2

Put i = 1, Eqn506

Eqn507

To fill up the 3rd row put j = 1 in (1)

Eqn508

Putting i = 1, 2, 3, 4, we get

Eqn509

To fill up the 4th row put j = 2 in (1)

Eqn510

Putting i = 1, 2, 3, 4 we get

Eqn511

To fill up the 5th row put j = 3 in (1)

Eqn512

Putting i = 1, 2, 3, 4, we get

Eqn513

To fill up the last row put j = 4 in (1)

Eqn514

Putting i = 1, 2, 3, 4, we get

Eqn514a

Example 2

Solve the wave equation Eqn515.png

Eqn516

and Eqn517 using h = k = 0.1 for 3 time steps.

Solution

Given Eqn518

Here a2 = 1 ∴ a = 1. h = k = 0.1

Eqn519

Since l = 1, the simplest equation is Eqn520(1)

x = ih = (0.1)i, t = j k = (0.1)j, u(x, y) = Eqn709

Since 0 ≤ x ≤ 1, x = 1 ∴ 0.1 i = 1 ∴ i = 10. So i = 0, 1, 2, ..., 10

Since t takes 3 steps, j = 0, 1, 2, 3

Given Eqn521

Eqn522

Eqn523

Eqn524

new2

Eqn526

When t = 0, u(x, 0) = 0 ∴ Eqn527a

Eqn527

Now t = 0 ∴ j = 0

When j = 0, Eqn528

(1) ∴

 

Eqn529

Eqn530

Putting i =1, 2, ..., 9, we get

Eqn531

Eqn533

To find the values of u in the third row put j = 1 in (1)

Eqn534

Putting i = 1, 2, 3, …, 9, we get

Eqn535

To find the values of u in the 4th row put j = 2 in (1)

Eqn536

Putting i = 1, 2, ..., 9, we get

Eqn537

Example 3

Approximate the solution to the wave equation Eqn539 u(0, t) = 0, u(1, t) = 0, t > 0, u(x, 0) = sin2p x, 0 £ x £ 1 and Eqn540 0 £ x £ 1 with Δx = 0.25 and Δt = 0.25 for 3 time steps.

Solution

Given Eqn541

Here a2 = 1 ∴ a =1; Δx = h = 0.25, Δt = k = 0.25

Eqn542

Since l = 1, the difference equation is

Eqn543(1)

Eqn544

Eqn545

Since Eqn546 i varies from 0 to 1 and Eqn547

We have to compute for 3 time steps. ∴ j = 0, 1, 2, 3

Eqn548

Eqn549(2)

u(0, t) = 0 for t > 0 ∴ u0,j = 0, j = 1, 2, 3 (3)

Eqn550

Eqn551(4)

Eqn552

So we have the first row values of u.

new2

To find second row mesh point values of u.

When t = 0 ut (x,0) = 0 ∴ Eqn554Eqn555

When j = 0, j = 0]

When j = 0, (1) ∴ Eqn557

Eqn558

Eqn559

Eqn560(5)

Putting i = 1, 2, 3, we get

Eqn561

To find the third row values of u, put j = 1 in (1)

Eqn562

Putting i = 1, 2, 3, we get

Eqn563

To find the fourth row values of u, put j = 2 in (1)

Eqn564

Putting i = 1, 2, 3, we get,

Eqn565

Example 4

Solve numerically 4uxx = utt with the boundary conditions u(0, t) = 0, u(4, t) = 0, t > 0 and the initial conditions ut(x, 0) = 0, u(x, 0) = x(4 − x), taking h = 1 for four time steps.

Solution

Given 4uxx = utt

Here a2 = 4 ∴ a = 2; h = 1

We shall choose k such that l = 1 ∴ Eqn566

Since l = 1, the difference equation is

Eqn567(1)

Eqn568

From boundary condition, 0 ≤ x ≤ 4 and so i = 0, 1, 2, 3, 4

Eqn569(2)

Since we have to compute for 4 time steps j = 0, 1, 2, 3, 4

Eqn570(3)

Eqn571(4)

Eqn572 [From (2)]

and Eqn573 [From (3)]

From (4), Eqn574

So we have the first row values of u

new2

Now to find other rows mesh point values of u

When t = 0, Eqn575ui,j1= 0

When j = 0 j = 0]

Eqn577(5)

When j = 0, (1) ∴ Eqn578

= Eqn579 [Using (5)]

Eqn581

Eqn582

When i = 1, Eqn583

When i = 2, Eqn584

When i = 3, Eqn585

To find the values of u in the third row put j = 1 in (1)

Eqn586

Putting i = 1, 2, 3 we get

Eqn587

To find the values of u in the 4th row, put j = 2 in (1)

Eqn588

Putting i = 1, 2, 3, we get

Eqn589

To find the values of u in the 5th row, put j = 3 in (1)

Eqn590

Putting i = 1, 2, 3, we get

Eqn591

Exercises 10.2

(I) Elliptic equations:

  1. Solve uxx + uyy = 0 for the following mesh with boundary values as shown in the figure. Iterate until the maximum difference between the successive values at any point is less than 0.005.
    C10U012
  2. Solve uxx + uyy = 0 numerically for the following mesh with boundary conditions as shown below.
    C10U012a
  3. Solve Eqn592 in the square mesh given u = 0 on the four boundaries dividing the square into 16 subsquares of length 1 unit.
    C10U007
  4. 0 over the square region of side n, satisfying the boundary condition
  5. 0, 0 ≤ y ≤ 4 (ii) u(4,y) = 12 y ≤ 4
  6. 3x, 0 ≤ y ≤ 4 (iv) u(x,4) = x2, 0 ≤ y ≤ 4.
  7. 8 + 2y, u(x, 0) = Eqn601 , u(x, 4) = x2 with Eqn602
  8. C10U014
  9. (II) Parabolic equations:

    • (6) Solve Eqn603 subject to the conditions u(x, 0) = Eqn604 Eqn605, u(0, t) = u(1, t) = 0

      Using Schmidt method taking Eqn606

    • (7) Solve uxx = 32 ut = taking h = 0.25 for t > 0, 0 < x < 1 and u(x, 0) = 0, u(0, t) = 0, u(1, t) = t using Schmidt method.
    • (8) Using Crank-Nicolson method solve uxx = 16 ut , 0 < x < 1, t > 0 given u(x, 0) = 0, u(0, t) = 0 and u(1, t) = 100 t, choosing Eqn608.
    • − Nicoloson method Eqn6090 < x < 2, t > 0, u (0, t) = u (2, t) = 0, t > 0 and u(x, 0) Eqn610 using h = 0.5, k = 0.25 for two time steps.
    • (10) Using Crank-Nicolson method solve ut = uxx in Eqn611, t > 0, given u(0, t) = 0 u(l, t)
    • and u(x, 0) = Eqn612
    • Take h = 0.1 and find u for one step in t.

    (III) Hyperbolic equations:

    • 0.5, with spacing of 0.1 subject to y (0, t) = 0, y(1, t) = 0, yt (x, 0) = 10 − x).
    • x2), Eqn615(x, 0) = 0, u(0, t) = u(1, t) = 0, t > 0 by finite difference method for one time step with h = 0.25.
    • (13) Solve Eqn6170 < x < 1, t > 0, given u(x, 0) = 0, ut (x, 0) = u(0, t) = 0 and u(1, t) = 100 sin p t. Compute u for 4 time steps with h = 0.25.
    • utt = 0 for u at the pivotal points, given u(0, t) = u(5, t) = 0, ut(x, 0) = 0 and
    • u(x,0) = Eqn620 for one half period of vibration.
    • (15) Solve the boundary value problem utt = uxx = 0 with the conditions u(0, t) = u(1, t) = 0, u(x, 0) Eqn622 and ut(x, 0) = 0 taking h = k = 0.1 for Eqn623. Compare your solution with the exact solution at x = 0.5 and t = 0.3.
    • Answers 10.2
    • 1.999, 2.999, 3.999 (2) u1 = u4 = 1.333, u2 = u3= 1.6667
    • − 3 (4) 2.37, 5.59, 9.87, 2.88, 6.13,
    • − 2, u5 = − 2 9.88, 3.01, 6.16, 9.51
    • 4.9, u3 = 9, u4 = 2.07, u5 = 4.69,
    • u6 = 8.07, u7 = 1.57, u8 = 3.71, u9 = 6.57]
    • (6)
    C10U007
    • (7)
    C10U007
    • 1.7857, u 2 = 7.1429, u3 = 26.7857
    • u1 = 0.2857, u2 = 0.1429, u3 = 0.2857, u4 = 0.0816, u5 = 0.1837, u6 = 0.0816
    • (10)
    C10U007
    • (11)
    C10U007
    • (12)
    C10U007
    • (13)
    C10U007
    • (14)
    C10U007
    • Find the exact solution when t = 0.3 or j = 3
    C10U007
Short Answer Questions
  • 0.
  • 2. Identify the type of the equation fxx + 2fxy + fyy = 0.
  • 3. Classify the partial differential equation uxx + 2uxy + 4uyy = 0, x > 0, y > 0.
  • 4. For what values of x and y, the equation xfxx + yfyy = 0, x > 0, y > 0 is elliptic?
  • 5. Obtain the finite difference approximation for the differential equation Eqn664
  • 6. Name at least two numerical methods that are used to solve one dimensional diffusion equation.
  • 7. Write down Laplace equation and its finite difference analogue and the standard five point formula.
  • 8. State the explicit finite difference scheme for one dimensional wave equation Eqn628
  • 9. Find the explicit finite differences scheme for one dimensional wave equation Eqn634
  • 10. Write down the Crank-Nicolson formula to solve ut = uxx.
  • 11. Write down the implicit formula to solve one dimensional heat flow equation Eqn639
  • 12. Why is Crank - Nicolson’s scheme is called an implicit scheme?
  • 13. What type of equations can be solved by using Crank-Nicolson’s formula?
  • 0.
  • 15. State Leibmann’s iteration process formula.
  • 16. Write down the finite difference form of the Poisson equation ∴2u = f(x, y).
  • 17. Write down the Schemidt’s explicit formula for solving heat flow equation.
  • aut = 0.
  • 19. Write down the Crank-Nicolson difference scheme to solve uxx = aut with u(0, t) = T0, (l, t) = T1 and the initial condition as u(x, 0) = f(x).
  • Write down the Forward difference approximation to ux(x0, y0).
  • 21. Write down the backward difference approximation of ux(x0, y0).
  • 22. Write down the finite difference approximation to uxx, where u = u(x, y) taking, h, k as the step sizes at the point (x, y).

C H A P T E R

10

C10U010
C10U011
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.124.177