Numerical Solution of Parabolic in Partial Differential Equations (PDEs) in One and Two Space Variable

Abstract

In this paper, we shall be concerned with the numerical solution of parabolic equations in one space variable and the time variable t. We expand Taylor series to derive a higher-order approximation for Ut. We begin with the simplest model problem, for heat conduction in a uniform medium. For this model problem, an explicit difference method is very straightforward in use, and the analysis of its error is easily accomplished by the use of a maximum principle. As we shall show, however, the numerical solution becomes unstable unless the time step is severely restricted, so we shall go on to consider other, more elaborate, numerical methods which can avoid such a restriction. The additional complication in the numerical calculation is more than offset by the smaller number of time steps needed. We then extend the methods to problems with more general boundary conditions, then to more general linear parabolic equations. Finally, we shall discuss the more difficult problem of the solution of nonlinear equations.

Share and Cite:

Mu’lla, M. , Gaweash, A. and Bakur, H. (2022) Numerical Solution of Parabolic in Partial Differential Equations (PDEs) in One and Two Space Variable. Journal of Applied Mathematics and Physics, 10, 311-321. doi: 10.4236/jamp.2022.102024.

1. Introduction

Partial differential equations (PDEs) form the basis of very many mathematical models of physical, chemical and biological phenomena, and more recently their use has spread into economics, financial forecasting, image processing and other fields. There are other explicit numerical methods that can be applied to the 1-D heat or diffusion equation such as the Method of Lines which is used by Matlab and Mathematica [1] [2]. In calculating the quantities to a good approximation, there is a thin boundary layer near the wing surface where viscous forces are important and that outside this an inviscid flow can be assumed. Which we will assume is locally flat, we can model the flow by

u u x v 2 u y 2 = 1 ρ p x , (1)

where u is the flow velocity in the direction of the tangential co-ordinate x, y is the normal co-ordinate, ν is the viscosity, ρ is the density and p the pressure; we have here neglected the normal velocity. This is a typical parabolic equation for

u with 1 ρ p x treated as a forcing term [3] [4]. Away from the wing, considered

just as a two-dimensional cross section, we can suppose the flow velocity to be inviscid and of the form ( u + u , v ) where u and v are small compared with the flow speed at infinity, u in the x-direction. One can often assume that the flow is irrational so that we have

v x u y = 0 , (2)

then combining the conservation laws for mass and the x-component of momentum, and retaining only first-order quantities while assuming homentropic flow, we can deduce the simple model

( 1 M 2 ) v x + u y = 0 (3)

where M is the Mach number at infinity, M = u a , and a is the sound speed [5] [6].

2. Explicit Methods for 1-D Heat or Diffusion Equation

2.1. Difference Approximations for Derivative Terms in PDEs

We consider U ( x , t ) for 0 x a , 0 t T .

Discrete time and spatial variable x:

Δ t = T m , Δ x = a n + 1 ,

t k = k Δ t , 0 k m , x j = j Δ x , 0 j n + 1

Let U j k = U ( x j , t k )

Consider Taylor series expansion for U j k + 1 :

U j k + 1 = U j k + Δ t U j k t + Δ t 2 2 2 U j k t 2 + O ( Δ t 3 ) (4)

If we only consider O ( Δ t ) terms in Equation (4) then we arrive at the forward difference in time approximation for U t :

U j k t = U j k + 1 U j k Δ t + O ( Δ t )

We can also derive a higher-order approximation for U t if we consider the Taylor series expansion for U j k 1 as well:

U j k 1 = U j k Δ t U j k t + Δ t 2 2 2 U j k t 2 + O ( Δ t 3 ) (5)

(4) – (5) U j k t = U j k + 1 U j k 1 2 Δ t + O ( Δ t 2 ) leap-frog

(or center difference) in time. This gives higher-order accuracy than forwarding difference. We can also perform similar manipulations to arrive at approximations for the second derivative U t t :

(4) + (5) 2 U j k 2 U j k t 2 = U j k + 1 U j k 1 2 U j k Δ t 2 + O ( Δ t 2 ) central difference

The finite difference method makes use of the above approximations to solve Partial Differential Equations, PDEs numerically [7] [8] [9].

2.2. Central Differences

The central differences solve Partial Differential Equations, as well:

δ t v ( x , t ) = v ( x , t + 1 2 Δ t ) v ( x , t 1 2 Δ t ) , (6-a)

δ t v ( x , t ) = v ( x + 1 2 Δ x , t ) v ( x 1 2 Δ x , t ) , (6-b)

when the central difference operator is applied twice we obtain the very useful second-order central difference

δ x 2 v ( x , t ) = v ( x + Δ x , t ) 2 v ( x , t ) + v ( x Δ x , t ) (7)

For first differences, it is often convenient to use the double interval central difference

Δ 0 x v ( x , t ) = 1 2 ( Δ + x + Δ x ) v ( x , t ) = 1 2 [ v ( x + Δ x , t ) v ( x Δ x , t ) ] (8)

A Taylor series expansion of the forward difference in t gives for the solution of:

u t = u x x for t > 0 , 0 < x < 1 (9)

Δ + t u ( x , t ) = u ( x , t + Δ t ) u ( x , t ) = u t Δ t + 1 2 u t t ( Δ t ) 2 + 1 6 u t t t ( Δ t ) 3 + (10)

By adding together, the Taylor series expansions in the x variable for Δ + x u , and Δ x u , we see that all the odd powers of Δ x cancel, giving

δ x 2 u ( x , t ) = u x x ( Δ x ) 2 + 1 12 u x x x x ( Δ x ) 4 + (11)

We can now define the truncation error of the scheme

U j n + 1 = U j n + μ ( U j + 1 n 2 U j n + U j 1 n ) (12)

We first multiply the difference equation throughout by a factor, if necessary, so that each term is an approximation to the corresponding derivative in the differential equation. Here this step is unnecessary, provided that we use the form

U j n + 1 U j n Δ t = U j + 1 n 2 U j n + U j 1 n ( Δ x ) 2 (13)

rather than (12) [10] [11] [12]. The truncation error is then the difference between the two sides of the equation, when the approximation U j n is replaced throughout by the exact solution u ( x j , t n ) of the differential equation. Indeed, at any point away from the boundary we can define the truncation error T ( x , t ) [13] [14].

2.3. Definition

The truncation error T ( x , t ) is define by:

T ( x , t ) = Δ + t u ( x , t ) Δ t δ x 2 u ( x , t ) ( Δ x ) 2 (14)

so that:

T ( x , t ) = ( u t u x x ) + ( 1 2 u t t Δ t 1 12 u x x x x ( Δ x ) 2 ) + = 1 2 u t t Δ t 1 12 u x x x x ( Δ x ) 2 + (15)

where these leading terms are called the principal part of the truncation error, and we have used the fact that u satisfies the differential equation [5] [15].

We have used Taylor series expansions to express the truncation error as an infinite series [16]. It is often convenient to truncate the infinite Taylor series, introducing a remainder term, for instance:

u ( x , t + Δ t ) = u ( x , t ) + u t Δ t + 1 2 u t t ( Δ t ) 2 + 1 6 u t t t ( Δ t ) 3 + = u ( x , t ) + u t Δ t + 1 2 u t t ( x , η ) ( Δ t ) 2 , (16)

where η lies somewhere between t and t + Δ t . If we do the same thing for the x expansion the truncation error becomes

T ( x , t ) = 1 2 u t t ( x , η ) Δ t 1 12 u x x x x ( ξ , t ) ( Δ x ) 2 (17)

where ξ ( x Δ x , x + Δ x ) , from which it follows that:

| T ( x , t ) | 1 2 M t t Δ t + 1 12 M x x x x ( Δ x ) 2 (18)

= 1 2 Δ t ( M t t + 1 6 M x x x x Δ t ) , (19)

where M t t is a bound for | u t t | and M x x x x is a bound for | u x x x x | . It is now clear why we assumed that the initial and boundary data for u were consistent, and why it is helpful if we can also assume that the initial data are sufficiently smooth.

For then we can assume that the bounds M t t and M x x x x hold uniformly over the closed domain [ 0 , 1 ] × [ 0 , t F ] [9] [17].

For example, suppose the boundary conditions specify that u must vanish on the boundaries x = 0 and x = 1 , and that u must take the value 1 on the initial line, where t = 0 . Then the solution u ( x , t ) is obviously discontinuous at the corners, and in the full domain defined by 0 < x < 1 , t > 0 all its derivatives are unbounded, so our bound for the truncation error is useless over the full domain [18] [19].

3. Implicit Backward Euler Method for 1-D Heat Equation

Unconditionally stable (but usually slower than explicit methods). Implicit because it evaluates difference approximations to derivatives at next time step t k + 1 and not current time step we are solving for t k .

U x x ( t k + 1 , x j ) = U j + 1 K + 1 2 U j k + 1 + U j 1 k + 1 Δ x 2 (20)

U t ( t k + 1 , x j ) = U j k + 1 U j k Δ t (21)

U t = β U x x becomes:

U j k = U j k + 1 β Δ t Δ x 2 ( U j + 1 K + 1 2 U j k + 1 + U j 1 k + 1 ) = ( 1 + 2 s ) U j k + 1 s ( U j + 1 K + 1 + U j 1 k + 1 ) (22)

where s = β Δ t Δ x 2 as before. We still need to solve for U j k + 1 given U j k is known. This requires solving a tridiagonal linear system of n equations [1] [20].

Again we let U j k + 1 = U ( x j , t k ) , x j = j Δ x , j = 0 , , n + 1 ,

Δ x = a n + 1 , t k = k Δ t , k = 0 , , m and Δ t = T m .

3.1. Numerical Implementation of the Implicit Back Ward Euler Method

We are solving the same problem: U t = β U x x , U ( x , 0 ) = U j 0 = f ( x j )

3.2. Example

We are solving the same system again with the method of lines: U t = β U x x where the initial conditions are U ( x , 0 ) = sin ( 2 π x ) + 2 x + 1

0 x 1 , β = 10 5 , 0 t 12000

boundary conditions are U ( 0 , t ) = 1 and U x ( 1 , t ) = 2 .

Again we have:

U t = A U + b

we replace

U x x = U j + 1 2 U j + U j 1 Δ x 2

where U ( x j , t ) = U j ( t ) , x j = j Δ x , 0 j n + 1

Δ x = a n + 1 = 1 n + 1 , a = 1

with boundary conditions: U ( 0 , t ) = U 0 ( t ) = 1

U x ( 1 , t ) = U n + 1 x ( t ) U n + 1 U n Δ x = 2 Δ U n + 1 = U n + 2 Δ x (23)

In matrix form for n = 3 elements:

U t = ( U 1 U 2 U 3 ) = β Δ x 2 ( 2 1 0 1 2 1 0 1 1 ) ( U 1 U 2 U 3 ) + β Δ x 2 ( 1 0 2 Δ x ) (24)

U = A U + b

The Dirichlet boundary conditions is:

U ( 0 , t ) = 1 = U 0 k , U ( a , t ) = U ( 1 , t ) = 3 = U n + 1 k = U 4 k

For simplicity we consider only 4 elements in x in this example to find the matrix system we need to solve for:

We writing [ U j + 1 k + 1 + U j 1 k + 1 ] + ( 1 + 2 s ) U j k + 1 = U j k as a matrix equation:

( 1 + 2 t s 0 s 1 + 2 s s 0 s 1 + 2 s ) Tridiagonalmatrix ( U 0 k + 1 U 2 k + 1 U 3 k + 1 ) Solution U atnexttimestep = ( U 1 k U 2 k U 3 k ) + s ( U 0 k + 1 0 U 4 k + 1 ) givenfromb .c . (25)

A U k + 1 = U k + b U k + 1 = A 1 [ U k + b ]

4. Heat Conservation Properties

Assume that in our model heat flow problem u t = u x x we define the total heat in the system at time t by:

h ( t ) = 0 1 u ( x , t ) d x (26)

Then from the differential equation we have:

d h d t = 0 1 u t d x = 0 1 u t t d x = [ u x ] 0 1 . (27)

This is not very helpful if we have Dirichlet boundary conditions: but suppose we are given Neumann boundary conditions at each end, say, u x ( 0 , t ) = g 0 ( t ) and u x ( 1 , t ) = g 1 ( t ) . Then we have:

d h d t = g 1 ( t ) g 0 ( t ) , (28)

so thatn is given by integrating an ordinary differential equation [21] [22]. Now suppose we carry out a similar manipulation for the θ -method equations:

U j n + 1 U j n = μ [ θ δ x 2 U j n + 1 + ( 1 θ ) δ x 2 U j n ] , j = 1 , 2 , , J 1 (29)

introducing the total heat by means of a summation over the points for which (29) holds:

H n = j = 1 J 1 Δ x U j n . (30)

Then, recalling from the definitions of the finite difference notation that

δ x 2 U j = Δ + x U j Δ + x U j 1 , (31)

we have:

H n + 1 H n = Δ t Δ x j = 1 J 1 δ x 2 [ θ U j n + 1 + ( 1 θ ) U j n ] (32)

So, recalling from the definitions of the finite difference notation that

δ x 2 U j = Δ + x U j Δ + x U j 1

We have

H n + 1 H n = Δ t Δ x 1 J 1 δ x 2 [ θ U j n + 1 + ( 1 θ ) U j n ] = Δ t Δ x { Δ + x [ θ U j 1 n + 1 + ( 1 θ ) U j 1 n ] Δ + x [ θ U 0 n + 1 + ( 1 θ ) U 0 n ] } . (33)

The rest of the analysis will depend on how the boundary condition is approximated. Consider the simplest case as in

U 1 n U 0 n Δ x = α n U 0 n + g n (34)

namely we set

U 1 n U 0 n = Δ x g 0 n , U J n U J 1 n = Δ x g 1 n .

H n + 1 H n = Δ x [ θ ( g 1 n + 1 g 0 n + 1 ) + ( 1 θ ) ( g 1 n g 0 n ) ] (35)

as an approximation to (28) this approximation may be very accurate, even though we have seen that Un may not give a good pointwise approximation to un.

In particular, if g 0 and g 1 are independent of t the change in H in one time step exactly equals that in h ( t ) [5] [17] [23].

To make the most of this matching we should relate (30) as closely as possible to (27) [13].

If u and U were constants that would suggest we take ( J 1 ) Δ x = 1 , rather than J Δ x = 1 as we have been assuming; and we should compare U j n with

u j n = 1 Δ x ( j 1 ) Δ x j Δ x u ( x , t n ) d x , j = 1 , 2 , , J 1 (36)

And that it is centered at ( j 1 2 ) Δ x and we have

h ( t n ) = 1 J 1 Δ x u j n . (37)

Note that this interpretation matches very closely the scheme that we were led to in

U 1 n U 0 n Δ x = 1 2 α n ( U 0 n + U 1 n ) + g n

by analyzing the truncation error. It would also mean that for initial condition we should take U j 0 = u j 0 as defined by (36) [10] [12]. Then for time-independent boundary conditions, we have H n = h ( t n ) for all n. Moreover, it is easy to see that the function:

u ^ = ( x , t ) = ( g 1 g 0 ) t + 1 2 ( g 1 g 0 ) x 2 + g 0 x + C (38)

with any constant C satisfies the differential equation, and the two boundary conditions [7] [11] [17].

5. Numerical Test Problems

This section is concerning to the numerical test problems and their visualization.

Problem. Let the coupled system of FPDEs given as

Δ x 1.8 U ( x , y ) Δ x y 2 V ( x , y ) 4 Δ y 1.8 U ( x , y ) = ϕ ( x , y )

Δ x 1.8 V ( x , y ) 6 Δ x y 2 U ( x , y ) + 3 Δ y 1.8 Δ x 1.8 V ( x , y ) = θ ( x , y )

U ( 0 , y ) = U ( 0 , y ) = 0 ,

V ( 0 , y ) = V ( 0 , y ) = 0 ,

such that the external functions ϕ ( x , y ) and θ ( x , y ) are given as

ϕ ( x , y ) = 27 x 2 y 2 9 ( y 1 ) ( x 1 ) 2 ( 7 x y 2 y 3 ) 4 x 4 y 3 ( 4 + 3 y ) 0.016 x 2.5 y 4 ( y 1 ) 3 ( 125 x 2 175 x + 56 ) ,

θ ( x , y ) = 36 x 2 y 3 ( y 1 ) ( x 1 ) 3 [ 1 2 x 2 ( y 1 x 1 ) 2 3 x 2 ( y 1 ) 2 ( x 1 ) 2 + 3 ( y 1 ) 2 y x ( y 1 ) x 1 y 1 4 x 4 x ( y 1 x 1 ) 2 3 x y ( y 1 x 1 ) ] 0.071 x 1.2 y 3 ( y 1 ) 2 [ 1250 x 3 2625 x 2 + 1680 x 308 ] .

The exact solution of the above system is

U ( x , y ) = ( x y ( 1 x ) ) 2 ( 1 y ) 3 ,

Table 1. Absolute error at various values of ( x , y ) for K = 10 , 12 in U ( x , y ) and V ( x , y ) of problem.

V ( x , y ) = x y ( 1 y ) ( x y x 2 y x y 2 ) 2 .

We evaluate the approximate solution of Problem with our proposed method. [8] [18]. The comparison between exact and approximate solution, while the absolute error corresponds to scale level K = 10 . We have also computed absolute error at various scale levels and different points of the spaces as given in Table 1.

6. Conclusion

In this paper, we have developed an efficient numerical technique. We shall be concerned with the numerical solution of parabolic equations in one space variable and the time variable t. We begin with the simplest model problem, for heat conduction in a uniform medium. For this model problem, an explicit difference method is very straightforward in use, and the analysis of its error is easily accomplished by the use of a maximum principle, or by Euler Method, the numerical solution becomes unstable unless the time step is severely restricted, so we shall go on to consider other, more elaborate, numerical methods which can avoid such a restriction. The additional complication in the numerical calculation is more than offset by the smaller number of time steps needed. We then extended the methods to problems with more general boundary conditions, then to more general linear parabolic equations. Finally, we shall discuss the more difficult problem of the solution of nonlinear equations.

Acknowledgements

I would like to thank my supervisor, Dr. Muhsin Hassan Abdallah who was a great help to me and also I thank my husband Bashir Alfadol Albdawi without whose help, I could not have written this paper.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Douglas, J. and Rachford, H.H. (1956) On the Numerical Solution of the Heat Conduction Problems in Two and Three Space Variables. Transactions of the American Mathematical Society, 82, 421-439.
https://doi.org/10.1090/S0002-9947-1956-0084194-4
[2] Peaceman, D.W. and Rachford, H.H. (1955) The Numerical Solution of Parabolic and Elliptic Differential Equations. Journal of the Society for Industrial and Applied Mathematics, 3, 28-41.
https://doi.org/10.1137/0103003
[3] Young, D.M. (1971) Iterative Solutions of Large Linear Systems. Academic Press, New York.
[4] Whitham, G.B. (1974) Linear and Nonlinear Waves. Wiley-Interscience, New York.
[5] Godunov, S.K. (1959) A Finite Difference Method for the Numerical Computation of Discontinuous Solutions of the Equations of Fluid Dynamics. Matematicheskii Sbornik, 47, 271-306.
[6] LeVeque, R.J. (1992) Numerical Methods for Conservation Laws, Lectures in Mathematics ETH Zürich. 2nd Edition, Birkhäuser Verlag, Basel.
[7] Braess, D. (2001) Finite Elements: Theory, Fast Solvers, and Applications in Solid Mechanics. 2nd Edition, Cambridge University Press, Cambridge.
[8] Adams, R.A. and Fournier, J.J.F. (2003) Sobolev Spaces. Vol. 140, Pure and Applied Mathematics. 2nd Edition, Elsevier, Amsterdam.
[9] Ern, A. and Guermond, J.L. (2004) Theory and Practice of Finite Elements. Vol. 159, Applied Mathematical Sciences. Springer-Verlag, New York.
https://doi.org/10.1007/978-1-4757-4355-5
[10] Buchanan, M.L. (1963) A Necessary and Sufficient Condition for Stability of Difference Schemes for Initial Value Problems. Journal of the Society for Industrial and Applied Mathematics, 11, 919-935.
https://doi.org/10.1137/0111067
[11] Ames, W.F. (1965) Nonlinear Partial Differential Equations in Engineering, Vol. I. Academic Press, New York.
[12] Haroske, D.D. and Triebel, H. (2008) Distributions, Sobolev Spaces, Elliptic Equations (EMS Textbooks in Mathematics). European Mathematical Society (EMS), Zürich.
[13] Ciarlet, P.G. (1978) The Finite Element Method for Elliptic Problems. Studies in Mathematics and its Applications. North Holland Publishing Co., Amsterdam.
[14] Brandt, A. (1977) Multi-Level Adaptive Solutions to Boundary-Value Problems. Mathematics of Computation, 31, 333-390.
https://doi.org/10.1090/S0025-5718-1977-0431719-X
[15] John, F. (1952) On the Integration of Parabolic Equations by Difference Methods. Communications on Pure and Applied Mathematics, 5, 155-211.
https://doi.org/10.1002/cpa.3160050203
[16] Crank, J. and Nicolson, P. (1947) A Practical Method for Numerical Evaluation of Solutions of Partial Differential Equations of the Heat-Conduction Type. Mathematical Proceedings of the Cambridge Philosophical Society, 43, 50-67.
https://doi.org/10.1017/S0305004100023197
[17] Carrier, G.F. and Pearson, C.E. (1976) Partial Differential Equations. Academic Press, New York.
[18] Courant, R. and Hilbert, D. (1962) Methods of Mathematical Physics. Vol. 2, Partial Differential Equations. Wiley-Interscience, New York.
[19] Kreiss, H.O. and Lorenz, J. (1989) Initial-Boundary Value Problems and the Navier-Stokes Equations. Academic Press, San Diego.
[20] Colella, P. and Woodward, P.R. (1984) The Piecewise Parabolic Method (PPM) for Gas-Dynamical Simulations. Journal of Computational Physics, 54, 174-201.
https://doi.org/10.1016/0021-9991(84)90143-8
[21] Roos, H.G., Stynes, M. and Tobiska, L. (1996) Numerical Methods for Singularly Perturbed Differential Equations. Springer, Berlin.
https://doi.org/10.1007/978-3-662-03206-0
[22] Elman, H.C., Silvester, D.J. and Wathen, A.J. (2004) Finite Elements and Fast Iterative Solvers. Oxford University Press, Oxford.
[23] LeVeque, R.J. and Trefethen, L.N. (1988) Fourier Analysis of the SOR Iteration. IMA Journal of Numerical Analysis, 8, 273-279.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.