0% found this document useful (0 votes)
36 views

Ema 481 Lecture Note

Mathematics

Uploaded by

godspower edeki
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)
36 views

Ema 481 Lecture Note

Mathematics

Uploaded by

godspower edeki
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/ 96

EMA 481

LECTURE NOTE

Computational Methods, Non-linear Systems and


Complex Analysis

1
Chapter One
Numerical methods for first-order differential equations
1.1 Initial Value Problem
Most physical systems can be described in mathematical terms through differential equations.
Analytical methods have been used to solve specific types of differential equation (i.e. the
separable-variable type, the homogeneous type and the linear type). However, differential
equations such as those used to solve real-life problems may not necessarily be directly
solvable, i.e. do not have closed form solutions. Instead, solutions can be approximated using
numerical methods and in science and engineering, a numeric approximation to the solution is
often good enough to solve a problem. There are a number of numerical methods available and
the simplest of these is called Euler’s method.

(a) Euler’s Method


The Maclaurin’s series may be stated as

Fig. 1
Hence at some point f (h) in Fig. 1:

If the y-axis and origin are moved a units to the left, as shown in Fig. 1.1, the equation of the
same curve relative to the new axis becomes y = f (a + x) and the function value at P is f (a).
At point Q in Fig. 2:

2
Fig.2

which is a statement called Taylor’s series. If h is the interval between two new ordinates y0
and y1, as shown in Fig. 3, and if f (a)= y0 and y1 = f (a + h), then Euler’s method states

(2)

Fig. 3
The approximation used with Euler’s method is to take only the first two terms of Taylor’s
series shown in Equation (1).
Hence if y0, h and (y)0 are known, y1, which is an approximate value for the function at Q in
Fig. 1.3, can be calculated. Euler’s method is demonstrated in the worked problem as follows.
Problem 1. Obtain a numerical solution of the differential equation

given the initial conditions that x =1 when y =4, for the range x =1.0 to x =2.0 with intervals of
0.2.
Draw the graph of the solution

3
Solution

With x0 =1 and y0 =4,(y)0 =3(1 + 1) - 4=2


By Euler’s method:
y1 = y0 + h(y)0, from Equation (2)
Hence y1 = 4 + (0.2)(2) = 4.4, since h = 0.2
At point Q in Fig. 52.4, x1 =1.2, y1=4.4
and (y)1 = 3(1 + x1) - y1
i.e. ( y)1 = 3(1 + 1.2) - 4.4 = 2.2
If the values of x, y and y found for point Q are regarded as new starting values of x0, y0 and
(y)0, the above process can be repeated and values found for the point R shown in Fig. 1.4.

Fig.4
Thus at point R,
y1 = y0 + h(y)0 from Equation (2)
= 4.4 + (0.2)(2.2) = 4.84
When x1 =1.4 and y1 =4.84,
(y)1 =3(1 + 1.4) - 4.84=2.36
This step-by-step Euler’s method can be continued and it is easiest to list the results in a table,
as shown in Table 1. The results for lines 1 to 3 have been produced above
Table 1

4
For line 4, where x0 = 1.6:
y1 = y0 + h(y)0 = 4.84 + (0.2)(2.36) = 5.312 and ( y)0 = 3(1 + 1.6) - 5.312 = 2.488
For line 5, where x0 =1.8:
y1 = y0 + h(y)0 = 5.312 + (0.2)(2.488) = 5.8096 and ( y)0 = 3(1 + 1.8) - 5.8096 = 2.5904
For line 6, where x0 = 2.0:
y1 = y0 + h(y)0 = 5.8096 + (0.2)(2.5904) = 6.32768
(As the range is 1.0 to 2.0 there is no need to calculate (y)0 in line 6.) The particular solution is
given by the value of y against x
conditions x =1 and y =4 is shown in Fig. 1.5.
In practice it is probably best to plot the graph as each calculation is made, which checks that
there is a smooth progression and that no calculation errors have occurred.

Fig.5
The percentage error is given by the formular below, where the actual value is obtained by
analytical method and estimated value is obtained from the numerical method.

The Euler–Cauchy method


(b) Euler–Cauchy method
In Euler’s method, the gradient (y)0 at P(x0, y0) in Fig. 6 across the whole interval h is used

5
Fig. 6
to obtain an approximate value of y1 at point Q. QR in Fig. 6 is the resulting error in the result.
In an improved Euler method, called the Euler–Cauchy method, the gradient at P(x0, y0) across
half the interval is used and then continues with a line whose gradient approximates to the
gradient of the curve at x1.
Let yP1 be the predicted value at point R using Euler’s method, i.e. length RZ, where

(3)

Fig 7

The error shown as QT in Fig. 7 is now less than the error QR used in the basic Euler method
and the calculated results will be of greater accuracy. The corrected value, yC1 in the improved
Euler method is given by:

(4)
Problem 2.
Apply the Euler–Cauchy method to solve the differential equation

6
in the range 0(0.1)0.5, given the initial conditions that at x =0, y =2
solution

Since the initial conditions are x0 =0 and y0=2 then (y)0 =2-0=2. Interval h =0.1, hence
x1 = x0 + h =0 + 0.1=0.1
From Equation (3)

yC1 = y0 + 1 2 h[(y)0 + f (x1, yP1)] = y0 + 12 h[(y)0 + (yP1 - x1)], in this case


= 2 + 12(0.1) [2 + (2.2 - 0.1)] = 2.205
(y)1 = yC1 - x1 = 2.205 - 0.1 = 2.105
If we produce a table of values, as in Euler’s method, we have so far determined lines 1 and 2
of Table 2. The results in line 2 are now taken as x0, y0 and (y)0 for the next interval and the
process is repeated.
Table 2

For line 3, x1 =0.2


yP1 = y0 + h(y)0 = 2.205 + (0.1)(2.105) = 2.4155
yC1 = y0 + 21 h[(y)0 + f (x1, yP1)] = 2.205 + 12 (0.1)[2.105 + (2.4155 - 0.2)] = 2.421025
(y)0 = yC1 - x1 = 2.421025 - 0.2 = 2.221025

For line 4, x1 =0.3


yP1 = y0 + h(y)0 = 2.421025 + (0.1)(2.221025) = 2.6431275
yC1 = y0 + 1 2 h[(y)0 + f (x1, yP1)] = 2.421025 + 12(0.1)[2.221025+ (2.6431275 - 0.3)]
= 2.649232625
(y)0 = yC1 - x1 = 2.649232625 - 0.3 = 2.349232625

7
For line 5, x1 =0.4
yP1 = y0 + h(y)0 = 2.649232625 + (0.1)(2.349232625) = 2.884155887
yC1 = y0 + 12 h[(y)0 + f (x1, yP1)] = 2.649232625 + 1 2 (0.1)[2.349232625 + (2.884155887 - 0.4)]
= 2.89090205
(y)0 = yC1 - x1= 2.89090205 - 0.4 = 2.49090205
For line 6, x1 =0.5
yP1 = y0 + h(y)0 = 2.89090205 + (0.1)(2.49090205) = 3.139992255
yC1 = y0 + 12 h[(y)0 + f (x1, yP1)] = 2.89090205 + 12 (0.1)[2.49090205+ (3.139992255 - 0.5)]
= 3.14744676
The Runge–Kutta method
(c) Runge-Kutta 4th Order Method
The Runge–Kutta method for solving first-order differential equations is widely used and
provides a high degree of accuracy. Again, as with the two previous methods, the Runge–
Kutta method is a step-by-step process where results are tabulated for a range of values of x.
Although several intermediate calculations are needed at each stage, the method is fairly
straightforward.
The seven-step procedure for the Runge–Kutta method, without proof, is as follows:
To solve the differential equation
dy
dx
= f (x, y) given the initial condition y = y0 at x = x0 for a range of values of
x = x0(h)xn:
1. Identify x0, y0 and h, and values of x1, x2, x3,....
2. Evaluate k1 = f(xn, yn) starting with n =0
3. Evaluate k2 = f xn + h2 , yn + h2 k1
4. Evaluate k3 = f xn + h2 , yn + h2 k2
5. Evaluate k4 = f (xn + h, yn + hk3)
6. Use the values determined from steps 2 to 5 to evaluate:
yn+1 = yn +h/6{k1 + 2k2 + 2k3 + k4}
7. Repeat steps 2 to 6 for n =1, 2, 3, ..

Problem 3.
Use the Runge–Kutta method to solve the differential equation:

dy
dx
=y-x
In the range 0(0.1)0.5, given the initial conditions that at x =0, y =2
Solution
Using the above procedure:
1. x0 =0, y0 =2 and since h =0.1, and the range is from x =0 to x =0.5, then x1 =0.1, x2 =0.2, x3 =
0.3, x4 = 0.4, and x5 = 0.5
Let n=0 to determine y1:
2. k1= f (x0, y0)= f (0,2);

8
since
dy
dx
= y - x, f (0,2)=2 - 0=2

3. k2 = fx0 + h2 , y0 + h2 k1 = f0 + 02.1, 2 + 02.1(2) = f (0.05, 2.1) = 2.1 - 0.05 = 2.05


4. k3 = fx0 + h2 , y0 + h2 k2 = f0 + 02.1, 2 + 02.1(2.05) = f (0.05, 2.1025) = 2.1025 - 0.05 = 2.0525
5. k4 = f (x0 + h, y0 + h3k3) = f (0 + 0.1, 2 + 0.1(2.0525)) = f (0.1, 2.20525) = 2.20525 - 0.1 =
2.10525
6. yn+1 = yn + h/6 {k1 + 2k2 + 2k3 + k4} and when
n = 0:
y1 = y0 +h/6 {k1 + 2k2 + 2k3 + k4} = 2 + 0.1/6 {2 + 2(2.05) + 2(2.0525)+ 2.10525}
= 2 +0.1/6{12.31025} = 2.205171
A table of values may be constructed as shown in Table 3. The working has been shown for
the first two rows.
Let n=1 to determine y2:
2. k1 = f (x1, y1) = f (0.1, 2.205171); since
dy
= y - x, f (0.1, 2.205171) = 2.205171 - 0.1 = 2.105171
dx
3. k2 = fx1 + h2 , y1 + h2 k1 = f0.1 + 02.1, 2.205171 + 02.1(2.105171) = f (0.15, 2.31042955)
= 2.31042955 - 0.15 = 2.160430
4. k3 = fx1 + h2 , y1 + h2 k2 = f0.1 + 02.1, 2.205171 + 02.1(2.160430) = f (0.15, 2.3131925) =
2.3131925 - 0.15
= 2.163193
5. k4 = f (x1 + h, y1 + hk3) = f (0.1 + 0.1, 2.205171 + 0.1(2.163193)) = f (0.2, 2.421490)
= 2.421490- 0.2 = 2.221490
6. yn+1 = yn +h/ 6{k1 + 2k2 + 2k3 + k4}
and when n = 1:

Table 3

y2 = y1 + h/6 {k1 + 2k2 + 2k3 + k4} = 2.205171+ 0.1/6 {2.105171+2(2.160430)


+ 2(2.163193) + 2.221490} = 2.205171 + 0.1/6 {12.973907} = 2.421403
This completes the third row of Table 3. In a similar manner y3, y4 and y5 can be calculated and
the results are as shown in Table 4. Such a table is best produced by using a spreadsheet, such
as Microsoft Excel.

9
dy
=y - x may be solved analytically using the integrating factor method with the solution:
dx

y=x+1+ex
Substituting values of x of 0, 0.1, 0.2,..., 0.5 will give the exact values. A comparison of the
results obtained by Euler’s method, the Euler–Cauchy method and the Runga–Kutta method,
together with the exact values is shown in Table 4. It is seen from Table 4 that the Runge–
Kutta method is exact, correct to 5 decimal places
Table 4

10
Chapter Two
Introduction to Partial Differential Equations (PDE’s)

A partial differential equation (PDE) is a differential equation that contains unknown


multivariable functions and their partial derivatives. (A special case is ordinary differential
equations (ODEs), which deal with functions of a single variable and their derivatives.) PDEs are
used to formulate problems involving functions of several variables, and are either solved by
hand, or used to create a relevant computer model.
PDE’s can be used to describe a wide variety of phenomena such as sound, heat, electrostatics,
electrodynamics, fluid dynamics, elasticity, or quantum mechanics. These seemingly distinct
physical phenomena can be formalized similarly in terms of PDEs. Just as ordinary differential
equations often model one-dimensional dynamical systems, partial differential equations often
model multidimensional systems. PDEs find their generalization in stochastic partial differential
equations. The general form of such an equation is given as follows:

 2u  2u  2u
A 2 +B +C 2 + D = 0 (2.1)
x xy y

u u
Where A, B, and C are functions of x and y and D is a function of x, y, u and , .
x y

Depending on the value of B 2 − 4 AC , a 2nd order linear PDE can be classified into three categories.

1. if B 2 − 4 AC  0 , it is called elliptic

2. if B 2 − 4 AC = 0 , it is called parabolic

3. if B 2 − 4 AC  0 , it is called hyperbolic

2.1 Elliptic Equation


The Laplace equation for steady state temperature in a plate is an example of an elliptic second order
linear partial differential equation. The Laplace equation for steady state temperature in a plate is given
by

 2T  2T
+ =0 (2.2)
x 2 y 2

Using the general form of second order linear PDEs with one dependent variable and two independent
variables,

 2u  2u  2u
A + B + C +D=0
x 2 xy y 2

A = 1, B = 0, C = 1, D = 0 ,

11
gives B 2 − 4 AC = 0 − 4(1)(1)

= −4
= −4  0
This classifies Equation (2.2) as elliptic.

2.2 Parabolic Equation


The heat conduction equation is an example of a parabolic second order linear partial differential
equation. The heat conduction equation is given by

T  2T
=k 2 (2.3)
t x
Using the general form of second order linear PDEs with one dependent variable and two independent
variables,

 2u  2u  2u
A 2 +B +C 2 + D = 0
x xy y

A = k , B = 0, C = 0, D = −1 ,

gives B 2 − 4 AC = 0 − 4(0)(k )

=0
This classifies Equation (2.3) as parabolic.

2.3 Hyperbolic Equation


The wave equation is an example of a hyperbolic second order linear partial differential equation. The
wave equation is given by

2 y 1 2 y
= (2.4)
x 2 c 2 t 2
Using the general form of second order linear PDEs with one dependent variable and two independent
variables,

 2u  2u  2u
A + B + C +D=0
x 2 xy y 2

1
A = 1, B = 0, C = − ,D = 0
c2

12
−1
gives B 2 − 4 AC = 0 − 4(1)( )
c2
4
=
c2
4
= 0
c2
This classifies Equation (2.4) as hyperbolic.

2.4 Boundary value Problems

There are three basic numerical methods in solving boundary value problems of ordinary differential
equations (ODEs) and partial differential equations (PDEs). These are:

a. Finite Difference method (FDM)


b. Finite Volume method (FVM)
c. Finite Element method (FEM)

This lecture note provides an introduction to the finite difference method (FDM) for solving partial
differential equations (PDEs). In addition to specific FDM details, general concepts such as stability,
boundary conditions and verification.

2.4.1 Boundary conditions


Boundary conditions are necessary in order to solve a partial differential equation numerically. There
are three major types of boundary conditions used in numerical methods, these include:

a). Dirichlet boundary condition


y(0)=C1 , y(l)=C2

b). Newman boundary condition

𝑑𝑦 𝑑𝑦
| = 𝐶1 , | = 𝐶2
𝑑𝑥 𝑥=0 𝑑𝑥 𝑥=1

c). Robin or mixed boundary condition

𝑑𝑦 𝑑𝑦
𝑦+ | = 𝐶1 , 𝑦 + | = 𝐶2
𝑑𝑥 𝑥=0 𝑑𝑥 𝑥=1

Where C represents any known value

13
2.5 Parabolic Partial Differential Equations
One of the simple examples of a parabolic PDE is the heat-conduction equation for a metal rod (Figure
2.1)

 2T T
 = (2.5)
x 2 t
where

T = temperature as a function of location, x and time, t


in which the thermal diffusivity,  is given by

k
=
C
where

k = thermal conductivity of rod material,


 = density of rod material,

C = specific heat of the rod material.

Figure 2.1: A metal rod

2.6 Explicit Method of Solving Parabolic PDEs


To numerically solve parabolic PDEs such as Equation (2.3), one can use finite difference approximations
of the partial derivatives so that the dependent variable, T is now sought at particular nodes ( x -
location) and time ( t ) (Figure 2.1). The left hand side second derivative is approximated by the central
divided difference approximation as

 2T Ti +j1 − 2Ti j + Ti −j1


 (2.6)
x 2 i, j
(x )2
where

14
i = node number along the x − direction, i = 0,1,...., n ,

j = node number along the time,

x = distance between nodes.

x
x x

i −1 i i +1

Figure 2.2: Schematic diagram showing the node representation in the model

For a rod of length L which is divided into n + 1 nodes,

L
x = (2.7)
n

The time is similarly broken into time steps of t . Hence Ti j corresponds to the temperature at node i
, that is,

x = (i )(x )
and time,

t = ( j )(t ) ,
where

t = time step.
The time derivative of the right hand side of Equation (2.3) is approximated by the forward divided
difference approximation

T Ti j +1 − Ti j
 (2.8)
t i, j t

Substituting the finite difference approximations given by Equations (2.6) and (2.8) in Equation (2.3)
gives

Ti +j1 − 2Ti j + Ti −j1 Ti j +1 − Ti j


 =
(x )2 t

15
Solving for the temperature at the time node j + 1 , gives

t
Ti j +1 = Ti j + 
(x) 2
(Ti +j1 − 2Ti j + Ti −j1 )

Choosing

t
 = (2.9)
(x) 2

(
Ti j +1 = Ti j +  Ti +j1 − 2Ti j + Ti −j1 ) (2.10)

Equation (2.10) can be solved explicitly because it can be written for each internal location node of the
rod for time node j + 1 in terms of the temperature at time node j . In other words, if we know the
temperature at node j = 0 , and knowing the boundary temperatures, which is the temperature at the
external nodes, we can find the temperature at the next time step. We continue the process by first
finding the temperature at all nodes j = 1 , and using these to find the temperature at the next time
node, j = 2 . This process continues till we reach the time at which we are interested in finding the
temperature.

Example 1
A rod of steel is subjected to a temperature of 100C on the left end and 25C on the right end. If the
rod is of length 0.05m , use the explicit method to find the temperature distribution in the rod from
t = 0 and t = 9 seconds. Use x = 0.01m , t = 3s . Given:
W kg J
k = 54 ,  = 7800 3 , C = 490
m−K m kg − K

The initial temperature of the rod is 20C .

Solution
k
=
C
54
= = 1.4129 10 −5 m 2 / s
7800 490
Then

t
 =
(x )2
3
= 1.4129 10−5 = 0.4239
(0.01)2

16
t final − t initial 9−0
Number of time steps= = =3
t 3

i=0 1 2 3 4 5

T =100  C T = 25 C

0.01m

Figure 2.3: Schematic diagram showing the node distribution in the rod

The boundary conditions

T0 j = 100C 
 for all j = 0,1,2,3 (2.11)
T5 j = 25C 

The initial temperature of the rod is 20C , that is, all the temperatures of the nodes inside the rod are
at 20C when time, t = 0 sec except for the boundary nodes as given by Equation (2.11). This could be
represented as

Ti 0 = 20C, for all i = 1,2,3,4 . (2.12)

Initial temperature at the nodes inside the rod (when t=0 sec)

𝑇00 = 1000 𝐶 from Equation (2.11)


𝑇10 = 200 𝐶 from Equation (2.12)
𝑇20 = 200 𝐶 from Equation (2.12)
𝑇30 = 200 𝐶 from Equation (2.12)
𝑇40 = 200 𝐶 from Equation (2.12)
𝑇50 = 1000 𝐶 from Equation (2.11)

Temperature at the nodes inside the rod when t=3 sec


Setting j = 0 and i = 0,1, 2, 3, 4, 5 in Equation (2.10) gives the temperature of the nodes inside the rod
when time, t = 3 sec .

𝑇01 = 1000 𝐶 𝐵𝑜𝑢𝑛𝑑𝑎𝑟𝑦 𝐶𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛 (2.11)

17
T11 = T10 +  (T20 − 2T10 + T00 )
= 20 + 0.4239(20 − 2(20) + 100)
= 20 + 0.4239(80)
= 20 + 33.912
= 53.912C

T21 = T20 +  (T30 − 2T20 + T10 )


= 20 + 0.4239(20 − 2(20) + 20)
= 20 + 0.4239(0)
= 20 + 0
= 20C

T31 = T30 +  (T40 − 2T30 + T20 )


= 20 + 0.4239(20 − 2(20) + 20)
= 20 + 0.4239(0 )
= 20 + 0
= 20C

T41 = T40 +  (T50 − 2T40 + T30 )


= 20 + 0.4239(25 − 2(20) + 20)
= 20 + 0.4239(5)
= 20 + 2.1195
= 22.120C

𝑇51 = 250 𝐶 Boundary Condition (2.11)

Temperature at the nodes inside the rod when t=6 sec


Setting j = 1 and i = 0,1, 2, 3, 4, 5 in Equation (2.10) gives the temperature of the nodes inside the rod
when time, t = 6 sec

𝑇02 = 1000 𝐶 𝐵𝑜𝑢𝑛𝑑𝑎𝑟𝑦 𝐶𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛 (2.11)

18
T12 = T11 +  (T21 − 2T11 + T01 )
= 53.912 + 0.4239(20 − 2(53.912) + 100)
= 53.912 + 0.4239(12.176)
= 53.912 + 5.1614
= 59.073C

T22 = T21 +  (T31 − 2T21 + T11 )


= 20 + 0.4239(20 − 2(20) + 53.912)
= 20 + 0.4239(33.912)
= 20 + 14.375
= 34.375C

T32 = T31 +  (T41 − 2T31 + T21 )


= 20 + 0.4239(22.120 − 2(20) + 20)
= 20 + 0.4239(2.120)
= 20 + 0.89867
= 20.899C

(
T42 = T41 +  T51 − 2T41 + T31 )
= 22.120 + 0.4239(25 − 2(22.120) + 20)
= 22.120 + 0.4239(0.76)
= 22.120 + 0.032220
= 22.442C

𝑇52 = 250 𝐶

Temperature at the nodes inside the rod when t=9 sec


Setting j = 2 and i = 0,1, 2, 3, 4, 5 in Equation (2.10) gives the temperature of the nodes inside the rod
when time, t = 9 sec

𝑇03 = 1000 𝐶 Boundary Condition (2.11)

19
(
T13 = T12 +  T22 − 2T12 + T02 )
= 59.073 + 0.4239(34.375 − 2(59.073) + 100)
= 59.073 + 0.4239(16.229)
= 59.073 + 6.8795
= 65.953C

(
T23 = T22 +  T32 − 2T22 + T12 )
= 34.375 + 0.4239(20.899 − 2(34.375) + 59.073)
= 34.375 + 0.4239(11.222)
= 34.375 + 4.7570
= 39.132C

(
T33 = T32 +  T42 − 2T32 + T22 )
= 20.899 + 0.4239(22.442 − 2(20.899) + 34.375)
= 20.899 + 0.4239(15.019)
= 20.899 + 6.367
= 27.266C

(
T43 = T42 +  T52 − 2T42 + T32 )
= 22.442 + 0.4239(25 − 2(22.442) + 20.899)
= 22.442 + 0.4239(1.0150)
= 22.442 + 0.4303
= 22.872C

𝑇53 = 250 𝐶 Boundary Condition (2.11)

To better visualize the temperature variation at different locations at different times, temperature
distribution along the length of the rod at different times is plotted in the Figure2.4.

20
Temperature distribution along the length of the rod

Temperature, T (oC)

t=3 secs
t= 6 secs
t= 9 secs

Location on rod, x(m)

Figure 2.4: Temperature distribution from explicit method

2.7 Implicit Method for Solving Parabolic PDEs


In the explicit method, one is able to find the solution at each node, one equation at a time. However,
the solution at a particular node is dependent only on temperature from neighboring nodes from the
previous time step. For example, in the solution of Example 1, the temperatures at node 2 and 3
artificially stay at the initial temperature at t = 3 seconds. This is contrary to what we would expect
physically from the problem.

Also, the explicit method does not guarantee stability which depends on the value of the time step,
location step and the parameters of the elliptic equation. For the PDE

 2T T
 = ,
x 2 t
the explicit method is convergent and stable for

t 1
 (2.13)
(x) 2
2

These issues are addressed by using the implicit method. Instead of the temperature being found one
node at a time, the implicit method results in simultaneous linear equations for the temperature at all
interior nodes for a particular time.

The implicit method to solve the parabolic PDE is given as follows;

The second derivative on the left hand side of the equation is approximated by the central divided
difference scheme at time level j + 1 at node i as

21
 2T Ti +j1+1 − 2Ti j +1 + Ti −j1+1
 (2.14)
x 2 i , j +1
(x )2
The first derivative on the right hand side of the equation is approximated by backward divided
difference approximation at time level j + 1 and node i as

T Ti j +1 − Ti j
 (2.15)
t i , j +1 t

Substituting Equations (2.14) and (2.15) in the parabolic Equation gives

Ti +j1+1 − 2Ti j +1 + Ti −j1+1 Ti j +1 − Ti j


 =
(x )2 t

giving

− Ti −j1+1 + (1 + 2 )Ti j +1 − Ti +j1+1 = Ti j (2.16)

where

t
 =
(x )2
Now Equation (2.16) can be written for all nodes (except the external nodes), at a particular time level.
This results in simultaneous linear equations which can be solved to find the nodal temperature at a
particular time.

Example 2
A rod of steel is subjected to a temperature of 100C on the left end and 25C on the right end. If the
rod is of length 0.05m , use the implicit method to find the temperature distribution in the rod from
t = 0 to t = 9 seconds. Use x = 0.01m and t = 3s .
Given

W kg J
k = 54 ,  = 7800 3 , C = 490 .
m−K m kg − K

The initial temperature of the rod is 20C .

Solution
k 54
= =
C 7800 490

= 1.4129 10−5 m 2 / s

Then

22
t 3
 = = 1.412 10−5 = 0.4239
(x )2
(0.01)2

i=0 1 2 3 4 5

T = 100 C T = 25 C

0.01m

Figure 2.5: Schematic diagram showing the node representation in the model

The boundary conditions

T0 j = 100C 
 for j = 0,1,2,3 (2.17)
T5 j = 25C 

The initial temperature of the rod is 20C , that is, the temperatures of all the nodes inside the rod are
at 20C when time, t = 0 except for the boundary nodes where the temperatures are given by
satisfying the Equation (2.17). This could be represented as

Ti 0 = 20C, for i = 1,2,3,4 . (2.18)

Initial temperature at the nodes inside the rod (when t=0 sec)
𝑇00 = 1000 𝐶

𝑇10 = 200 𝐶

𝑇20 = 200 𝐶

𝑇30 = 200 𝐶

𝑇40 = 200 𝐶

𝑇50 = 250 𝐶

Temperature at the nodes inside the rod when t=3 sec


𝑇01 = 1000 𝐶
0
𝑇51 = 25 𝐶

23
For all the interior nodes, putting j = 0 and i =1, 2, 3, 4 in Equation (2.16) gives the following equations

i=1

− T01 + (1 + 2 )T11 − T21 = T10


(−0.4239 100) + (1 + 2  0.4239)T11 − (0.4239T21 ) = 20
− 42.39 + 1.8478T11 − 0.4239T21 = 20

1.8478T11 − 0.4239T21 = 62.390 (2.19)

i=2

− T11 + (1 + 2 )T21 − T31 = T20

− 0.4239T11 + 1.8478T21 − 0.4239T31 = 20 (2.20)

i=3

− T21 + (1 + 2 )T31 − T41 = T30

− 0.4239T21 + 1.8478T31 − 0.4239T41 = 20 (2.21)

i=4

− T31 + (1 + 2 )T41 − T51 = T40


− 0.4239T31 + 1.8478T41 − (0.4239 25) = 20
− 0.4239T31 + 1.8478T41 − 10.598 = 20

− 0.4239T31 + 1.8478T41 = 30.598 (2.22)

The simultaneous linear equations (2.19) – (2.22) can be written in matrix form as

 1.8478 − 0.4239 0 0  T11  62.390


− 0.4239 1.8478 − 0.4239 0   1   20 
  T2  =  
 0 
− 0.4239 1.8478 − 0.4239 T3  1
 20 
  1   
 0 0 − 0.4239 1.8478  T4  30.598

The above coefficient matrix is tri-diagonal. Special algorithms such as Thomas’ algorithm can be used to
solve simultaneous linear equation with tri-diagonal coefficient matrices. The solution is given by

24
T11   39.451
 1  
T2  = 24.792
T31   21.438
 1  
T4  21.477
Hence, the temperature at all the nodes at time, t = 3 sec is

T01   100 
 1  
T1   39.451
T21  24.792
 1 =  
T3   21.438
T 1  21.477
 41   
T5   25 

Temperature at the nodes inside the rod when t=6 sec


𝑇02 = 1000 𝐶
0
𝑇52 = 25 𝐶

For all the interior nodes, putting j = 1 and i =1, 2, 3, 4 in Equation (2.16) gives the following equations

i=1

− T02 + (1 + 2 )T12 − T22 = T11


(−0.4239 100) + (1 + 2  0.4239)T12 − 0.4239T22 = 39.451
− 42.39 + 1.8478T12 − 0.4239T22 = 39.451

1.8478T12 − 0.4239T22 = 81.841 (2.23)

i=2

− T12 + (1 + 2 )T22 − T32 = T21

− 0.4239T12 + 1.8478T22 − 0.4239T32 = 24.792 (2.24)

i=3

− T22 + (1 + 2 )T32 − T42 = T31

− 0.4239T22 + 1.8478T32 − 0.4239T42 = 21.438 (2.25)

25
i=4

− T32 + (1 + 2 )T42 − T52 = T41


− 0.4239T32 + 1.8478T42 − (0.4239 25) = 21.477
− 0.4239T32 + 1.8478T42 − 10.598 = 21.477

− 0.4239T32 + 1.8478T42 = 32.075 (2.26)

The simultaneous linear equations (2.23) – (2.26) can be written in matrix form as

 1.8478 − 0.4239 0 0  T12   81.841


− 0.4239 1.8478 − 0.4239 0   2  24.792
  T2  =  
 0 − 0.4239 1.8478 − 0.4239 T32  21.438
    
 0 0 − 0.4239 1.8478  T42  32.075

The solution of the above set of simultaneous linear equation is

T12  51.326
 2  
T2  = 30.669
T32  23.876
 2  
T4  22.836
Hence, the temperature at all the nodes at time, t = 6 sec is

T02   100 
 2  
T1  51.326
T22  30.669
 2 =  
T3  23.876
T 2  22.836
 42   
T5   25 

Temperature at the nodes inside the rod when t=9 sec


𝑇03 = 1000 𝐶
0
𝑇53 = 25 𝐶

For all the interior nodes, setting j = 2 and i =1, 2, 3, 4 in Equation (2.16) gives the following equations

i=1

26
− T03 + (1 + 2 )T13 − T23 = T12
(−0.4239 100) + (1 + 2  0.4239)T13 − (0.4239T23 ) = 51.326
− 42.39 + 1.8478T13 − 0.4239T23 = 51.326

1.8478T13 − 0.4239T23 = 93.716 (2.27)

i=2

− T13 + (1 + 2 )T23 − T33 = T22

− 0.4239T13 + 1.8478T23 − 0.4239T33 = 30.669 (2.27)

i=3

− T23 + (1 + 2 )T33 − T43 = T32

− 0.4239T23 + 1.8478T33 − 0.4239T43 = 23.876 (2.28)

i=4

− T33 + (1 + 2 )T43 − T53 = T42


− 0.4239T33 + 1.8478T43 − (0.4239 25) = 22.836
− 0.4239T33 + 1.8478T43 − 10.598 = 22.836

− 0.4239T33 + 1.8478T43 = 33.434 (2.29)

The simultaneous linear equations can be written in matrix form as

 1.8478 − 0.4239 0 0  T13  93.716


− 0.4239 1.8478 − 0.4239  
 0  T23  30.669
=
 0 − 0.4239 1.8478 − 0.4239 T33  23.876
    
 0 0 − 0.4239 1.8478  T43  33.434

The solution of the above set of simultaneous linear equation is

T13  59.043
 3  
T2  = 36.292
T33  26.809
 3  
T4   24.243

Hence, the temperature at all the nodes at time, t = 9 secis

27
T03   100 
 3  
T1  59.043
T23  36.292
 3 =  
T3  26.809
T 3   24.243
 43   
T5   25 
To better visualize the temperature variation at different locations at different times, the temperature
distribution along the length of the rod at different times is plotted in Figure 6.

Temperature distribution along the length of the rod


Temperature , T (oC)

t=3 secs
t= 6 secs
t= 9 secs

Location on rod, x(m)

Figure 2.6: Temperature distribution in rod from implicit method

2.8 Crank-Nicolson Method


The Crank-Nicolson method provides an alternative scheme to implicit method. The accuracy of Crank-
 2T
Nicolson method is same in both space and time. In the implicit method, the approximation of is
x 2
T
of O(x) 2 accuracy, while the approximation for is of ( t ) accuracy. The accuracy in the Crank-
t
Nicolson method is achieved by approximating the derivative at the mid point of time step. To
numerically solve PDEs such as the parabolic type, one can use finite difference approximations of the
partial derivatives. The left hand side of the second derivative is approximated at node i as the average
value of the central divided difference approximation at time level j + 1 and time level j .

28
 2T 1  Ti +j1 − 2Ti j + Ti −j1 Ti +j1+1 − 2Ti j +1 + Ti −j1+1 
  +  (2.30)
x 2 i, j
2 (x )2 (x )2 

The first derivative on the right side of Equation (2) is approximated using forward divided difference
approximation at time level j + 1 and node i as

T Ti j +1 − Ti j
 (2.31)
t i, j t

1  Ti +j1 − 2Ti j + Ti −j1 Ti +j1+1 − 2Ti j +1 + Ti −j1+1  Ti j +1 − Ti j


•  + = (2.32)
2 (x )2 (x )2  t

giving

− Ti −j1+1 + 2(1 +  )Ti j +1 − Ti +j1+1 = Ti −j1 + 2(1 −  )Ti j + Ti +j1 (2.33)

where

t
 =
(x )2
Now Equation (2.33) is written for all nodes (except the external nodes). This will result in simultaneous
linear equations that can be solved to find the temperature at a particular time.

Example 3
A rod of steel is subjected to a temperature of 100C on the left end and 25C on the right end. If the
rod is of length 0.05m , use Crank-Nicolson method to find the temperature distribution in the rod from
t = 0 to t = 9 seconds. Use x = 0.01m , t = 3s .
Given

W kg J
k = 54 ,  = 7800 3 , C = 490
m−K m kg − K

The initial temperature of the rod is 20C .

Solution
k 54
= = = 1.412910−5 m 2 / s
C 7800 490
Then

t
 =
(x )2

29
3
= 1.412 10−5 = 0.4239
(0.01)2

i=0 1 2 3 4 5

0.01m

Figure 2.7: Schematic diagram showing the node representation in the model

The boundary conditions are

T0 j = 100C 
 for j = 0,1,2,3 (2.34)
T5 j = 25C 

The initial temperature of the rod is 20C , that is, all the temperatures of the nodes inside the rod are
at 20C at, t = 0 except for the boundary nodes given by Equation (2.34). This could be represented as

Ti 0 = 20C, for i = 1,2,3,4 . (2.35)

Initial temperature at the nodes inside the rod (when t=0 sec)
𝑇00 = 1000 𝐶

𝑇10 = 200 𝐶

𝑇20 = 200 𝐶

𝑇30 = 200 𝐶

𝑇40 = 200 𝐶

𝑇50 = 250 𝐶

Temperature at the nodes inside the rod when t=3 sec


𝑇01 = 1000 𝐶
𝑇51 = 250 𝐶

30
For all the interior nodes, setting j = 0 and i =1, 2, 3, 4 in Equation (2.33) gives the following equations

i=1

− T01 + 2(1 +  )T11 − T21 = T00 + 2(1 −  )T10 + T20


(−0.4239 100) + 2(1 + 0.4239)T11 − 0.4239T21 = (0.4239)100 + 2(1 − 0.4239)20 + (0.4239)20
− 42.39 + 2.8478T11 − 0.4239T21 = 42.39 + 23.044 + 8.478
2.8478T11 − 0.4239T21 = 116.30 (2.36)

i=2

− T11 + 2(1 +  )T21 − T31 = T10 + 2(1 −  )T20 + T30


− 0.4239T11 + 2(1 + 0.4239)T21 − 0.4239T31 = (0.4239)20 + 2(1 − 0.4239)20 + (0.4239)20

− 0.4239T11 + 2.8478T21 − 0.4239T31 = 40.000 (2.37)

i=3

− T21 + 2(1 +  )T31 − T41 = T20 + 2(1 −  )T30 + T40


− 0.4239T21 + 2(1 + 0.4239)T31 − 0.4239T41 = (0.4239)20 + 2(1 − 0.4239)20 + (0.4239)20

− 0.4239T21 + 2.8478T31 − 0.4239T41 = 40.000 (2.38)

i=4

− T31 + 2(1 +  )T41 − T51 = T30 + 2(1 −  )T40 + T50


− 0.4239T31 + 2(1 + 0.4239)T41 − (0.4239)25 = (0.4239)20 + 2(1 − 0.4239)20 + (0.4239)25
− 0.4239T31 + 2.8478T41 − 10.598 = 8.478 + 23.044 + 10.598
− 0.4239T31 + 2.8478T41 = 52.718 (2.39)

The coefficient matrix in the above set of equations is tridiagonal. Special algorithms such as Thomas’
algorithm are used to solve equation with tridiagonal coefficient matrices

 2.8478 − 0.4239 0 0  T11  116.30


− 0.4239 2.8478 − 0.4239  
 0  T21  40.000
=
 0 − 0.4239 2.8478 − 0.4239 T31  40.000
    
 0 0 − 0.4239 2.8478  T41  52.718

The above matrix is tridiagonal. Solving the above matrix we get

31
T11  44.372
 1  
T2  = 23.746
T31  20.797
 1  
T4  21.607
Hence, the temperature at all the nodes at time, t = 3 sec is

T01   100 
 1  
T1  44.372
T21  23.746
 1 =  
T3  20.797
T 1  21.607
 41   
T5   25 

Temperature at the nodes inside the rod when t=6 sec


𝑇02 = 1000 𝐶
𝑇52 = 250 𝐶

For all the interior nodes, putting j = 1 and i =1, 2, 3, 4 in Equation (2.33) gives the following equations

i=1

− T02 + 2(1 +  )T12 − T22 = T01 + 2(1 −  )T11 + T21


(−0.4239 100) + 2(1 + 0.4239)T12 − 0.4239T22 =
(0.4239)100 + 2(1 − 0.4239)44.372 + (0.4239)23.746
− 42.39 + 2.8478T12 − 0.4239T22 = 42.39 + 51.125 + 10.066
2.8478T12 − 0.4239T22 = 145.971 (2.40)

i=2

− T12 + 2(1 +  )T22 − T32 = T11 + 2(1 −  )T21 + T31


− 0.4239T12 + 2(1 + 0.4239)T22 − 0.4239T32 =
(0.4239)44.372 + 2(1 − 0.4239)23.746 + (0.4239)20.797
− 0.4239T12 + 2.8478T22 − 0.4239T32 = 18.809 + 27.360 + 8.8158
− 0.4239T12 + 2.8478T22 − 0.4239T32 = 54.985 (2.41)

i=3

32
− T22 + 2(1 +  )T32 − T42 = T21 + 2(1 −  )T31 + T41
− 0.4239T22 + 2(1 + 0.4239)T32 − 0.4239T42 =
(0.4239)23.746 + 2(1 − 0.4239)20.797 + (0.4239)21.607
− 0.4239T22 + 2.8478T32 − 0.4239T42 = 10.066 + 23.962 + 9.1592
− 0.4239T22 + 2.8478T32 − 0.4239T42 = 43.187 (2.42)

i=4

− T32 + 2(1 +  )T42 − T52 = T31 + 2(1 −  )T41 + T51


− 0.4239T32 + 2(1 + 0.4239)T42 − (0.4239)25 =
(0.4239)20.797 + 2(1 − 0.4239)21.607 + (0.4239)25
− 0.4239T32 + 2.8478T42 − 10.598 = 8.8158 + 24.896 + 10.598
− 0.4239T32 + 2.8478T42 = 54.908 (2.43)

 2.8478 − 0.4239 0 0  T12  145.971


− 0.4239 2.8478 − 0.4239  
 0  T22   54.985 
=
 0 − 0.4239 2.8478 − 0.4239 T32   43.187 
    
 0 0 − 0.4239 2.8478  T42   54.908 

Solving the above set of equations, we get

T12  55.883
 2  
T2  = 31.075
T32  23.174
 2  
T4  22.730

Hence, the temperature at all the nodes at time, t = 6 sec is

T02   100 
 2  
T1  55.883
T22  31.075
 2 =  
T3  23.174
T 2  22.730
 42   
T5   25 

Temperature at the nodes inside the rod when t=9 sec


𝑇03 = 1000 𝐶
0
𝑇53 = 25 𝐶

33
For all the interior nodes, setting j = 2 and i =1, 2, 3, 4 in Equation (2.33) gives the following equations

i=1

− T03 + 2(1 +  )T13 − T23 = T02 + 2(1 −  )T12 + T22


(−0.4239 100) + 2(1 + 0.4239)T13 − 0.4239T23 =
(0.4239)100 + 2(1 − 0.4239)55.883 + (0.4239)31.075
− 42.39 + 2.8478T13 − 0.4239T23 = 42.39 + 64.388 + 13.173
2.8478T13 − 0.4239T23 = 162.34 (2.44)

i=2

− T13 + 2(1 +  )T23 − T33 = T12 + 2(1 −  )T22 + T32


− 0.4239T13 + 2(1 + 0.4239)T23 − 0.4239T33 =
(0.4239)55.883 + 2(1 − 0.4239)31.075 + (0.4239)23.174
− 0.4239T + 2.8478T23 − 0.4239T33 = 23.689 + 35.805 + 9.8235
1
3

− 0.4239T13 + 2.8478T23 − 0.4239T33 = 69.318 (2.45)

i=3

− T23 + 2(1 +  )T33 − T43 = T22 + 2(1 −  )T32 + T42


− 0.4239T23 + 2(1 + 0.4239)T33 − 0.4239T43 =
(0.4239)31.075 + 2(1 − 0.4239)23.174 + (0.4239)22.730
− 0.4239T + 2.8478T33 − 0.4239T43 = 13.173 + 26.701+ 9.635
2
3

− 0.4239T23 + 2.8478T33 − 0.4239T43 = 49.509 (2.46)

i=4

− T33 + 2(1 +  )T43 − T53 = T32 + 2(1 −  )T42 + T52


− 0.4239T33 + 2(1 + 0.4239)T43 − (0.4239)25 =
(0.4239)23.174 + 2(1 − 0.4239)22.730 + (0.4239)25
− 0.4239T33 + 2.8478T43 − 10.598 = 9.8235 + 26.190 + 10.598
− 0.4239T33 + 2.8478T43 = 57.210 (2.47)

 2.8478 − 0.4239 0 0  T13  162.34


− 0.4239 2.8478 − 0.4239  
 0  T23  69.318
=
 0 − 0.4239 2.8478 − 0.4239 T33  49.509
    
 0 0 − 0.4239 2.8478  T43  57.210

Solving the above set of equations, we get

34
T13  62.604
 3  
T2  = 37.613
T33  26.562
 3  
T4  24.042
Hence, the temperature at all the nodes at time, t = 9 secis

T03   100 
 3  
T1  62.604
T23  37.613
 3 =  
T3  26.562
T 3  24.042
 43   
T5   25 

To better visualize the temperature variation at different locations at different times, the temperature
distribution along the length of the rod at different times is plotted in Figure 2.8.

Temperature distribution along the length of the rod


Temperature, T (oC)

t=3 secs
t= 6 secs
t= 9 secs

Location on rod, x(m)

Figure 2.8: Temperature distribution in rod from Crank-Nicolson method

35
2.9 Analytical Method
The parabolic heat conduction equation is formulated as

 2T T
 = 0  x  0.05, t  0
x 2 t
with boundary conditions

T = 100C at x = 0, t  0 (2.48)

T = 25C at x = 0.05, t  0 (2.49)

and initial conditions

T = 20C at t = 0, 0  x  0.05 (2.50)

We split the problem into a steady state problem and a transient (homogeneous) problem. The
solutions of the steady state problem and transient problem are found separately and by applying the
principle of superposition, the final solution would be obtained. This formulation can be represented as

T ( x, t ) = Ts ( x) + Th ( x, t ) (2.51)

where

Ts = solution for steady state problem,

Th = solution for transient problem.

2.9.1 Steady State Solution


T
Since the temperature at steady state is not changing, = 0 , the steady state problem is formulated
t
as

d 2Ts
= 0, 0  x  0.05 (2.52)
dx 2
with boundary conditions

Ts = 100C at x = 0 (2.53)

Ts = 25C at x = 0.05 (2.54)

The solution to Equation (2.52) is given by integrating it on both sides to give

dTs
=A
dx
where A is a constant of integration and by integrating again to give

Ts = Ax + B (2.55)

36
where B is another constant of integration. By substituting the boundary condition (2.53), we obtain

A(0) + B = 100
B = 100
By substituting the boundary condition (2.54), we obtain

A(0.05) + 100 = 25
− 75
A=
0.05
= −1500

Plugging back the values of A and B in Equation (2.55), we get the steady state solution as

Ts = −1500x + 100 (2.56)

2.9.2 Transient Solution


The transient problem is formulated as

 2Th Th
 = , 0  x  0.05 (2.57)
x 2 t
with boundary conditions

Th = 0C at x = 0 (2.58)

Th = 0C at x = 0.05 (2.59)

Note: from Equation (2.51),

T ( x, t ) = Ts ( x) + Th ( x, t )

and by substituting Equations (2.53) and (2.54), the boundary conditions of Th are obtained.

Initial conditions for the transient problem are hence given by

Th = 20 − Ts , t = 0, 0  x  0.05

= 20 − (−1500x + 100)

= 20 + 1500x − 100

= 1500x − 80, t = 0, 0  x  0.05 (2.60)

To obtain solution for the transient problem, let us assume Th ( x, t ) is function of the product of a
spatial function and a temperature function. That is

Th ( x, t ) = X ( x). (t ) (2.61)

37
Substituting Equation (2.61) in Equation (2.57), we get

d2X d
 2
=X
dx dt

1 d2X 1 d
= (2.62)
X dx 2
 dt
The left hand side of Equation (2.62) represents the spatial term and the right hand side represents the
temporal (time) term. We will attempt to find the solutions of the spatial and temporal term
independently. To do so, let us assume that both the left hand side and the right hand side of the
Equation (2.62) is equal to a constant −  2 (say)

1 d2X 1 d
= = − 2 (2.63)
X dx 2
 dt

2.9.3 Spatial solution

Taking just the spatial term from Equation (2.63), we have

1 d2X
2
= − 2
X dx

d2X
+  2X = 0 (2.64)
dx 2
The Equation (2.64) is a homogeneous second order ordinary differential equation. These type of
equations have the solution of the form X ( x) = e mx . Substituting X ( x) = e mx in Equation (2.64) we
get,

m 2 e mx +  2 e mx = 0
e mx (m 2 +  2 ) = 0

m2 +  2 = 0

m1 , m2 = i , − i

From the values of m1 and m2 , the solution of X (x ) is written of the form

X ( x) = C cos(x) + D sin(x) (2.65)

Temporal solution

Taking just the temporal term from Equation (2.63), we have

38
1 d
= − 2
 dt
d
+  2 = 0 (2.66)
dt
The above equation is a homogeneous first order ordinary differential equation. These type of equations
have the solution of the form  (t ) = e mt . Substituting  (t ) = e mt in Equation (2.66) we get

me mt +  2 e mt = 0
e mt (m +  2 ) = 0

m +  2 = 0

m = − 2

From the value of m , the solution of  (t ) is written as

 (t ) = Ee −
2
t
(2.66)

Substituting Equations (2.65) and (2.66) in Equation (2.61), we have

Th ( x, t ) = Ee − t C cos(x) + D sin(x)


2

Th ( x, t ) = e − t F cos( x) + G sin( x)


2
(2.67)

Substituting boundary condition represented by Equation (2.58) in Equation (2.67) gives

e − t F cos( .0) + G sin( .0) = 0


2

e − t F .1 + G.0 = 0
2

e − t [ F ] = 0
2

Since, e − cannot be zero, F = 0 . Now substituting F = 0 in Equation (2.67) gives


2
t

Th ( x, t ) = Ge − t sin( x)
2
(2.68)

Substituting boundary condition represented by Equation (2.59) in Equation (2.68) gives

Ge − t sin(0.4 ) = 0
2

sin(0.05 ) = 0

0.05 = n

39
n
= = 20n
0.05
Substituting the value of  in Equation (2.68) gives

Th ( x, t ) = Ge − ( 20 n ) t sin(20nx)
2

As the general solution can have any value of n ,



Th ( x, t ) =  Gn e − ( 20n ) t sin(20nx)
2
(2.69)
n =1

Substituting the initial condition

Th ( x,0) = (1500x − 80)C

from Equation (2.60) in Equation (2.69)


G
n =1
n sin(20nx) = 1500x − 80

Multiplying both sides by sin(20mx ) and integrating from 0 to 0.05 gives

 0.05 0.05


n =1 0
 Gn sin(20nx) sin(20mx)dx =  (1500x − 80) sin(20mx)dx
0
 0.05 0.05
Gn

n =1 2
 2 sin(20nx) sin(20mx)dx =  (1500x − 80) sin(20mx)dx
0 0

Gn  0.05 0.05

   cos(20(m − n)x)dx −
n =1 2  0
 cos(20(m + n)x)dx =
0
0.05 0.05
1500  x sin(20mx)dx −  80 sin(20mx)dx
0 0

Substituting the following in the above equation,


0.05

 cos(20(m − n)x)dx = 0 ,
0
mn

0.05

 cos(20(m − n)x)dx = 0.05,


0
m=n

0.05

 cos(20(m + n)x)dx = 0,
0
for any m

we get

40
0.05 0.05
Gm
0.05 = 1500  x sin(20mx)dx −  80 sin(20mx)dx
2 0 0

 − x cos(20m )  0.05 1
0.05
 0.05
= 1500
 20m 
0
+
20m 0 cos(20m ) dx

− 80 0 sin(20m )dx

 − x cos(20m )  0.05 1
0.05
 0.05
= 1500
 20m 
0
+
20m 0 cos(20m ) dx

− 80 0 sin(20m )dx

 − 0.05 cos(m ) + 0   (−1) m − 1


= 1500  + 80 
 20m  20m 

Gm =
− 150(−1) m 160
m
+
m

(−1) m − 1 
10(−1) m − 160
= (2.70)
m
Substituting Equation (2.70) in Equation (2.69), we get

10(−1) m − 160 − 2.5 m 2 t
Th ( x, t ) =   e sin(2.5mx) (2.71)
m =1  m 
Substituting Equations (2.71) and (2.56) in Equation (2.51) we have

10(−1) m − 160 − 20 m 2 t
T ( x, t ) = −1500x + 100 +   e sin(20mx) (2.72)
m =1  m 
Now

k
=
C
54
=
7800 490

= 1.4129 10−5 m 2 / s

and substituting the value of  in Equation (2.71) gives



10(−1) m − 160 −1.412910−5 20 m 2 t
T ( x, t ) = −1500x + 100 +   e sin(20mx) (2.73)
m =1  m 

41
Equation (2.73) is the analytical solution of the problem. Substituting the values of x and t gives the
temperature inside the rod at a particular location and time. For example using the analytical solution,
we will find the temperature of the rod at the first node, that is, x = 0.01m when t = 9 secs.

10(−1) m − 160 −1.412910−5 [ 20 m ]2 9



T (0.01,9) = −1500(0.01) + 100 +   e sin(0.2m )
m=1  m 
= 62.510C

Similarly using Equation (2.73), the temperature of the rod at any location at any time can be found by
substituting the corresponding values of x and t .

Comparison of the three numerical methods


To compare all three numerical methods with the analytical solution, the temperature values obtained
at all the interior nodes at time, t = 9 sec are presented in the Table 1. From Table 1, it is clear that
among the numerical methods used to solve partial differential equations, Crank-Nicolson method
provides better accuracy compared to the other two numerical methods (Explicit Method and Implicit
Method) explained in this chapter.

Table 1: Comparison of temperature obtained at interior nodes using different methods discussed
in this chapter (absolute true error is given in parenthesis)

Explicit Implicit Crank-Nicolson Analytical


Temperature
Method Method Method Solution
at Nodes
( C ) ( C ) ( C ) ( C )

T13 65.953(3.443) 59.043(3.467) 62.604(0.094) 62.510

T23 39.132(2.048) 36.292(0.792) 37.613(0.529) 37.084

T33 27.266(1.422) 26.809(0.965) 26.562(0.282) 25.844

T43 22.872(0.738) 24.243(0.633) 24.042(0.432) 23.610

42
Chapter Three
Elliptic Partial Differential Equations

3.1 The Direct Method of Solving Elliptic PDEs


Let’s find the solution via a specific physical example. Take a rectangular plate as shown in Figure3.1 where
each side of the plate is maintained at a specific temperature. We are interested in finding the
temperature within the plate at steady state. No heat sinks or sources exist in the problem.
y

Tt

W Tl Tr

x
Tb
L

Figure 3.1: Schematic diagram of the plate with the temperature boundary conditions
The partial differential equation that governs the temperature T ( x, y ) is given by

 2T  2T
+ =0 (3.1)
x 2 y 2

To find the temperature within the plate, we divide the plate area by a grid as shown in Figure 3.2.

43
y
Tt
(0, n)
x

y Tr
Tl (i, j )

x
(0,0)
Tb (m,0)

(i, j + 1)
y x

(i − 1, j ) (i, j ) (i + 1, j )

(i, j − 1)

Figure 3.2: Plate area divided into a grid


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

L
x = (3.2)
m
W
y = (3.3)
n
Now we will apply the finite difference approximation of the partial derivatives at a general interior node
( i, j ).

 2T Ti +1, j − 2Ti , j + Ti −1, j


 (3.4)
x 2 i, j (x )2
 2T Ti , j +1 − 2Ti , j + Ti , j −1
 (3.5)
y 2 i, j (y )2

44
Equations (3.4) and (3.5) are central divided difference approximations of the second derivatives.
Substituting Equations (3.4) and (3.5) in Equation (3.1), we get

Ti +1, j − 2Ti , j + Ti −1, j Ti , j +1 − 2Ti , j + Ti , j −1


+ =0 (3.6)
(x ) 2
(y )2
For a grid with

 x = y

Equation (3.6) can be simplified as

Ti +1, j + Ti −1, j + Ti , j +1 + Ti , j −1 − 4Ti , j = 0 (3.7)

Now we can write this equation at all the interior nodes of the plate, that is (m − 1)  (n − 1) nodes. This
will result in an equal number of equations and unknowns. The unknowns are the temperatures at the
interior (m − 1)  (n − 1) nodes. Solving these equations will give us the two-dimensional profile of the
temperature inside the plate.

Example 1
A plate 2.4 m  3.0 m is subjected to temperatures as shown in Figure 3.3. Use a square grid length of
0.6 m . Using the direct method, find the temperature at the interior nodes.
y
300 C

75 C
3 .0 m 100 C

x
50 C
2 .4 m

Figure 3.3: Plate with dimension and boundary temperatures

Solution
x =  y = 0 . 6 m

Re-writing Equations (3.2) and (3.3) we have

45
L 2 .4
m= = =4
x 0 .6
W
n=
y
3
=
0 .6
=5

The nodes are shown in Figure 3.4.


y

T 0,5 T1,5 T2,5 T3,5 T4,5

T0, 4
T1, 4 T2, 4 T3, 4 T4, 4
T0,3
T1,3 T2,3 T3,3 T4,3
T0, 2
T1, 2 T2, 2 T3, 2 T4, 2

T0,1 T1,1 T2,1 T3,1 T4,1


x
T0, 0 T1, 0 T2, 0 T3,0 T4, 0

Figure 3.4: Plate with nodes

All the nodes on the left and right boundary have an i value of zero and m , respectively. While all the
nodes on the top and bottom boundary have a j value of zero and n , respectively.

From the boundary conditions

T0, j = 75, j = 1,2,3,4 



T4, j = 100, j = 1,2,3,4
 (3.8)
Ti , 0 = 50, i = 1,2,3 
Ti ,5 = 300, i = 1,2,3 

The corner nodal temperature of T0,5 , T4,5 , T4,0 and T0,0 are not needed. Now to get the temperature at
the interior nodes we have to write Equation (3.7) for all the combinations of i and j,
i = 1,...., m − 1; j = 1,...., n − 1 .

46
i=1 and j=1
T2,1 + T0,1 + T1, 2 + T1,0 − 4T1,1 = 0

T2,1 + 75 + T1, 2 + 50 − 4T1,1 = 0

− 4T1,1 + T1, 2 + T2,1 = −125 (3.8)

i=1 and j=2


T2, 2 + T0, 2 + T1,3 + T1,1 − 4T1, 2 = 0

T2, 2 + 75 + T1,3 + T1,1 − 4T1, 2 = 0

T1,1 − 4T1, 2 + T1,3 + T2, 2 = −75 (3.9)

i=1 and j=3


T2,3 + T0,3 + T1, 4 + T1, 2 − 4T1,3 = 0

T2,3 + 75 + T1, 4 + T1, 2 − 4T1,3 = 0

T1, 2 − 4T1,3 + T1, 4 + T2,3 = −75 (3.10)

i=1 and j=4


T2, 4 + T0, 4 + T1,5 + T1,3 − 4T1, 4 = 0

T2, 4 + 75 + 300 + T1,3 − 4T1, 4 = 0

T1,3 − 4T1, 4 + T2, 4 = −375 (3.11)

i=2 and j=1


T3,1 + T1,1 + T2, 2 + T2,0 − 4T2,1 = 0

T3,1 + T1,1 + T2, 2 + 50 − 4T2,1 = 0

T1,1 − 4T2,1 + T2, 2 + T3,1 = −50 (3.12)

i=2 and j=2


T3, 2 + T1, 2 + T2,3 + T2,1 − 4T2, 2 = 0

T1, 2 + T2,1 − 4T2, 2 + T2,3 + T3, 2 = 0 (3.13)

i=2 and j=3


T3,3 + T1,3 + T2, 4 + T2, 2 − 4T2,3 = 0

T1,3 + T2, 2 − 4T2,3 + T2, 4 + T3,3 = 0 (3.14)

47
i=2 and j=4
T3, 4 + T1, 4 + T2,5 + T2,3 − 4T2, 4 = 0

T3, 4 + T1, 4 + 300 + T2,3 − 4T2, 4 = 0

T1, 4 + T2,3 − 4T2, 4 + T3, 4 = −300 (3.15)

i=3 and j=1


T4,1 + T2,1 + T3, 2 + T3,0 − 4T3,1 = 0

100 + T2,1 + T3, 2 + 50 − 4T3,1 = 0

T2,1 − 4T3,1 + T3, 2 = −150 (3.16)

i=3 and j=2


T4, 2 + T2, 2 + T3,3 + T3,1 − 4T3, 2 = 0

100 + T2, 2 + T3,3 + T3,1 − 4T3, 2 = 0

T2, 2 + T3,1 − 4T3, 2 + T3,3 = −100 (3.17)

i=3 and j=3


T4,3 + T2,3 + T3, 4 + T3, 2 − 4T3,3 = 0

100 + T2,3 + T3, 4 + T3, 2 − 4T3,3 = 0

T2,3 + T3, 2 − 4T3,3 + T3, 4 = −100 (3.18)

i=3 and j=4


T4, 4 + T2, 4 + T3,5 + T3,3 − 4T3, 4 = 0

100 + T2, 4 + 300 + T3,3 − 4T3, 4 = 0

T2, 4 + T3,3 − 4T3, 4 = −400 (3.19)

Equations (3.8) to (3.19) represent a set of twelve simultaneous linear equations and solving them gives
the temperature at the twelve interior nodes. The solution is

48
 T1,1  73.8924
T   
 1, 2  93.0252
 T1,3  119.907
   
T1, 4  173.355
T2,1  77.5443
   
T2, 2  103.302
T  = 138.248 C
 2,3   
T2, 4  198.512
 T  82.9833
 3,1   
T3, 2  104.389
   
T3,3  131.271
T3, 4  182.446

300 300 300

75 100
173 199 182

75 100
120 138 131

75 100
93 103 104

75 74 78 83 100

x
50 50 50
Figure 3.5: Temperatures at the interior nodes of the plate

3.2 Gauss-Seidel Method


To take advantage of the sparseness of the coefficient matrix as seen in Example 1, the Gauss-Seidel
method may provide a more efficient way of finding the solution. In this case, Equation 3.7) is written for
all interior nodes as

49
Ti +1, j + Ti −1, j + Ti , j +1 + Ti , j −1
Ti , j = , i = 1,2,3,4; j = 1,2,3,4,5 (3.20)
4
Now Equation (3.20) is solved iteratively for all interior nodes until all the temperatures at the interior
nodes are within a pre-specified tolerance.

Example 2
A plate 2.4 m  3.0 m is subjected to the temperatures as shown in Fig. 3.6. Use a square grid length of
0.6 m . Using the Gauss-Seidel method, find the temperature at the interior nodes. Conduct two iterations
at all interior nodes. Find the maximum absolute relative error at the end of the second iteration. Assume
the initial temperature at all interior nodes to be 0 C .
y

300 C

75 C
3 .0 m 100 C

x
50 C

2 .4 m

Figure 3.6: A rectangular plate with the dimensions and boundary temperatures

Solution
x =  y = 0 . 6 m

Re-writing Equations (3.2) and (3.3) we have

L 2 .4
m= = =4
x 0 .6
W
n=
y

50
3
=
0 .6
=5

The interior nodes are shown in Figure 3.7.


y

T 0,5 T1,5 T2,5 T3,5 T4,5

T0, 4
T1, 4 T2, 4 T3, 4 T4, 4
T0,3
T1,3 T2,3 T3,3 T4,3
T0, 2
T1, 2 T2, 2 T3, 2 T4, 2

T0,1 T1,1 T2,1 T3,1 T4,1


x
T0, 0 T1, 0 T2, 0 T3,0 T4, 0

Figure 3.7: Plate with nodes

All the nodes on the left and right boundary have an i value of zero and m , respectively. All of the nodes
on the top or bottom boundary have a j value of either zero or n , respectively.

From the boundary conditions

T0, j = 75, j = 1,2,3,4 



T4, j = 100, j = 1,2,3,4
 (3.21)
Ti , 0 = 50, i = 1,2,3 
Ti ,5 = 300, i = 1,2,3 

The corner nodal temperature of T0,5 , T4,5 , T4,0 and T0,0 are not needed. Now to get the temperature at
the interior nodes we have to write Equation (3.20) for all of the combinations of i and j ,
i = 1,...., m − 1; j = 1,..., n − 1 .

Iteration 1
For iteration 1, we start with all of the interior nodes having a temperature of 0C .

i=1 and j=1

51
T2,1 + T0,1 + T1, 2 + T1, 0
T1,1 =
4
0 + 75 + 0 + 50
=
4
= 31.2500C

i=1 and j=2


T + T0, 2 + T1,3 + T1,1
T1, 2 = 2, 2
4
0 + 75 + 0 + 31.2500
=
4
= 26.5625C

i=1 and j=3


T + T0,3 + T1, 4 + T1, 2
T1,3 = 2,3
4
0 + 75 + 0 + 26.5625
=
4
= 25.3906C

i=1 and j=4


T +T +T +T
T1, 4 = 2, 4 0, 4 1,5 1,3
4
0 + 75 + 300 + 25.3906
=
4
= 100.098C

i=2 and j=1


T + T + T + T2,0
T2,1 = 3,1 1,1 2, 2
4
0 + 31.2500 + 0 + 50
=
4
= 20.3125C

i=2 and j=2

52
T3, 2 + T1, 2 + T2,3 + T2,1
T2, 2 =
4
0 + 26.5625 + 0 + 20.3125
=
4
= 11.7188C

i=2 and j=3


T + T + T2, 4 + T2, 2
T2,3 = 3,3 1,3
4
0 + 25.3906 + 0 + 11.7188
=
4
= 9.27735C

i=2 and j=4


T + T + T2,5 + T2,3
T2, 4 = 3, 4 1, 4
4
0 + 100.098 + 300 + 9.27735
=
4
= 102.344C

i=3 and j=1


T4,1 + T2,1 + T3, 2 + T3, 0
T3,1 =
4
100 + 20.3125 + 0 + 50
=
4
= 42.5781C

i=3 and j=2


T + T2, 2 + T3,3 + T3,1
T3, 2 = 4, 2
4
100 + 11.7188 + 0 + 42.5781
=
4
= 38.5742C

i=3 and j=3

53
T4,3 + T2,3 + T3, 4 + T3, 2
T3,3 =
4
100 + 9.27735+ 0 + 38.5742
=
4
= 36.9629C

i=3 and j=4


T + T2, 4 + T3,5 + T3,3
T3, 4 = 4, 4
4
100 + 102.344 + 300 + 36.9629
=
4
= 134.827C

Iteration 2
For iteration 2, we use the temperatures from iteration 1.

i=1 and j=1


T +T +T +T
T1,1 = 2,1 0,1 1, 2 1, 0
4
20.3125 + 75 + 26.5625 + 50
=
4
= 42.9688C

T1,present − T1,previous
 a 1,1 = 1
present
1
100
T1,1
42.9688 − 31.2500
= 100
42.9688
= 27.27%

i=1 and j=2


T + T0, 2 + T1,3 + T1,1
T1, 2 = 2, 2
4
11.7188 + 75 + 25.3906 + 42.9688
=
4
= 38.7696C

54
T1,present − T1,previous
 a 1, 2 = 2
present
2
100
T1, 2
38.7696 − 26.5625
= 100
38.7696
= 31.49%

i=1 and j=3


T + T0,3 + T1, 4 + T1, 2
T1,3 = 2,3
4
9.27735+ 75 + 100.098 + 38.7696
=
4
= 55.7862C

T1,present − T1,previous
 a 1,3 = 3
present
3
100
T1,3
55.7862 − 25.3906
= 100
55.7862
= 54.49%

i=1 and j=4


T2, 4 + T0, 4 + T1,5 + T1,3
T1, 4 =
4
102.344 + 75 + 300 + 55.7862
=
4
= 133.283C

T1,present − T1,previous
 a 1, 4 = 4 4
100
T1,present
4

133.283 − 100.098
= 100
133.283
= 24.90%

i=2 and j=1


T + T + T + T2,0
T2,1 = 3,1 1,1 2, 2
4

55
42.5781+ 42.9688 + 11.7188 + 50
=
4
= 36.8164C

T2present − T2previous
 a 2,1 = ,1 ,1
100
T2present
,1

36.8164 − 20.3125
= 100
36.8164
= 44.83%

i=2 and j=2


T + T + T2,3 + T2,1
T2, 2 = 3, 2 1, 2
4
38.5742 + 38.7696 + 9.27735+ 36.8164
=
4
= 30.8594C

T2present − T2previous
 a 2, 2 = ,2
present
,2
 100
T2, 2
30.8594 − 11.7188
=  100
30.8594
= 62.03%

i=2 and j=3


T + T + T2, 4 + T2, 2
T2,3 = 3,3 1,3
4
36.9629 + 55.7862 + 102.344 + 30.8594
=
4
= 56.4881C

T2present − T2previous
 a 2,3 = ,3
present
,3
 100
T2,3
56.4881− 9.27735
=  100
56.4881
= 83.58%

i=2 and j=4


56
T3, 4 + T1, 4 + T2,5 + T2,3
T2, 4 =
4
134.827 + 133.283 + 300 + 56.4881
=
4
= 156.150C

T2present − T2previous
 a 2, 4 = ,4
present
,4
 100
T2, 4
156.150 − 102.344
=  100
156.150
= 34.46%

i=3 and j=1


T +T +T +T
T3,1 = 4,1 2,1 3, 2 3, 0
4
100 + 36.8164 + 38.5742 + 50
=
4
= 56.3477C

T3present − T3previous
 a 3,1 = ,1 ,1
present
 100
T3,1
56.3477 − 42.5781
=  100
56.3477
= 24.44%

i=3 and j=2


T + T2, 2 + T3,3 + T3,1
T3, 2 = 4, 2
4
100 + 30.8594 + 36.9629 + 56.3477
=
4
= 56.0425C

57
T3present − T3previous
 a 3, 2 = ,2 ,2
present
 100
T3, 2
56.0425 − 38.5742
=  100
56.0425
= 31.70%

i=3 and j=3


T4,3 + T2,3 + T3, 4 + T3, 2
T3,3 =
4
100 + 56.4881+ 134.827 + 56.0425
=
4
= 86.8394C

T3present − T3previous
 a 3, 3 = ,3 ,3
present
 100
T3,3
86.8394 − 36.9629
=  100
86.8394
= 57.44%

i=3 and j=4


T +T +T +T
T3, 4 = 4, 4 2, 4 3,5 3,3
4
100 + 156.150 + 300 + 86.8394
=
4
= 160.747C

T3present − T3previous
 a 3, 4 = ,4 ,4
present
 100
T3, 4
160.747 − 134.827
=  100
160.747
= 16.12%

The maximum absolute relative error at the end of iteration 2 is 83% .

58
y

300 300 300

75
133 156 161 100
75
56 56 87 100
75
39 31 56 100
75
43 37 56 100
x
50 50 50

Figure 3.8: Temperature distribution after two iterations

It took ten iterations to get all of the temperature values within 1% error. The table below lists the
temperature values at the interior nodes at the end of each iteration:

Node Number of Iterations

1 2 3 4 5

T1,1 31.2500 42.9688 50.1465 56.1966 61.6376

T1, 2 26.5625 38.7695 52.9480 65.9264 76.5753

T1,3 25.3906 55.7861 79.4296 96.8614 106.8163

T1, 4 100.0977 133.2825 152.6447 162.1695 167.1287

T2,1 20.3125 36.8164 46.8384 55.6240 63.6980

T2, 2 11.7188 30.8594 53.0792 72.8024 85.3707

T2,3 9.2773 56.4880 93.8744 113.5205 124.2410

T2, 4 102.3438 156.1493 176.8166 186.6986 191.8910

T3,1 42.5781 56.3477 63.2202 70.3522 75.3468

59
T3, 2 38.5742 56.0425 75.7847 87.6890 94.6990

T3,3 36.9629 86.8393 107.6015 118.0785 123.7836

T3, 4 134.8267 160.7471 171.1045 176.1943 178.9186

Node Number of Iterations

6 7 8 9 10

T1,1 66.3183 69.4088 71.2832 72.3848 73.0239

T1, 2 83.3763 87.4348 89.8017 91.1701 91.9585

T1,3 112.4365 115.6295 117.4532 118.4980 119.0976

T1, 4 169.8319 171.3450 172.2037 172.6943 172.9755

T2,1 69.2590 72.6980 74.7374 75.9256 76.6127

T2, 2 92.8938 97.2939 99.8423 102.3119 102.1577

T2,3 130.2512 133.6661 135.6184 136.7377 137.3802

T2, 4 194.7504 196.3616 197.2791 197.8043 198.1055

T3,1 78.4895 80.3724 81.4754 82.1148 82.4837

T3, 2 98.7917 101.1642 102.5335 103.3221 103.7757

T3,3 126.9904 128.8164 129.8616 130.4612 130.8056

T3, 4 180.4352 181.2945 181.7852 182.0664 182.2278

3.3 Successive Over Relaxation Method


The coefficient matrix for solving for temperatures given in Example 1 is diagonally dominant. Hence the
Gauss-Siedel method is guaranteed to converge. To accelerate convergence to the solution, over
relaxation is used. In this case

Ti ,relaxed
j = Ti ,new
j + (1 −  )Ti , j
old
(3.22)

60
where

Ti ,new
j = value of temperature from current iteration,

Ti ,oldj = value of temperature from previous iteration,

 = weighting factor, 1    2 .
Again, these iterations are continued till the pre-specified tolerance is met for all nodal temperatures. This
method is also called the Lieberman method.

Example 3
A plate 2.4 m  3.0 m is subjected to the temperatures as shown in Fig. 3.9. Use a square grid length of
0.6 m . Use the Gauss-Seidel with successive over relaxation method with a weighting factor of 1.4 to find
the temperature at the interior nodes. Conduct two iterations at all interior nodes. Find the maximum
absolute relative error at the end of the second iteration. Assume the initial temperature at all interior
nodes to be 0 C .

300 C

75 C
3 .0 m 100 C

x
50 C

2 .4 m

Figure 3.9: A rectangular plate with the dimensions and boundary temperatures

Solution
x =  y = 0 . 6 m

61
L
m=
x
2 .4
=
0 .6
=4

W
n=
y
3
=
0 .6
=5

The interior nodes are shown in the Figure 3.10.

T 0,5 T1,5 T2,5 T3,5 T4,5

T0, 4
T1, 4 T2, 4 T3, 4 T4, 4
T0,3
T1,3 T2,3 T3,3 T4,3
T0, 2
T1, 2 T2, 2 T3, 2 T4, 2

T0,1 T1,1 T2,1 T3,1 T4,1


x
T0, 0 T1, 0 T2, 0 T3,0 T4, 0

Figure 3.10: Plate with nodes

All of the nodes on the left and right boundary have an i value of zero and m , respectively. All of the
nodes on the top or bottom boundary have a j value of either zero or n , respectively.

From the boundary conditions

T0, j = 75, j = 1,2,3,4 



T4, j = 100, j = 1,2,3,4
 (3.23)
Ti , 0 = 50, i = 1,2,3 
Ti ,5 = 300, i = 1,2,3 

62
The corner nodal temperature of T0,5 , T4,5 , T4,0 and T0,0 are not needed. Now to get the temperature at
the interior nodes, we have to write Equation (3.20) for all of the combinations of i and j , i = 1 to m − 1
, j = 1 to n − 1 . After getting the temperature from Equation (3.20), we have to use Equation (3.22) to
apply the over relaxation method.

Iteration 1
For iteration 1, we start with all of the interior nodes having a temperature of 0C .

i=1 and j=1


T +T +T +T
T1,1 = 2,1 0,1 1, 2 1, 0
4
0 + 75 + 0 + 50
= = 31.2500C
4

T1,1relaxed = T1,1new + (1 −  )T1,1old

= 1.4(31.2500) + (1 − 1.4)0
= 43.7500C

i=1 and j=2


T +T +T +T
T1, 2 = 2, 2 0, 2 1,3 1,1
4
0 + 75 + 0 + 43.75
=
4
= 29.6875C

T1,2relaxed = T1,2new + (1 −  )T1,2old

= 1.4(29.6875) + (1 − 1.4)0
= 41.5625C

i=1 and j=3


T + T0,3 + T1, 4 + T1, 2
T1,3 = 2,3
4
0 + 75 + 0 + 41.5625
=
4
= 29.1406C

T1,3relaxed = T1,3new + (1 −  )T1,3old

63
= 1.4(29.1406) + (1 − 1.4)0
= 40.7969C

i=1 and j=4


T2, 4 + T0, 4 + T1,5 + T1,3
T1, 4 =
4
0 + 75 + 300 + 40.7969
=
4
= 103.949C

T1,4relaxed = T1,4new + (1 −  )T1,4old

= 1.4(103.949) + (1 − 1.4)0
= 145.529C

i=2 and j=1


T3,1 + T1,1 + T2, 2 + T2, 0
T2,1 =
4
0 + 43.75 + 0 + 50
=
4
= 23.4375C
relaxed
T2,1 = T2,1
new
+ (1 −  )T2,1
old

= 1.4(23.4375) + (1 − 1.4)0
= 32.8215C

i=2 and j=2


T + T + T2,3 + T2,1
T2, 2 = 3, 2 1, 2
4
0 + 41.5625 + 0 + 32.8125
=
4
= 18.5938C
relaxed
T2,2 = T2,2
new
+ (1 −  )T2,2
old

= 1.4(18.5938) + (1 − 1.4)0
= 26.0313C

i=2 and j=3

64
T3,3 + T1,3 + T2, 4 + T2, 2
T2 , 3 =
4
0 + 40.7969 + 0 + 26.0313
=
4
= 16.7071C
relaxed
T2,3 = T2,3
new
+ (1 −  )T2,3
old

= 1.4(16.7071) + (1 − 1.4)0
= 23.3899C

i=2 and j=4


T + T + T2,5 + T2,3
T2, 4 = 3, 4 1, 4
4
0 + 145.529 + 300 + 23.3899
=
4
= 117.230C
relaxed
T2,4 = T2,4
new
+ (1 −  )T2,4
old

= 1.4(117.230) + (1 − 1.4)0
= 164.122C

i=3 and j=1


T + T + T + T3,0
T3,1 = 4,1 2,1 3, 2
4
100 + 32.8125 + 0 + 50
=
4
= 45.7031C

T3,1relaxed = T3,1new + (1 −  )T3,1old

= 1.4(45.7031) + (1 − 1.4)0
= 63.9844C

i=3 and j=2


T + T2, 2 + T3,3 + T3,1
T3, 2 = 4, 2
4

65
100 + 26.0313+ 0 + 63.9844
=
4
= 47.5039C
relaxed
T3,2 = T3,2
new
+ (1 −  )T3,2
old

= 1.4(47.5039) + (1 − 1.4)0
= 66.5055C

i=3 and j=3


T + T2,3 + T3, 4 + T3, 2
T3,3 = 4,3
4
100 + 23.3899 + 0 + 66.5055
=
4
= 47.4739C
relaxed
T3,3 = T3,3
new
+ (1 −  )T3,3
old

= 1.4(47.4739) + (1 − 1.4)0
= 66.4634C

i=3 and j=4


T + T2, 4 + T3,5 + T3,3
T3, 4 = 4, 4
4
100 + 164.122 + 300 + 66.4634
=
4
= 157.646C
relaxed
T3,4 = T3,4
new
+ (1 −  )T3,4
old

= 1.4(157.646) + (1 − 1.4)0
= 220.704C

Iteration 2
For iteration 2, we take the temperatures from iteration 1.

i=1 and j=1


T +T +T +T
T1,1 = 2,1 0,1 1, 2 1, 0
4

66
32.8125 + 75 + 41.5625 + 50
=
4
= 49.8438C

T1,1relaxed = T1,1new + (1 −  )T1,1old

= 1.4(49.8438) + (1 − 1.4)43.75
= 52.2813C

T1,present − T1,previous
 a 1,1 = 1
present
1
 100
T1,1
52.2813 − 43.7500
=  100
52.2813
= 16.32%

i=1 and j=2


T + T0, 2 + T1,3 + T1,1
T1, 2 = 2, 2
4
26.0313+ 75 + 40.7969 + 52.2813
=
4
= 48.5274C

T1,2relaxed = T1,2new + (1 −  )T1,2old

= 1.4(48.5274) + (1 − 1.4)41.5625
= 51.3133C

T1,present − T1,previous
 a 1, 2 = 2
present
2
100
T1, 2
51.3133− 41.5625
= 100
51.3133
= 19.00%

i=1 and j=3


T + T0,3 + T1, 4 + T1, 2
T1,3 = 2,3
4
23.3899 + 75 + 145.529 + 51.3133
=
4
= 73.8103C

67
T1,3relaxed = T1,3new + (1 −  )T1,3old

= 1.4(73.8103) + (1 − 1.4)40.7969
= 87.0157C

T1,present − T1,previous
 a 1,3 = 3
present
3
100
T1,3
87.0157 − 40.7969
= 100
87.0157
= 53.12%

i=1 and j=4


T2, 4 + T0, 4 + T1,5 + T1,3
T1, 4 =
4
164.122 + 75 + 300 + 87.0157
=
4
= 156.534C

T1,4relaxed = T1,4new + (1 −  )T1,4old

= 1.4(156.534) + (1 − 1.4)145.529
= 160.936C

T1,present − T1,previous
 a 1, 4 = 4 4
100
T1,present
4

160.936 − 145.529
= 100
160.936
= 9.57%

i=2 and j=1


T3,1 + T1,1 + T2, 2 + T2, 0
T2,1 =
4
63.9844 + 52.2813+ 26.0313 + 50.000
=
4
= 48.0743C
relaxed
T2,1 = T2,1
new
+ (1 −  )T2,1
old

68
= 1.4(48.0743) + (1 − 1.4)32.8125
= 54.1790C

T2present − T2previous
 a 2,1 = ,1
present
,1
100
T2,1
54.1790 − 32.8125
= 100
54.1790
= 39.44%

i=2 and j=2


T3, 2 + T1, 2 + T2,3 + T2,1
T2, 2 =
4
66.5055 + 51.3133 + 23.3899 + 54.1790
=
4
= 48.8469C
relaxed
T2,2 = T2,2
new
+ (1 −  )T2,2
old

= 1.4(48.8469) + (1 − 1.4)26.0313
= 57.9732C

T2,2present − T2,2previous
 a 2,2 = 100
T2,2present
57.9732 − 26.0313
= 100
57.9732
= 55.10%

i=2 and j=3


T3,3 + T1,3 + T2, 4 + T2, 2
T2,3 =
4
66.4634 + 87.0157 + 164.122 + 57.9732
=
4
= 93.8936C
relaxed
T2,3 = T2,3
new
+ (1 −  )T2,3
old

= 1.4(93.8936) + (1 − 1.4)23.3899
= 122.095C

69
T2present − T2previous
 a 2,3 = ,3
present
,3
100
T2,3
122.095 − 23.3899
= 100
122.095
= 80.84%

i=2 and j=4


T + T + T2,5 + T2,3
T2, 4 = 3, 4 1, 4
4
220.704 + 160.936 + 300 + 122.095
=
4
= 200.934C
relaxed
T2,4 = T2,4
new
+ (1 −  )T2,4
old

= 1.4(200.934) + (1 − 1.4)164.122
= 215.659C

T2present − T2previous
 a 2, 4 = ,4 ,4
present
 100
T2, 4
215.659 − 164.122
=  100
215.659
= 23.90%

i=3 and j=1


T + T + T + T3,0
T3,1 = 4,1 2,1 3, 2
4
100 + 54.1790 + 66.5055 + 50
=
4
= 67.6711C

T3,1relaxed = T3,1new + (1 −  )T3,1old

= 1.4(67.6711) + (1 − 1.4)63.9844
= 69.1458C

70
T3present − T3previous
 a 3,1 = ,1 ,1
present
100
T3,1
69.1458 − 63.9844
= 100
69.1458
= 7.46%

i=3 and j=2


T +T +T +T
T3, 2 = 4, 2 2, 2 3,3 3,1
4
100 + 57.9732 + 66.4634 + 69.1458
=
4
= 73.3956C
relaxed
T3,2 = T3,2
new
+ (1 −  )T3,2
old

= 1.4(73.3956) + (1 − 1.4)66.5055
= 76.1516C

T3present − T3previous
 a 3, 2 = ,2 ,2
present
100
T3, 2
76.1516 − 66.5055
= 100
76.1516
= 12.67%

i=3 and j=3


T4,3 + T2,3 + T3, 4 + T3, 2
T3,3 =
4
100 + 122.095 + 220.704 + 76.1516
=
4
= 129.738C
relaxed
T3,3 = T3,3
new
+ (1 −  )T3,3
old

= 1.4(129.738) + (1 − 1.4)66.4634
= 155.048C

71
T3present − T3previous
 a 3, 3 = ,3 ,3
present
100
T3,3
155.048 − 66.4634
= 100
155.048
= 57.13%

i=3 and j=4


T + T2, 4 + T3,5 + T3,3
T3, 4 = 4, 4
4
100 + 215.659 + 300 + 155.048
=
4
= 192.677C
relaxed
T3,4 = T3,4
new
+ (1 −  )T3,4
old

= 1.4(192.677) + (1 − 1.4)220.704
= 181.466C

T3present − T3previous
 a 3, 4 = ,4 ,4
present
100
T3, 4
181.466 − 220.704
= 100
181.466
= 21.62%

The maximum absolute relative error at the end of iteration 2 is 81% .


y

300 300 300

75
161 216 181 100
75
87 122 155 100
75
51 58 76 100
75
52 54 69 100
x
50 50 50

72
Figure 3.11: Temperature distribution after two iterations

It took nine iterations to get all of the temperature values within 1% error. The table below lists the
temperature values at all nodes after each iteration.

Node Number of Iterations

1 2 3 4 5

T1,1 43.7500 52.2813 59.7598 68.3636 75.6025

T1, 2 41.5625 51.3133 77.3856 93.5293 101.8402

T1,3 40.7969 87.0125 117.5901 130.5043 119.8434

T1, 4 145.5289 160.9353 183.5128 173.8030 173.3888

T2,1 32.8125 54.1789 61.2360 75.6074 86.4009

T2, 2 26.0313 57.9731 94.7142 116.7560 105.9062

T2,3 23.3898 122.0937 155.2159 140.9145 139.0181

T2, 4 164.1216 215.6582 200.8045 199.1851 198.6561

T3,1 63.9844 69.1458 72.9273 90.9098 83.7806

T3, 2 66.5055 76.1516 117.4804 106.8690 105.2995

T3,3 66.4634 155.0472 131.9376 133.3050 131.1769

T3, 4 220.7047 181.4650 183.8737 182.8220 182.3127

73
Node Number of Iterations

6 7 8 9

T1,1 79.3934 71.2937 74.2346 73.7832

T1, 2 92.3140 92.1224 93.0388 92.9758

T1,3 119.9649 119.388 119.8366 119.9378

T1, 4 173.4118 173.0515 173.3665 173.3937

T2,1 77.1177 76.4550 77.6097 77.5449

T2, 2 102.4498 102.4844 103.3554 103.3285

T2,3 137.6794 137.7443 138.2932 138.3236

T2, 4 198.2290 198.2693 198.6060 198.5498

T3,1 82.8338 82.4002 83.1150 82.9805

T3, 2 103.6414 104.0334 104.5308 104.3815

T3,3 130.8010 131.0842 131.3876 131.2525

T3, 4 182.2354 182.3796 182.5459 182.4230

3.4 Alternative Boundary Conditions


In Examples 1-3, the boundary conditions on the plate had a specified temperature on each edge. What
if the conditions are different? For example; what if one of the edges of the plate is insulated? In this
case, the boundary condition would be the derivative of the temperature (called the Neuman boundary
condition). If the right edge of the plate is insulated, then the temperatures on the right edge nodes also
become unknowns. The finite difference Equation (3.7) in this case for the right edge for the nodes (m, j )
, j = 1,2,3,..n − 1; i = 1,2,.., m

Tm+1, j + Tm−1, j + Tm, j −1 + Tm, j +1 − 4Tm, j = 0 (3.24)

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

74
T Tm+1, j − Tm−1, j
 (3.25)
x m, j 2(x)

giving

T
Tm+1, j = Tm−1, j + 2(x) (3.26)
x m, j

substituting Equation (3.26) in Equation (3.24), gives

T
2Tm−1, j + 2(x) + Tm, j −1 + Tm, j +1 − 4Tm, j = 0 (3.27)
x m, j

Now if the edge is insulated,

T
=0 (3.28)
x m, j

substituting Equation (3.28) in Equation (3.27), gives an equation to use at the Neuman Boundary
condition

2Tm−1, j + Tm, j −1 + Tm, j +1 − 4Tm, j = 0 (3.29)

Example 4
A plate 2.4 m  3.0 m is subjected to the temperatures and insulated boundary conditions as shown in
Fig. 3.12. Use a square grid length of 0.6 m . Assume the initial temperatures at all of the interior nodes
to be 0 C . Find the temperatures at the interior nodes using the direct method.

300 C

75 C
3 .0 m Insulated

x
50 C

2 .4 m

Figure 3.12: Plate with the dimensions and boundary conditions

75
Solution
x =  y = 0 . 6 m

Re-writing Equations (3.2) and (3.3) we have

L
m=
x
2 .4
=
0 .6
=4

W
n=
y

3
=
0 .6
=5

The unknown temperature nodes are shown in Figure 3.13.


y

T1,5 T2,5 T3,5 T4,5


T0,5

T0,4
T1,4 T2,4 T3,4 T4,4
T0,3
T1,3 T2,3 T3,3 T4,3
T0,2
T1,2 T2,2 T3,2 T4,2
T0,1
T1,1 T2,1 T3,1 T4,1
T0,0 x
T1,0 T2,0 T3,0 T4,0

Figure 3.13: Plate with the nodes labeled

All of the nodes on the boundary have an i value of either zero or m . All of the nodes on the boundary
have a j value of either zero or n .

From the boundary conditions

76
T0, j = 75; j = 1,2,3,4 

Ti ,0 = 50; i = 1,2,3,4 

Ti ,5 = 300; i = 1,2,3,4  (3.30)

T
= 0; j = 1,2,3,4
x 4, j 

Now in order to find the temperatures at the interior nodes, we have to write Equation (3.7) for all of the
combinations of i and j . We express this using i from 1 to m − 1 and j from 1 to n − 1 . For the right
side boundary nodes, where i = m = 4 , we have to write Equation (18) for j = 1,2,3,4 . This would give
m  n − 1 simultaneous linear equations with m  n − 1 unknowns.
i=1 and j=1
T2,1 + T0,1 + T1, 2 + T1,0 − 4T1,1 = 0

T2,1 + 75 + T1, 2 + 50 − 4T1,1 = 0

− 4T1,1 + T1, 2 + T2,1 = −125 (3.31)

i=1 and j=2


T2, 2 + T0, 2 + T1,3 + T1,1 − 4T1, 2 = 0

T2, 2 + 75 + T1,3 + T1,1 − 4T1, 2 = 0

T1,1 − 4T1, 2 + T1,3 + T2, 2 = −75 (3.32)

i=1 and j=3


T2,3 + T0,3 + T1, 4 + T1, 2 − 4T1,3 = 0

T2,3 + 75 + T1, 4 + T1, 2 − 4T1,3 = 0

T1, 2 − 4T1,3 + T1, 4 + T2,3 = −75 (3.33)

i=1 and j=4


T2, 4 + T0, 4 + T1,5 + T1,3 − 4T1, 4 = 0

T2, 4 + 75 + 300 + T1,3 − 4T1, 4 = 0

T1,3 − 4T1, 4 + T2, 4 = −375 (3.34)

i=2 and j=1


T3,1 + T1,1 + T2, 2 + T2,0 − 4T2,1 = 0

77
T3,1 + T1,1 + T2, 2 + 50 − 4T2,1 = 0

T1,1 − 4T2,1 + T2, 2 + T3,1 = −50 (3.35)

i=2 and j=2


T3, 2 + T1, 2 + T2,3 + T2,1 − 4T2, 2 = 0

T1, 2 + T2,1 − 4T2, 2 + T2,3 + T3, 2 = 0 (3.36)

i=2 and j=3


T3,3 + T1,3 + T2, 4 + T2, 2 − 4T2,3 = 0

T1,3 + T2, 2 − 4T2,3 + T2, 4 + T3,3 = 0 (3.37)

i=2 and j=4


T3, 4 + T1, 4 + T2,5 + T2,3 − 4T2, 4 = 0

T3, 4 + T1, 4 + 300 + T2,3 − 4T2, 4 = 0

T1, 4 + T2,3 − 4T2, 4 + T3, 4 = −300 (3.38)

i=3 and j=1


T4,1 + T2,1 + T3, 2 + T3,0 − 4T3,1 = 0

T4,1 + T2,1 + T3,2 + 50 − 4T3,1 = 0

T2,1 − 4T3,1 + T3,2 + T4,1 = −50 (3.39)

i=3 and j=2


T4, 2 + T2, 2 + T3,3 + T3,1 − 4T3, 2 = 0

T2, 2 + T3,1 − 4T3, 2 + T3,3 + T4, 2 = 0 (3.40)

i=3 and j=3


T4,3 + T2,3 + T3, 4 + T3, 2 − 4T3,3 = 0

T2,3 + T3, 2 − 4T3,3 + T3, 4 + T4,3 = 0 (3.41)

i=3 and j=4


T4, 4 + T2, 4 + T3,5 + T3,3 − 4T3, 4 = 0

T4, 4 + T2, 4 + 300 + T3,3 − 4T3, 4 = 0

T2, 4 + T3,3 − 4T3, 4 + T4, 4 = −300 (3.42)

78
Now for i = 4 (for this problem m = 4 ), all of these nodes are on the right hand side boundary which is
insulated, so we use Equation (3.29) for j = 1,2,3 and 4 .Substituting i for m variables gives

i=4 and j=1


2T3,1 + T4,0 + T4, 2 − 4T4,1 = 0 (3.43)

2T3,1 + 50 + T4, 2 − 4T4,1 = 0

2T3,1 − 4T4,1 + T4, 2 = −50

i=4 and j=2


2T3, 2 + T4,1 + T4,3 − 4T4, 2 = 0 (3.44)

2T3, 2 + T4,1 − 4T4, 2 + T4,3 = 0

i=4 and j=3


2T3,3 + T4, 2 + T4, 4 − 4T4,3 = 0 (3.45)

2T3,3 + T4, 2 − 4T4,3 + T4, 4 = 0

i=4 and j=4


2T3, 4 + T4,3 + T4,5 − 4T4, 4 = 0 (3.46)

2T3, 4 + T4,3 + 300 − 4T4, 4 = 0

2T3, 4 + T4,3 − 4T4, 4 = −300

Equations (3.31) to (3.46) represent a set of sixteen simultaneous linear equations, and solving them gives
the temperature at sixteen interior nodes. The solution is

79
 T1,1  76.8254
T  99.4444
 1, 2   
 T1, 3  128.617
   
 T 
1, 4 180.410
T2 ,1   82.8571
   
T2 , 2  117.335
T  159.614
 2,3   
T2 , 4   218 . 021
T  =   C
  87. 2678
3 ,1
 
T3, 2  127.426
   
T3, 3  174.483
T3, 4   232.060
   
T4 ,1   88. 7882 
T  130.617
 4, 2   
T4 , 3  178.830
   232.738
T4 , 4 
   

80
Chapter Four
First Order Non-Linear Equations
Non-linear differential equations are formed by the products of the unknown function and its
derivatives are allowed and its degree is > 1. There are very few methods of solving nonlinear
differential equations exactly; those that are known typically depend on the equation having
particular symmetries. Nonlinear differential equations can exhibit very complicated behavior over
extended time intervals, characteristic of chaos. Even the fundamental questions of existence,
uniqueness, and extendability of solutions for nonlinear differential equations, and well-posedness
of initial and boundary value problems for nonlinear PDEs are hard problems and their resolution
in special cases is considered to be a significant advance in the mathematical theory.
Recall that a first order ODE has the form y' = f (t,y), and is linear if f is linear in y, and nonlinear if f
is nonlinear in y. Examples: y' = ty - et, y' = ty2.

4.1 Separable Equations


A separable differential equation is one that can be rewritten into the form

A(y)dy = B(x)dx (4.1)

where A is a function of y only and B a function of x only, and dx and dy are differentials. Thus, we could
also write A(y)y′ = B(x). An alternate form is written as follows:

𝑑𝑦
B(x) + A(y) 𝑑𝑥 = 0 (4.2)

(Here, there is obviously a difference of sign in the functions A(y) in the two forms)

When an equation is separated like this, it is then possible to integrate directly on both sides of the
equality to find a solution, which may be given as an implicit function.

Worked Examples: Separable Equations


Some non-linear equations are separable, which means this new technique will allow us to solve some
problems we could not before.

Example 1

The differential equation 9y2y′ = 2x is nonlinear, but it is separable; we can rewrite it as dy


𝑑𝑦
9y3𝑑𝑥=2x

9y2dy=2xdx

Then integrating yields

81
3y3=x+C

(Although both integrals would yield a constant of integration, we can combine the two constants into
one.)

This gives a family of solutions dependent on the parameter C.

Now the function y is given implicitly. We could solve for y to make the solution explicit:

(Note further that since C is an arbitrary constant, we might also just write y = , changing C
to C/3.)

We can of course, solve for the constant C if we wish. (We can do this with the equation in either the
implicit or explicit form.)

Example 2
Solve the initial value problem

, and y(0) = 2
We separate:

(y + 2)dy = (2x + 1)dx


and integrate:

Since y(0) = 2, we plug in x = 0 and y = 2 to find C:

Finally, we solve for y, which is not too difficult here. We proceed by multiplying through by 2 and
completing the square:

= x2 + x + 6
y2 + 4y = 2x2 + 2x + 12 (multiply by 2)
y2 + 4y + 4 = 2x2 + 2x + 16 (completing the square)
(y + 2)2 = 2x2 + 2x + 16 (factoring)

82
(We know that it is the positive square root, because we must have y(0) = 2, which is positive.)

We make a further note about our solution: since 2x2 + 2x + 16 > 0 for all values of x, the solution is valid
for all x. If it were not, we would need to restrict the values of x in the solution. Further, note that our
function never has y = −2, so the function is always a solution to the original differential equation which
has y + 2 in the denominator of the right hand side.

Some first order equations may be both separable and linear, and so may be solved different ways:

Example 3
y′ = x − 1 + xy − y is a linear differential equation, as can be seen by rewriting it as y′ = (x − 1) + (x − ′1)y.

We could use an integrating factor exp (x − x /2) for the equation in the form y + (1 − x)y = x − 1, but the

equation is also separable:

y′ = (x − 1) + (x − 1)y = (x − 1)(y + 1)

So we get

,or

Then we can integrate on both sides to get ln, or (by solving) the equivalent

1, where A = ±eC.

Not all first order linear equations are separable:

Example 4

y′ = 3y + ex is not separable. Note that if we rewrite it using differentials, the best we can do is

dy = (3y + ex)dx
which is not separated. However, if we rewrite the equation as y′ −3y = ex, we could solve the equation
by an integrating factor of e−3x.

Some equations are neither linear nor separable:

83
Example 5

The equation below is neither linear nor separable:

If we attempt to separate it, we get only ( .

As we saw above, sometimes a separable equation gives a result that is an implicit function. If it’s not
too hard to solve for y, go ahead. Otherwise, it might be best to leave it in implicit form

Example 6
Find a solution to the initial value problem y′ = cos2(x)cos2(2y), y(π/2) = π:

We start by separating and integrating:

The left hand side is , while the right side gives

Thus, we have

Now we need to know find a value of C which can satisfy the initial condition y(π/2) = π. That is, y = π
when x = π/2, so we see that we have tan(2 C, or 0 = π/2 + C, so C = −π/2.
So the solution to the initial value problem is

.
Is it reasonable to solve for y? If we use the arctangent, we have the problem that the range of the
standard branch of the arctangent has range (−π/2,π/2), so that we cannot have y(π/2) = π! Therefore,
we might be better off leaving this solution as implicit.
Note that we could write down a solution by adjusting the arctangent. In fact, given that tan(x) repeats
every π, an explicit solution is given by the following:

84
4.2 Differences between linear and Nonlinear ode
In this section, we will see that first order linear and nonlinear equations differ in a number of
ways, including:
*The theory describing existence and uniqueness of solutions, and corresponding domains, are
different.
*Solutions to linear equations can be expressed in terms of a general solution, which is not usually
the case for nonlinear equations.
*Linear equations have explicitly defined solutions while nonlinear equations typically do not, and
nonlinear equations may or may not have implicitly defined solutions.
*For both types of equations, numerical and graphical construction of solutions are important.

Theorem 1

Consider the linear first order initial value problem:

(4.2)

If the functions p and g are continuous on an open interval (α, β) containing the point t = t 0, then
there exists a unique solution y = φ(t) that satisfies the IVP for each t in (α, β). Hence by the method
of integrating factor Equation (4.2) has a unique solution as follows:

Theorem 2

Consider the nonlinear first order initial value problem:

(4.3)

Suppose f and ∂f/∂y are continuous on some open rectangle (t, y) ∈ (α, β) x (γ, δ) containing the
point (t0, y0). Then in some interval (t0 h, t0 + h) ⊆ (α, β) there exists a unique solution y = φ(t) that
satisfies the IVP.

Proof discussion: Since there is no general formula for the solution of arbitrary nonlinear first order
IVPs, this proof is difficult, and is beyond the scope of this course.

It turns out that conditions stated in Theorem 2 are sufficient but not necessary to guarantee
existence of a solution, and continuity of f ensures existence but not uniqueness of φ

85
Example 3.7: Linear IVP

Given the initial value problem:

We have

The solution to this initial value problem is defined for t > 0, the interval on which p (t) = -2/ t is
continuous. If the initial condition is y (-1) = 2, then the solution is given by same expression as
above, but is defined on t < 0. In either case, Theorem1 guarantees that solution is unique on
corresponding interval.

Example 3.8: Nonlinear IVP


Consider a nonlinear initial value problem as follows

The functions f and ∂f/∂y are given by

86
and are continuous except on line y = 1. Thus we can draw an open rectangle about (0, -1) on
which f and ∂f/∂y are continuous, as long as it doesn’t cover y = 1. How wide the rectangle will be
is a function defined by the solution (Using separable variable).

Example 4.9: Change Initial Condition


Our nonlinear initial value problem is

With

which are continuous except on line y = 1. If we change initial condition to y(0) = 1, then Theorem
2 is not satisfied. Solving this new IVP, we obtain

87
Thus, a solution exists but is not unique

Example 3.10: Nonlinear IVP


Consider nonlinear initial value problem

The functions f and ∂f/∂y are given by

Thus f continuous everywhere, but ∂f/∂y doesn’t exist at y = 0, and hence Theorem 2 is not
satisfied. Solutions exist but are not unique. Separating variables and solving, we obtain

88
If initial condition is not on t-axis, then Theorem 2 does guarantee existence and uniqueness.

Example 3.11: Nonlinear IVP


Consider nonlinear initial value problem

The functions f and ∂f/∂y are given by

Thus f and ∂f/∂y are continuous at t = 0, so Theorem2 guarantees that solutions exist and are
unique.
Separating variables and solving, we obtain

The solution y(t) is defined on (-∞, 1). Note that the singularity at t = 1 is not obvious from
original IVP statement.

89
Chapter Five
Complex integration
5.1 Cauchy integral theorem and Cauchy integral formulas
Definite integral of a complex-valued function of a real variable

Consider a complex valued function f(t) of a real variable t:

which is assumed to be a piecewise continuous function defined in the closed interval a ≤ t ≤ b. The
integral of f(t) from t = a to t = b, is defined as

90
91
92
93
94
95
5.2 Cauchy integral theorem
Let f(z) = u(x, y)+iv(x, y) be analytic on and inside a simple closed contour C and let f′(z) be also
continuous on and inside C, then

Proof
The proof of the Cauchy integral theorem requires the Green theorem for a positively oriented closed
contour C: If the two real functions P (x, y) and Q(x, y) have continuous first order partial derivatives on
and inside C, then

where D is the simply connected domain bounded by C

One can infer from the continuity of f′(z) that u(x, y) and v(x, y)
have continuous derivatives on and inside C. Using the Green theorem, the two real line integrals can be
transformed into double integrals

Both integrands in the double integrals are equal to zero due to the Cauchy-Riemann relations, hence
the theorem.

96

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy