• No results found

Error Analysis for the Numerical Solution of Advection Equation by Finite Difference Method

N/A
N/A
Protected

Academic year: 2022

Share "Error Analysis for the Numerical Solution of Advection Equation by Finite Difference Method"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

M. M. Rahaman

, IJRIT 296

IJRIT International Journal of Research in Information Technology, Volume 1, Issue 12, December, 2013, Pg. 296-305

International Journal of Research in Information Technology (IJRIT)

www.ijrit.com

ISSN 2001-5569

Error Analysis for the Numerical Solution of Advection Equation by Finite Difference Method

1M. M. Rahaman, 2G. M. M. Bashir & 3M. N. Rahman

1Muhammad Masudur Rahaman, Assistant Professor, Dept. of Mathematics,

Patuakhali Science and Technology University, Bangladesh, Email:[email protected].

2Golam Md. Muradul Bashir, Assistant Professor, Dept. of Computer and Communication Engineering, Patuakhali Science and Technology University, Bangladesh. Email: [email protected]

3Md Naimur Rahman, Lecturer, Dept. of Electrical and Electronics Engineering, Patuakhali Science and Technology University, Bangladesh, Email:[email protected]

Abstract

In this study an error analysis for numerical solution of advection equation by finite difference methods is done. However, In order to incorporate initial data the model is treated as an initial value problem. To get analytic solution of the model, we apply the characteristics method. We derive a first order explicit finite difference scheme of the IVP. The numerical scheme is implemented in order to perform the numerical features of error estimation. Moreover, a comparison between explicit upwind difference scheme, explicit centered difference scheme and Lax-Friedrichs scheme is projected herein with a variety of numerical results and relative errors.

Keywords: Finite difference scheme, advection equation, Initial value problem (IVP), Analytic solution, Relative error.

1. Introduction

The aim of this paper is to study the numerical solution of the governing equation treated as Advection equation by the finite difference method. In section 2, we consider first order linear advection equation with initial value problem as the Governing equation based on [1], [2], [4]. In section 3, we represent analytical solution of Advection equation (linear PDE) by the method of characteristics based on [1], [6]. Based on the study of the general finite difference method for first order linear PDE [1], [3], [4], [7], [8], [12], we establish the stability condition of the numerical scheme in section 4. In section 5, to implement the numerical scheme we develop a computer program in scientific programming language. We also present relative errors of the numerical methods to determine the accuracy of numerical methods. Finally the conclusions of the paper are given in the last section.

(2)

M. M. Rahaman

, IJRIT 297 2. Governing equation

In this study we consider the Advection equation as an initial value problem

= 0

∂ + ∂

x u C t

C

(1)

With initial condition

C ( 0 , x ) = C

0

( x )

Where

u

is constant.

3. Analytical solution of Governing equation by the method of characteristics

Method of characteristics is a very important tool for solving linear and non-linear hyperbolic PDE’s as well. In this section we present the method of characteristics for solving a PDE based on [1], [6]. We now consider the linear advection equation.

= 0

∂ + ∂

x u C t

C

(2)

With initial condition

C ( 0 , x ) = C

0

( x )

where

u

is constant.

If we measure the rate of change of C from a moving position given by

x = x ( t )

is then by chain rule,

dt dx x C t C dt

dC .

∂ + ∂

= ∂

Let

u dt

dx =

(3)

Then

+ = 0

= ∂

dx u dC t C dt

dC

by (2)

Confirming that C is constant along these characteristics. An observer moving with this special speed ‘

u

’ would measure no change in C. Now integrating (3) yields.

x = ut + x

0,

x ( 0 ) = x

0 (4)

This formula defines a family of lines in the

( t x , )

-plane, which are called characteristics. As mentioned above, characteristics have the property that

C ( t x , )

takes a constant value along each one of them.

(3)

M. M. Rahaman

, IJRIT 298

Hence to find the value of the solution

C

at

( t x , )

. We consider the characteristics through

( t x , )

of equation

x

0

ut

x = +

which intersects the x-axis at

( x

0

, 0 )

. Since

C

is constant on this line, its value at

( t x , )

is the same as at

( x

0

, 0 )

.

From the initial condition, we have

C ( x , t ) = C ( x

0

, 0 ) = C

0

( x

0

)

at

t = 0

C ( x , t ) = C ( x

0

, 0 ) = C

0

( x

0

) = C

0

( xut )

by (4)

This is the solution of the governing equation

4. Numerical solution of the governing equation by the finite difference method

Finite difference techniques for solving the advection equation can be considered according to the number of spatial grid points involved, the number of time levels used, whether they are explicit or implicit in nature.

4.1 Explicit upwind difference scheme

We consider the Advection equation as initial value problem

= 0

∂ + ∂

x u c t

c

,

x ∈ ( a , b )

(5)

c ( x , 0 ) = c

0

( x )

,

c ( a , t ) = c

a

( t )

Figure 1: Stencil of Explicit upwind difference scheme

Let the solution

c ( x

i

, t

n

)

be denoted by

C

in and its approximate value by

c

in.

Simple approximations to the first derivative in the time direction can be obtained from

(4)

M. M. Rahaman

, IJRIT 299

( )

1

t t o

C C t

c

in in

+ ∆

≈ −

+

(6)

Discretization of

x c

is obtain from backward difference in spatial derivative.

1

o ( x ) x

C C x

c

in in

+ ∆

≈ −

(7)

Substituting (6), (7) into (5), we obtain

1

( ) 0

1

=

∆ +

∆ + + −

+

x t x o

C u C

t C

C

in in in in

(8)

The terms

O ( ∆ t + ∆ x )

in (8) denote the order of the method. Neglecting the error terms in (8) and simplifying. We obtain the difference methods

1

0

1

∆ = + −

+

x c u c t

c

c

in in in in

in 1 in

( c

in

c

in1

) x

u t c

c

+

− ∆

=

c

in+1

= ( 1 − γ ) c

in

+ γ c

in1 (9) Substituting

c

mn

= A ξ

n

e

iβmx in (9) and simplifying, we get

ξ = ( 1 − γ ) + γ e

iβx

ξ

2

= ( 1 − γ + γ cos β ∆ x )

2

+ γ

2

sin

2

β ∆ x

= 14 γ ( 1 − γ ) sin

2

θ

ξ

is called the amplification factor and

β

is a real spatial wave number, A is an arbitrary constant.

Where

2

x

= β

θ

, Maximizing

sin

2

θ

, we obtain

ξ

2

= ( 1 − 2 γ )

2

Hence

ξ ≤ 1

for

0 < γ ≤ 1

, the scheme (9) is stable for

0 < γ ≤ 1

.

(5)

M. M. Rahaman

, IJRIT 300

Now if we chose

γ ≤ 1

, then (9) implies that the new solution is an average of the previous values, the extreme value of the solution at the new time lie between the extreme values of the previous solution. This means that the euds is stable when the CFL condition is satisfied.

4.2 Explicit centered difference scheme

Figure 2: Stencil of Explicit centered difference scheme

Forward difference in time derivative:

( )

1

t t o

C C t

c

in in

+ ∆

= −

+

Centered difference discretization in spatial derivative:

( ) 2

1 2

1

o x

x C C x

c

in in

+ ∆

= −

+

We obtain the explicit centered difference scheme for linear advection equation is

( )

2

1 1

1 n

i n i n

i n

i

c c

x u t c

c

+ +

− ∆

=

(10)

There also is difficulty in determining the solution at the right hand boundary.

Although the numerical domain of dependence for explicit centered difference contains the physical domain of

dependence for

≤ 1

= ∆ x

t

γ u

. Substituting

c

mn

= A ξ

n

e

iβmx in (10) and simplifying, we get

ξ = [ 1 − γ / 2 ( e

iβx

e

iβx

)]

ξ

2

= [ 1 + γ

2

sin

2

β ∆ x ]

= 1 + γ

2

ξ > 1

This scheme is unconditionally unstable

(6)

M. M. Rahaman

, IJRIT 301

4.3 Lax Friedrichs scheme/diffusion difference scheme

Replacing

t c

by a forward in time approximation and

x c

by a spatial centered approximation, and then we have

0

2

1 1 1

∆ = + −

+

+

x c u c

t c

c

in in in in

( )

2

1 1

1 n

i n i n

i n

i

c c

x u t c

c

+ +

− ∆

=

(11)

Unfortunately, despite the quite natural derivation of this method, it suffers from severe stability problem and is useless in practice. Lax-Friedrichs Method is similar to the unstable method (11) but replaces

c

in by

) 2 (

1

1 1

n i n

i

c

c

+

and is stable provided

x t

is sufficiently small. We can write the method in the form

( )

) 2 2 (

1

1 1 1

1

1 n

i n i n

i n i n

i

c c

x u t c c

c

+ + +

− ∆ +

=

(12)

Substituting

c

mn

= A ξ

n

e

iβmx in (12) and simplifying, we get

ξ = [ 1 / 2 ( e

iβx

+ e

iβx

) − γ / 2 ( e

iβx

e

iβx

)]

i x

x t

x u

− ∆

= β 2 sin β

cos 2

Lax method stable when

ξ

2

≤ 1

cos sin

2

1

2 2 2

2

∆ ≤

∆ + ∆

x

x t

x u β

β

u t x

x t u

≤ ∆

∆ ≥

− ∆

⇒ 1 0

2 2 2

,

u > 0

Courant number

(7)

M. M. Rahaman

, IJRIT 302

The scheme is stable for

0 < γ ≤ 1

5. Relative Error Estimation

In order to perform error estimation, we consider the exact solution (1) with initial condition

C

0

( x ) = 0 . 2 + e

x

we get

) ( 0

0

( ) 0 . 2

) ,

( t x C x e

x ut

C = = +

)

2

(

. 0 )

(

x ut

a

e

a

t

C = +

)

2

(

. 0 )

(

x ut

b

e

b

t

C = +

We compute the error defined by

e N e

C C e C

=

for all time where

C

e is the exact solution and

C

N is the Numerical solution computed by the finite difference scheme.

Figure 3: Relative error of ECDS for Advection equation

(8)

M. M. Rahaman

, IJRIT 303

Figure 4: Relative error of EUDS for Advection equation

Figure 5: Relative error of Lux-Friedrichs scheme for Advection equation

Figure shows the relative error of three different schemes for advection equation. Figure-3 shows the relative error for ECDS, which remains below 0.000035. Figure -4 shows the relative error for EUDS which remains below

(9)

M. M. Rahaman

, IJRIT 304

0.00035. Figure-5 shows the relative error for Lux-friedriches scheme which remains below 0.0035. ECDS provides more accurate results than the EUDS and Lux-friedriches scheme with respect to discretization parameter ∆x.

Figure 6: Relative error of ECDS for Advection equation

We have seen from Figure -3 and Figure -6 that the error of ECDS for Advection equation is decreasing with respect to the smaller descretization parameter ∆x. The error is below 0.00008 for ∆x=0.1 and the error is below 0.000035 for ∆x=0.01.

6. Conclusion

In this paper I have discussed the numerical solution of advection equation as an initial value problem. The finite difference method is a powerful tool in solution of Advection problem. We have compared among the three different scheme euds, ecds and lax-friedries for estimating the error in advection equation. The explicit centered difference scheme provides more accurate result than explicit upwind difference scheme and Lax-Friedries scheme. The comparison certifies that the explicit centered difference gives good results.

7. References

[1]. Randall J. LeVeque, Numerical methods for conservation laws, second edition, 1992, Springer.

[2]. Clive L.Dym, Principles of Mathematical Modeling, Academic Press, 2004.

[3]. Mitchell, A., Computational Methods in Partial Differential Equations, Wiley, New York, 1969.

[4]. John A.Trangestein, Numerical Solution of Partial Differential Equation, 2000, Durham.

[5]. L.S.Andallah, Finite Difference Method-Explicit Upwind Difference Scheme, lecturer note, Department of Mathematics, Jahangirnagar University, 2008.

(10)

M. M. Rahaman

, IJRIT 305

[6]. Richard Haberman, Mathematical models, Prentice-Hall, Inc., 1977.

[7]. M.K.Jain, S.R.K.Iyengar,R.K.Jain,Computational Methods for Partial Differential Equations, Book published by New Age International (p) Ltd, Reprint: 2007.

[8]. M.Thongmoon and R.Mckibbin, A comparison of some numerical methods for the advection diffusion equation, Inf.Math.Sci.2006, Vol.10, pp. 49-52.

[9]. D.V. Widder, The heat equation. Academic Press, 1975.

[10]. Romao, Silva, Moura, “Error analysis in the numerical solution of 3D convection diffusion equation by finite difference methods, Thermal technology, 2009, Vol-08, p. 12-17.

[11]. S.S. Sastry, Finite difference approximations to one dimensional parabolic equations using a cubic spline technique, J.Comp.Appl.Math., 2, 1976.

[12]. G.D Smith, Numerical solutions of Partial Differential Equations: Finite Difference methods, third edition.

References

Related documents

(2010) The Arabidopsis peroxisomal ABC transporter, COMATOSE, complements the Saccharomyces cerevisiae pxa1 pxa2D double mutant for metabolism of long chain fatty acids and

By the second semester of 2002, we were not working with the textbook anymore, so I felt freer to engage students in negotiation of topics according to their real interests by

The text is able to educate the young reader on various levels; one, how history is told in a different perspective through the lens of people who have the lived experience; second,

Radial growth analysis on minimal medium showed that the hyphal growth of the ⌬ cbpA strain was decreased compared to that of the wild-type and the ⌬ cbpA ⫹⌬ cbpA strains (Fig. 3A

the present study did not investigate the differences in incidence of complications or other safety management issues between closed and open ICUs, this potential dif- ference

Specific- ally, we provided evidence that MIIP directly binds to PAK1, and this binding attenuates interaction of its medi- ated proteins with its upstream GTPase Rac1 and

WORLD JOURNAL OF SURGICAL ONCOLOGY Xue et al World Journal of Surgical Oncology 2014, 12 404 http //www wjso com/content/12/1/404 RESEARCH Open Access Latexin inhibits the proliferation