MPEMathematical Problems in Engineering1563-51471024-123XHindawi Publishing Corporation92527610.1155/2009/925276925276Research ArticleComputationally Efficient Technique for Solving ODE Systems Exhibiting Initial and Boundary LayersParumasurN.SinghP.SinghV.TrendafilovaIrenaSchool of Mathematical SciencesUniversity of KwaZulu-NatalWestville CampusPrivate Bag X54001Durban 4000South Africaukzn.ac.za200902122009200929052009131020092009Copyright © 2009This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

A computational technique based on asymptotic analysis for solving singularly perturbed ODE systems involving a small parameter ϵ is considered. The focus is on second-order systems, but the procedure is also applicable for first-order systems. Both initial value and boundary value problems will be solved. The application of the method is considered over the entire time domain for a wide range of ϵ and the resulting approximation is compared with the direct numerical solution. The convection-diffusion problem from fluid mechanics and the telegraph equation from electrical engineering are considered.

1. Introduction

Singularly perturbed problems involving a small parameter are ubiquitous in the field of engineering and present a formidable challenge in their numerical solution. For example, in the field of fluid mechanics such problems appear in the form of convection-diffusion partial differential equations and are used, in the computation of temperature in compressible flows, to describe the model equations for concentration of pollutants in fluids and to describe the momentum relation of the Navier-Stokes equations. In the field of electrical engineering an important application is the telegraph equation describing the voltage or the current as a function of time and position along a cable. The discretization of such systems usually leads to stiff systems of ordinary differential equations (ODEs) containing a small parameter. Such equations are usually stiff and require special care in their numerical solution. On the other hand, such systems can be treated by methods based on asymptotic analysis which renders a reasonable approximate decomposition of the original system into two new systems, for the slow mode and fast modes, respectively, which are no longer stiff. Of special interest are asymptotic methods based on the Chapman-Enskog procedure (CEP) in which the bulk part of the slow mode is left unexpanded. This technique is especially popular amongst mathematical physicists interested in obtaining the diffusion approximation for a wide range of evolution equations, for example, the Boltzmann equation, telegraph equation, and Fokker-Plank equation . On the other hand, obtaining diffusion approximations is rather complicated and involved and is confined to specialists in the field. In the 1990s Mika and coworkers [2, 3] considered the application of the CEP for solving ODEs. The mathematical theory was put on a sound footing, but subsequently, no attempts were made to promote the numerical application of the method, despite very promising initial results. One reason for this can be attributed to the requirement that their method based on the CEP require the initial conditions for the unexpanded slow part of the solution which have to be recovered from additional algebraic relations. This combined with the initial layer functions guarantee a uniformly smooth solution over the entire domain. For such a solution to be comparable to a direct numerical solution of the original system this step is crucial. In  the authors focused on obtaining uniformly convergent O(ϵ2) approximations in the bulk region. In this paper we propose a method for finding an O(ϵ3) correction to the approximate data. Further, we examine the method for obtaining a solution over the entire domain that is comparable to a direct numerical solution. The method is suitable for a larger range of the small parameter ϵ than that considered previously. An adaptation of the CEP was also considered in [4, 5] for solving problems in chemical kinetics and nuclear engineering, respectively.

Consider the initial value problem

εd2xdt2+Adxdt+f(x)=0,x(0)=α,dxdt(0)=s, where t[0,t1], t1>0,  x(t),  f(x),  α,sn,  n1, and ε is a small positive parameter. The eigenvalues of the matrix A have all positive real parts; hence A is invertible. By letting z=dx/dt, the second-order system (1.1) is converted to the first-order system:

εdzdt=-Az-f(x),dxdt=z,x(0)=α,z(0)=s. The stiff differential equation (1.1) can be solved directly by using numerical methods, for example the finite difference or finite element method. With a finite difference scheme one could use a standard method on a special mesh or a standard mesh and a special method . This is to guarantee uniformly convergent schemes for all values of ε. These techniques, involving discretization on standard meshes and layer-adapted meshes, are well established when f is a linear function of x . However, in our case f is a nonlinear function of the dependent variable x and hence is much more difficult to analyse and solve using these methods. On the other hand, an alternative approach commonly adopted, is to convert to the first-order system (1.2) and then solve by using an implicit method, applicable for stiff systems, since the solution of such systems is well established. It is well known that the solution obtained in this way is usually costly. Alternatively, one could use approximation methods from singular perturbation theory [8, 9] for solving (1.1) or (1.2). The drawback of methods in this category is that they are based on heuristic derivations such as matching of the inner solution in the initial layer with the outer solution in the outer layer. The idea is to create an approximate solution by using the inner solution and then switching to an outer solution ensuring that the inner and outer solutions coincide as nearly as possible at the switch point. The problem is finding a suitable place to make the switch from one solution to the other.

The method proposed in this paper aims to avoid the difficulties presented by the preceding two approaches. Here, we follow the algorithm of the asymptotic expansion first proposed by Mika and Palczewski  for solving resonance type equations in kinetic theory and subsequently applied to solving singularly perturbed systems of second-order ODEs by Mika and Kozakiewicz . As already mentioned, in this case the method is based on the CEP in which the bulk solution for the slow variable x remains unexpanded. The expansions are truncated to first-order in ε in order to derive the first-order version of the steady state approximation. Here we derive new initial conditions satisfied by the differential equations by using a Neumann expansion. The main point of the present exposition is that there is no additional cost involved in deriving the new initial condition whilst at the same time the numerical results are much improved for a larger range of the small parameter ε. The application of the method is also considered for solving boundary value problems. In performing a numerical investigation we apply the new algorithm to systems of initial value problems (IVPs) and boundary value problems (BVPs). The numerical results for IVPs show a significant improvement in the error and reaffirm the first-order rate of convergence which is consistent with the theory  whilst the numerical results for BVPs demonstrate fast convergence of the bulk solution.

2. Derivation of the Asymptotic Procedure

In order to keep the present exposition self-contained, we consider some aspects of the derivation of the asymptotic method presented in  together with the procedure for obtaining new initial conditions. The functions x and z in (1.2) are each decomposed into a bulk solution depending on t and an initial layer solution depending on τ=t/ε. Hence

z(t)=z̅(t)+z̃(τ)+O(ε2),x(t)=w(t)+x̃(τ)+O(ε2), where

z̅(t)=z̅0(t)+εz̅1(t),z̃(τ)=z̃0(τ)+εz̃1(τ),x̃(τ)=x̃0(τ)+εx̃1(τ). The characteristic feature of the algorithm is that the bulk solution w for the slow variable x remains unexpanded. Substituting (2.1) into (1.2) we obtain upon equating functions of t and τ separately

εdz̅dt=-Az̅-f(w),dwdt=z̅,dx̃dτ=εz̅,dz̃dτ=-Az̃+f(w(ετ))-f(w(ετ)+x̃). Now a postulate of the asymptotic method is that the bulk solution for the fast variable, namely, z̅(t), depends on t through its functional dependence on w. To this end, we let ϕ0(w(t)), ϕ1(w(t))n be two functions and write

z̅0(t)=ϕ0(w(t)),z̅1(t)=ϕ1(w(t)). Hence

z̅(t)=ϕ0(w)+εϕ1(w). Substituting (2.8) into (2.3) and (2.4) we obtain

ε[dϕ0dwdwdt+εdϕ1dwdwdt]=-A(ϕ0+εϕ1)-f(w),dwdt=ϕ0(w)+εϕ1(w). Substituting (2.10) into (2.9) and equating coefficients of powers of ε we obtain

ϕ0(w)=-A-1f(w),dϕ0dwϕ0(w)=-Aϕ1(w). and solving the above for ϕ1(w) gives

ϕ1(w)=-A-2df(w)dwA-1f(w). Hence, from (2.4) we obtain w(t) as the solution of the first-order system:

dwdt=-A-1[I+εA-1df(w)dwA-1]f(w). The initial condition w(0) is found by considering the initial conditions in (1.2). For this we require the initial layer solutions. These are obtained by substituting (2.2) into (2.5) and equating powers of ε yielding d̃x0dτ=0,dx̃1dτ=z̃0. Clearly x̃0(τ)0 since limτx̃0(τ)=0 for the initial layer function. Upon substituting (2.2) into (2.6) and using x̃0(τ)0 we further obtain

dz̃0dτ=-Az̃0. Hence

z̃0(τ)=e-Aτz̃0(0),x̃1(τ)=τz̃0(u)du=τe-Auz̃0(0)du=-A-1e-Aτz̃0(0).

Using the initial conditions x(0)=α and z(0)=s in (2.1) we obtain to first-order in ε that

α=w(0)+εx̃1(0),s=ϕ0(w(0))+εϕ1(w(0))+z̃0(0)+εz̃1(0). Mika and Kozakiewicz  now expand w(0) into powers of ε, namely, w(0)=w(0)|0+εw(0)|1. Upon equating coefficients of ε in (2.19)-(2.20) and using the initial layer functions just derived, they obtained the expression w(0)=α+εA-1(s+A-1f(α)). Here w(0) is solved in a different manner. From (2.20) and (2.11) to zeroth order in ε we obtain z̃0(0)=s-ϕ0(w(0))=s+A-1f(w(0)). Using (2.19) and (2.18) we have w(0)=α-εx̃1(0)=α+εA-1[s+A-1f(w(0))]. Hence w(0) is the root of the, in general, nonlinear vector equation (2.23). It is noted that the solution of (2.23) maybe accomplished using the standard Newton method. However, this is in general an expensive process. In order to avoid this we derive an explicit expression for w(0) by letting w(0)=α+δ(ε), where δ(ε) is a function of ε and ||δ(ε)||||α||. Upon substitution into (2.23), using Taylor's theorem and ignoring terms of order δ(ε)2 we obtain the new initial condition

w(0)=α+[I-εA-2f(α)]-1εA-1[s+A-1f(α)]. To simplify the evaluation of (2.24) we use the first-order Neumann expansion for [I-εA-2f'(α)]-1, assuming that ε||A-2f'(α)||<1 for any compatible matrix norm. Hence, (2.24) simplifies to w(0)=α+εA-1[s+A-1f(α)]+ε2A-2f(α)A-1[s+A-1f(α)]. It is clear that no additional cost is borne in forming the Jacobian matrix terms representing the derivative f(α) in (2.25) since the derivative is already used in (2.14). We note that (2.25) reduces to (2.21) when the ε2 term is ignored.

The asymptotic convergence of the approximate solutions derived above is proved in . The condition concerning the nonlinear function in (1.2) is that f(x)C4(n), which supplements the conditions necessary for the system to possess a unique solution on [0,t1]. Furthermore, the matrix A has all positive eigenvalues so that the initial layer solutions decay exponentially.

3. Standard Approach

In the standard first-order approach described, for example, in  to solving (1.2), w(t) in (2.1) is replaced by

x̅(t)=x0(t)+εx1(t). With this substitution in (2.3)–(2.6) one obtains the system

εddt(z0+εz1)=-A(z0+εz1)-f(x0+εx1)=-A(z0+εz1)-f(x0)-f(x0)εx1+O(ε2),ddt(x0+εx1)=z0+εz1,ddτ(x̃0+εx̃1)  =ε(z̃0+εz̃1),ddτ(z̃0+εz̃1)=-A(z̃0+εz̃1)+f(x0+εx1)-f(x0+εx1+x̃0+εx̃1)=-A(z̃0+εz̃1)+f(x0)+f'(x0)εx1-f(x0+x̃0)-f'(x0+x̃0)ε(x1+x̃1)+O(ε2). Upon equating coefficients of ε and using the initial conditions, we obtain the following systems of ODEs to be solved for the bulk solution for the slow variable x(t):

dx0dt=-A-1f(x0),x0(0)=α,dx1dt=-A-2f(x0)A-1f(x0)-A-1f(x0)x1,x1(0)=A-1[s+A-1f(α)]. As before x̃00 and x̃1(τ)=-A-1e-Aτz̃0(0)=-A-1e-Aτ[s+A-1f(α)],z̃0(τ)=e-Aτz̃0(0).

4. Boundary Value Problems

Consider the boundary value problem:

The boundary value problem (4.1) can be converted to the initial value problem (1.1) by dropping the second boundary condition x(1)=β and replacing it by the initial condition x'(0)=s. Hence, f(x) and A are assumed to have similar conditions to that considered in Section 2 on [0,1].

The initial-value problem has a uniquely determined solution x(t)=x(t,s) which depends on the choice of the initial value s for x(0). To determine the value of s consistent with the right-hand boundary condition we must find a zero s=s̅ of the function F(s)=x(1,s)-β. Assuming that F(s)C2(0,1), one can use Newton's method to determine s̅. Starting with an initial approximation s0, one then has to iteratively compute values si according to

si+1=si-[F(si)]-1F(si), where for n=1, F(si) is approximated by the forward difference formula:

F(si+h)-F(si)h, with h|si|. For the case n>1, the matrix F(si) is determined by the following useful technique. The kth column of F(si) is approximated by

F(si+hek)-F(si)h, where ek is the standard unit vector in n with unity in the kth position. Then, x(1,si) is determined by solving an initial-value problem:

In this paper instead of applying the shooting method to the stiff second-order system of equations (4.1) we first apply the first-order asymptotic procedure to the system and then adapt the shooting method to the resulting nonstiff first-order system. Now taking t=1 in (2.1) and (2.18) it can be shown that

w(1):=w(1,s)=β+εA-1e-A/ε[s+A-1f(w(0,s))]. Solve the first-order system (2.14) with estimate (2.25) for w(0)=w(0,s) numerically and denote the solution at t=1 by ŵ(1,s). It remains to determine s so that ŵ(1,s) agrees with w(1,s) from (4.6). Thus we define F(s)=ŵ(1,s)-w(1,s) and iteratively obtain a zero of F(s) using (4.2). A convenient starting value for the iteration is obtained by setting ε=0 and t=0 in (4.1) to yield s0=-A-1f(α). Essentially, we are trying to find an optimal s such that both w(0,s) and w(1,s) lie on the solution curve w(t) of (2.14).

5. Numerical ExamplesExample 5.1.

Here we choose n=1, A=1, f(x)=x2 with α=s=2 in (1.1). Hence, (3.3)–(3.5) reduce to the ODEs: dx0dt=-x02,x(0)=2,dx1dt=-2x0x1-2x03,x1(0)=6, to be solved for the bulk approximation x̅(t)=x0(t)+εx1(t) according to the standard approach. The first-order asymptotic solution to (1.1) using the standard approach is given by x̅(t)=β1+βt+ε[-2β2(1+βt)2ln(1+βt)+β+α2(1+βt)2].

According to the new approach we solve (2.14) which reduces to

dwdt=-(1+ε2w)w2. From (2.21) we obtain w(0)=2+6ε, and using (2.25) we obtain the improved initial condition: w(0)=2+6ε+24ε2.

The graphical solutions depicted in Figure 1 are for ε=0.1. The direct numerical solution of (1.1) is denoted by x and the first-order solution corresponding to (5.2) with the initial layer incorporated is denoted by x(0). When (5.3) is solved using the initial condition (5.4), the solution from (2.1) is denoted by x(1); likewise when (5.3) is solved using the initial condition (5.5) the solution from (2.1) is denoted by x(2).

Figure 2 shows how the error varies as a function of ϵ for t=0.175. It is clear that the present algorithm, incorporating the new initial condition (2.25), gives superior results, even for large ϵ.

Red (dashed): x (direct numerical solution of (1.1)), Green (dashed-dotted): x(1) (solution of (5.3) using (5.4)), Blue (solid): x(2) (solution of (5.3) using (5.5)), Black (dotted): x(0) (standard first-order solution (5.2)).

Comparison of Error as a function of ϵ. Red (dashed): new initial condition (2.25) and Blue (solid): old initial condition (2.21).

Example 5.2.

Since this paper is concerned with systems of ODEs, the following example is directed to such a case. The technique is illustrated for a system of coupled ODEs by choosing n=21 and A=I: fi(x)=xi3+xi+13,i=1,2,,n-1,fn(x)=xn3+x13,αi=sin(π(i-1)n-1),βi=πcos(π(i-1)n-1),i=1,2,,n in (1.1). Solve (2.14) using an explicit Runge-Kutta method of order 2 (RK2) with fixed step size equal to 0.01 subject to the initial conditions (2.21) and (2.25) and designate the solutions by w(1) and w(2), respectively. The corresponding solutions in (2.1) are denoted by x(1) and x(2) respectively. Let x denote a highly accurate solution of (1.1) obtained using Mathematica 6.0 which will be treated as an exact solution for comparison purposes. Equation (1.1) is solved using the implicit Euler method with fixed step size equal to 0.01 and the solution is denoted by x(0). Table 1 shows the errors x-w(1) and x-w(2), respectively. The CPU time for computing x(0) was 0.17 second as compared to 0.02 second for computing both x(1) and x(2) which amounts to a significant saving in computational effort.

Errors in w(1) and w(2).

time (t)x-w(1)x-w(2)
00.03145420.032153
0.10.002047990.00114647
0.20.001173610.000581596
0.30.0008241380.00039628
0.40.0006418710.000314008
0.50.0005283440.00258675
0.60.0004553110.000219198
0.70.0003991950.000195812
0.80.0003547850.000177036
0.90.0003188020.00016153
10.0002890810.0001485
Example 5.3.

One has εd2xdt2+2dxdt-ex=0,x(0)=0,        x(1)=0.

Choose ε=0.01. Figures 3, 4, and 5 show a plot of the solution profiles x(t) (numerical solution) and w(t) (asymptotic bulk solution), corresponding to s0, s1, and s2 used in (4.3) respectively. It is seen that the solution profiles are almost identical (in the bulk region) after the second iteration.

Numerical solution x(t) (dotted) versus first-order asymptotic solution w(t) (solid) (s=s0).

Numerical solution x(t) (dotted) versus first-order asymptotic solution w(t) (solid) after first Newton iteration (s=s1).

Numerical solution x(t) (dotted) versus first-order asymptotic solution w(t) (solid) after second Newton iteration (s=s2).

Example 5.4.

We consider the following boundary layer problem from fluid mechanics: εΔu+γ·u=1on  Ω,u=0on  Ω, where u=u(x,y), γ is a constant, and Ω is the boundary of the square Ω=(0,1)×(0,1). To apply the present algorithm we replace the variable y by t and divide the spatial domain (x(0,1)) into n+2 equally spaced points with spacing h=1/(n+1). Letting Xi=u(xi,t) and using the method of lines to discretize the above equation result in the system of ODEs: εd2Xidt2+γdXidt+γ[Xi+1-Xi-12h]+εh2[Xi+1-2Xi+Xi-1]-1=0,i=1,2,,n. If we let X=[X1,X2,,Xn]t and f(X)=[f1,f2,,fn]t, where fi=γ[Xi+1-Xi-12h]+εh2[Xi+1-2Xi+Xi-1]-1, then the system of ODEs can be written as εd2Xdt2+γdXdt+f(X)=0,X(0)=0,X(1)=0, and n=10.

Choose ε=0.01 and γ=1. Figure 6 shows a plot of the solution profiles X5(t) and w5(t) (asymptotic solution) after the first iteration in s. It is seen that the solution profiles are almost identical (in the bulk region).

Numerical solution X5(t) (dotted) versus first-order asymptotic solution w5(t) (solid) after first Newton iteration (s=s1).

Example 5.5.

Consider the singularly perturbed telegraph equation: ϵ2ut2+γut=μ2ux2-σ(t), where u=u(x,t), γ and μ are constants, and σ is an arbitrary function of t. Consider normal boundary conditions: ux(0,t)=ux(1,t)=0 with initial conditions u(x,0)=sinπx,ut(x,0)=πcosπx.

As in the previous example we used the method of lines to obtain the discretized system of ODEs:

ϵd2Xdt2+γdXdt+f(X)=0, where X=[X0,X1,,XN+1]t, f(X)=[f0,f1,,fN+1]t, fi=(-u/h2)[Xi+1-2Xi+Xi-1]+σXi, i=0,1,,n+1, with X-1=X1 and XN+2=XN. The initial conditions are Xi(0)=sinπxi, X'i(0)=πcosπxi, i=0,1,,n+1, and n=51. Choose ϵ=0.01, γ=1 and σ=1. Figure 7 shows the error in the various solution components. For example, e6(1) corresponds to the error in the sixth solution component using (2.21) and e6(2) corresponds to the error in the sixth solution component using (2.25), respectively. It is evident that using the new algorithm proposed in this paper gives superior numerical results.

Errors for various solution components: red (dotted) using (2.21) and blue (solid) using (2.25).

6. Conclusion

The numerical solution of singularly perturbed second-order ODEs of the form (1.1) involving a single variable and a linear function f(x) is well established. On the other hand, the solution of the system (1.1) with a nonlinear function presents a formidable numerical challenge. The procedure presented in this paper gives an efficient algorithm for solving such systems. The improved algorithm is capable of handling a wider class of problems and at the same time produces a uniform solution over the entire time domain of interest. Furthermore, the numerical examples selected are representative of typical application areas including problems exhibiting multiple boundary layers.

Acknowledgments

The authors would like to thank Professor Janusz Mika for providing them with useful suggestions during the preparation of this manuscript. Also, the authors would like to extend their appreciation to the anonymous referees, whose feedback contributed in improving the manuscript.

MikaJ. R.BanasiakJ.Singularly Perturbed Evolution Equations with Applications to Kinetic Theory199534River Edge, NJ, USAWorld Scientificx+310Series on Advances in Mathematics for Applied SciencesMR1412577MikaJ. R.PalczewskiA.Asymptotic analysis of singularly perturbed systems of ordinary differential equationsComputers & Mathematics with Applications19912110133210.1016/0898-1221(91)90058-CMR1097520ZBL0724.34065MikaJ. R.KozakiewiczJ. M.First-order asymptotic expansion method for singularly perturbed systems of second-order ordinary differential equationsComputers & Mathematics with Applications199325331110.1016/0898-1221(93)90138-LMR1199888ZBL0774.65044GalliM.GroppiM.RigantiR.SpigaG.Singular perturbation techniques in the study of a diatomic gas with reactions of dissociation and recombinationApplied Mathematics and Computation20031462-350953110.1016/S0096-3003(02)00602-1MR2008569ZBL1100.80011BeauwensR.MikaJ.On the improved prompt jump approximationProceedings of the 17th IMACS World Congress Scientific Computation, Applied Mathematics and SimulationJuly 2005Paris, FranceGrossmannC.RoosH.StynesM.Numerical Treatment of Partial Differential Equations2007Berlin, GermanySpringerxii+591UniversitextMR2362757LinssT.Layer-adapted meshes for convection-diffusion problems, Ph.D. thesis2007Technische Universität DresdenMurdockJ. A.Perturbations: Theory and Methods199927Philadelphia, Pa, USASIAMxx+509Classics in Applied MathematicsMR1710387O'MalleyR. E.Jr.Introduction to Singular Perturbations1974New York, NY, USAAcademic Pressviii+206Applied Mathematics and MechanicsMR0402217