Differential Systems Exactly Solved by Multistep Finite Difference Schemes

download Differential Systems Exactly Solved by Multistep Finite Difference Schemes

of 11

Transcript of Differential Systems Exactly Solved by Multistep Finite Difference Schemes

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    1/11

    Contributions to the development of differential systems exactly solved

    by multistep finite-difference schemes

    Higinio Ramos *

    Scientific Computing Group, Universidad de Salamanca, Salamanca, Spain

    Escuela Politcnica Superior de Zamora, Campus Viriato, 49022 Zamora, Spain

    a r t i c l e i n f o

    Keywords:

    Exact finite-difference methods

    Nonstandard finite-difference methods

    Initial value problems

    a b s t r a c t

    The motivation underlying this contribution has been to complete some of the topics con-

    cerning exact schemes for numerically solving ordinary differential equations. A procedure

    for obtaining differential systems exactly solved by a given finite-difference method is

    described. Examples illustrating the application of the procedure for obtaining first-order,

    second-order and systems of differential equations exactly solved by different numerical

    methods are given. Among the numerical methods considered there are the Trapezoidal

    Rule, the two-step AdamsBashforth method and the Numerov method. Some numerical

    examples are presented to provide evidence that the procedure works properly.

    2010 Elsevier Inc. All rights reserved.

    1. Introduction

    Given any sufficiently differentiable real function yx, one can easily find differential equations whose exact solution inthe appropriate domain is yx. If in addition an initial value is also considered, yx0 y0, then the result is an initial valueproblem (I.V.P.) with solution yx. On the other hand, given an I.V.P. of the form y 0(x) =f(x,y(x)), y(x0) =y0, with solution

    y(x) = /(y0,x0,x), there exists an exact finite-difference scheme given by yk+1= /(yk,xk,xk+1) that solves the problem exactly

    (see[1, p. 71]). However, in general for a given I.V.P. there is no guidance as to how to construct an exact scheme. In fact,

    the issue of obtaining this scheme is exactly the same as finding an exact solution for the I.V.P.

    The topic of exact schemes began with the work on best schemes of Potts [2,3]. Exact finite-difference schemes may be

    used to formulate a number of non-standard methods for a variety of ordinary differential equations. These methods will in

    many situations afford difference equations that are superior to conventional ones for the purpose of providing numerical

    solutions. This superiority refers to the fact that important properties of the solutions to the differential equations, such

    as positivity conditions, boundedness of solutions or stability behavior, are shared by the corresponding solutions of the dif-

    ference equations[4]. In[5], Le Roux used exact schemes for ordinary differential equations with blow-up to obtain non-standard schemes for parabolic differential equations with blow-up solutions.

    The aim of this article is to provide a procedure for obtaining I.V.P.s (with a differential equation of any order, or a dif-

    ferential system) that are exactly solved, except for round-off errors, by a given numerical method. This procedure is the

    extension of the technique developed in [6]for one-step methods for scalar differential equations to multistep methods

    for systems of differential equations. The paper is organized as follows: In Section 2, we present a procedure for obtaining

    k-order differential equations exactly solved by a given multistep method. Different examples of finite-difference methods

    are included to illustrate the procedure. In Section3some considerations about the application of finite-difference methods

    for solving systems of differential equations are included. Section 4 shows a procedure for obtaining first-order systems

    0096-3003/$ - see front matter 2010 Elsevier Inc. All rights reserved.doi:10.1016/j.amc.2010.05.101

    * Address: Scientific Computing Group, Universidad de Salamanca, Salamanca, Spain.

    E-mail address: [email protected]

    Applied Mathematics and Computation 217 (2010) 639649

    Contents lists available at ScienceDirect

    Applied Mathematics and Computation

    j o u r n a l h o m e p a g e : w w w . e l s e v i e r . c o m / l o c a te / a m c

    http://-/?-http://-/?-http://-/?-http://dx.doi.org/10.1016/j.amc.2010.05.101mailto:[email protected]://dx.doi.org/10.1016/j.amc.2010.05.101http://www.sciencedirect.com/science/journal/00963003http://www.elsevier.com/locate/amchttp://www.elsevier.com/locate/amchttp://www.sciencedirect.com/science/journal/00963003http://dx.doi.org/10.1016/j.amc.2010.05.101mailto:[email protected]://dx.doi.org/10.1016/j.amc.2010.05.101http://-/?-http://-/?-http://-/?-
  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    2/11

    exactly solved by a numerical scheme. Some numerical examples are also provided along the paper to show the effectiveness

    of the procedure. In Section5 some conclusions complete the article.

    2. A direct approach for obtaining exact differential equations for discrete schemes

    Let us consider a general k-step method for the I.V.P.:

    y0

    f

    x;y

    ; y

    a

    y0;

    y;fx;y 2R; x2 a;b R; 1given by:

    yn1ynhUfh;xn;yn1;yn; . . . ;ynk1; 2where the subscript f on the increment function U means that the dependence ofU on xn, yj, j=n+ 1, n, . . . , n k+ 1 isthrough the functionf(see[7]).

    The method in(2) is said to be consistent of order q if the local truncation error given by:

    LTEyxh yx hUfh;x;yxh;yx; . . . ;yx k 1h;after expanding on Taylors series in powers ofh proves to be:

    LTELyhq1 Ry; hhq2;with Lythe principal term of the local truncation error, which depends on y(x) and its derivatives.

    Evidently, a necessary condition for an I.V.P. of the form in(1)to be solved exactly by the method in(2)is that its solution

    must solve the ordinary differential equation given by Ly 0 (see[6] for the case of one-step methods). That is, the dif-ferential equations formed by the solutions ofLy 0 are candidates to be solved exactly by the numerical method. Theseequations can be obtained as follows: assuming that the general solution ofLy 0 is given by:

    yLx sx;C1; C2; . . . ;Cr; 3

    where the Ci are arbitrary constants, we take the derivative with respect to the independent variable on both sides of the

    above equation, obtaining:

    y0Lx dsx;C1;C2; . . . ;Cr

    dx ; 4

    where y0L

    x

    dyLx

    dx .

    We now consider the algebraic system given by (3) and (4), and after eliminating different combinations of the param-eters and the variables in this system, we obtain some differential equations which are susceptible to be solved exactly by

    the numerical method. A later verification for each of the differential equations obtained is required.

    Application of this procedure to multistep methods designed for higher order differential equations is straightforward, as

    can be seen in the following examples. All we have to do is to take derivatives of the general solution as many times as the

    required order of the differential equation. Thus, for a numerical method designed for a nth-order differential equation the

    resulting algebraic system consists ofn + 1 equations.

    We summarize the above in the following proposition:

    Proposition 1. Given any discrete numerical scheme aimed at solving a kth-order I.V.P., letLy be the principal term of the localtruncation error of the method, and yLx sx; C1;C2; . . . ;Cr the general solution ofLy 0, with the Ci arbitrary constants.Thus, the differential equations obtained after eliminating all different combinations of parameters and variables in the algebraic

    system:

    yLx sx;C1;C2; . . . ;Cr;y0

    Lx ds x;C1 ;C2 ;...;Cr

    dx ;

    ..

    .

    ykLx dksx;C1 ;C2 ;...;Cr

    dxk ;

    8>>>>>>>>>:

    are candidates for exact resolution by the numerical scheme, assuming that appropriate initial values are provided.

    This procedure is the extension of the technique developed in[6]from one-step methods to multistep methods for scalar

    differential equations. In what follows we will illustrate the procedure considering different examples of discrete numerical

    methods.

    2.1. Trapezoidal rule

    The well-known Trapezoidal Rule for solving the I.V.P. in(1)is given by (see[7, p. 46]):

    640 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649

    http://-/?-http://-/?-
  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    3/11

    yn1ynh

    2fxn;yn fxn1;yn1; 5

    and the local truncation error is:

    LTEyxh yx h2

    y0x y0xh h3

    12y000x Oh4: 6

    The necessary condition for an I.V.P. to be solved exactly by this method is y000(x) = 0, whose general solution is

    y(x) =C1+C2x+C3x2

    , whereC1, C2 and C3 are arbitrary constants. We consider the algebraic system given by:

    yx C1C2xC3x2;y0x C2 2C3x;

    (

    and after eliminating the constantsC1,C2,C3 and the variablex, we obtain respectively the following differential equations:

    y0x C2 2C3x;xy0x yC1C3x2;xy0x 2y 2C1C2x;y0x2 C22 4C3y 4C1C3:

    7

    Note that the last differential equation in (7) can be split into two differential equations of the form in (1):

    y0x ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiC22 4C3y 4C1C3q if C2 2C3xP 0; 8y0x

    ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiC22 4C3y 4C1C3

    q if C2 2C3x< 0: 9

    We observe that, in view of the fact that the Ciare arbitrary constants, the first three differential equations in(7)and the

    differential equation in(9),are the same as those in Section 3.2 of[6].

    For proof of the exactness, we apply the method in(5)to each of these differential equations in(7)(9)and solve foryn+1.

    These values ofyn+1 coincide with each of the corresponding exact solutions evaluated at xn+h (for details see[6] and [8]),

    except for the differential equation in(9). The resulting differential equations for the Trapezoidal Rule are valid for any other

    method for which the local truncation error is similar to that in(6), and also for the second-order Taylor method, and for the

    two-step AdamsBashforth method in Section2.3.

    In[8], the autonomous case is dealt with and Corollary 5.1 there holds that the Trapezoidal Rule is exact for differential

    equations of the formy 0ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiCy D

    p ; C> 0; D 2 R. This case is a particularization of(8)takingC= 4C3 and D C22 4C1C3.

    The restrictionC> 0 limits the application of the method, and for example the problemy0 ffiffiffiffiffiffiffiyp is explicitly excluded. How-ever, the above problem would have been excluded only if choice of the initial value had resulted in an I.V.P. without a solu-

    tion. For example, the problemy0 ffiffiffiffiffiffiffiyp ; y0 1 has the solutiony= 1/4(x 2)2 over the interval [0,2], and we may usethe Trapezoidal Rule to solve it; indeed, the method is exact for this problem. Nevertheless, the problem y0 ffiffiffiyp ; y0 1with C= 1 > 0 is of the type in [8], but we cannot use the numerical method to solve it, because it has no real solution.

    Remark 1. We insist that the initial value problems corresponding to the differential equations in (8) must be well

    formulated so that the numerical method can be applied. We have to take into account not only the differential equation, but

    also the initial value. Thus, we must have an I.V.P. for which a solution exists.

    For example, the I.V.P. y0x ffiffiffiffiffiffiffiyp ; y0 1 has no solution, even though the differential equation is of the type in (8).This observation remains valid for any numerical method.

    2.2. A non-standard method

    Let us consider the non-standard method for solving the problem in (1)given by:

    yn1ynehffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffi

    ynyn e2h 1ynfn

    r ;

    whose local truncation error is:

    LTEyxh yxehffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

    yxyx e2h 1yx y0x

    s y

    00x2

    3y0x2

    2yxy0x

    !h

    2 Oh3:

    By solving the differential equation resulting from equating the principal term of the LTE to zero, we obtain the family of

    solutions e2x

    C1

    1 yx

    2

    e2xC

    2 where C

    1 and C

    2 are arbitrary constants. In particular, upon taking C

    1 2C

    1 andC2 e2C1 we obtain the subfamily of solutions given by e2x e2C1

    yx2 e2x, whereC1 is a constant. From this subfamily

    H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 641

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    4/11

    we shall obtain some differential equations for which the above method is exact. After differentiating the last equation, we

    deduce the algebraic system:

    e2x e2C1 yx2 e2x;e2xyx2 e2C1 e2x yxy0x e2x;

    ( 10

    from which we obtain:

    eliminatingC1 or x on(10)we have the differential equation:y0y1 y2; 11

    eliminatingy(x) on(10)we have the differential equation:

    e4C1xe2x e2x e2C1 3y02: 12To check that the method is exact for these differential equations the true solutions are required. With no loss of gener-

    ality, for the differential equation in(11)we may consider that the initial value is located at the origin, y(0) =y0, and in this

    case the solution of the I.V.P.

    y0y1 y2; y0 y0; 13is given by:

    yx

    exffiffiffiffiffiffiffiffiffiffiffiffiffie2xe2k1

    p if y0 > 1;exk1ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffi

    e2xk1 1p if 0< y0 < 1;

    exk1ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffie2xk1 1

    p if 1< y0 < 0;exffiffiffiffiffiffiffiffiffiffiffiffiffi

    e2xe2k1p if y0 >>>>>>>>>>>>>>>>>>:

    where the integration constant k1 takes the values

    k1

    12

    log 1 1y2

    0 ifjy0j> 1;log jy0 jffiffiffiffiffiffiffiffi

    1y20

    p

    if 0>>:

    After some calculations, we see that yn+1=y(xn+h) for xnP 0, and hence the method is exact for the I.V.P.

    Note that the differential equation in(12)can be split into two differential equations of the form in(1), and that the solu-

    tions may easily be obtained by solving an integral. It is straightforward to check that the numerical method is also exact for

    these differential equations.

    We observe that for the differential equation in (13)the numerical method has the same three fixed points as those for

    the differential equation (for this problem a discrete non-exact model has been proposed in [1, p. 103]).

    For the problem in(13)the non-standard method reduces to:

    yn1 ehyn

    ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1 e2h 1y2np :

    The above method has been checked in the problem in(13)with step sizes from 1/10,000 to 1, and with initial values ofy0from 0 up to 200,000 (in some cases resulting in a very stiff problem), and in all cases the value obtained at the final point

    (x= 2) results in an error close to the machine epsilon. Indeed, the iteration functiongy exphy=ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1 exp2h 1y2

    p

    has a condition number given byc(y) = 1/(1 + (exp(2h) 1)y2), which forh > 0 is less than 1 and so no rounding error accu-mulation is expected.

    InFig. 1we see the exact and numerical solutions (represented by lines and dots respectively) with the above method,

    taking a step size ofh= 0.2 for different initial values:y0= 2, 0.2, 0.2, 2. The integration interval was [0,2]. The errors, dueto round-off considerations, are of order 1016, and the numerical solutions converge to the fixed points 1 and 1 (both sta-ble), reproducing the behavior of the exact solutions. It is worth mentioning here that if we use an exact arithmetic instead of

    a binary floating-point one, the errors are exactly zero.

    Remark 2. Although we have analyzed a particular case for this non-standard method in detail, the procedure could be

    applied similarly to the general solution e2x

    C1

    1 yx2

    e2x

    C2 with two arbitrary constants.

    642 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    5/11

    2.3. Two-step AdamsBashforth method

    This is a well-known method for numerically solving the I.V.P. in(1) that reads ([9, p. 358]):

    yn1ynh

    23fxn;yn fxn1;yn1; 14

    and the local truncation error is given by:

    LTEyxh yx h2

    3y0x y0xh 512

    h3y000x Oh4;

    and hence the necessary condition for exactness is the same as for the Trapezoidal Rule, and the differential equations are the

    same as in(7) and (8).

    For proof of the exactness, we apply the method in (14)to each of the differential equations and solve for yn+1. These val-

    ues ofyn+1 coincide with each of the corresponding exact solutions evaluated at xn+h. Thus, the differential equations ob-

    tained for which the two-step AdamsBashforth method is exact are the same as for the Trapezoidal Rule.

    2.4. Numerov method

    The Numerov method[10](also known as two-steps Cowell method, see [11, p. 67], or[12, p. 292]) is one of the most

    widely used techniques for numerically solving second-order differential I.V.P.s of the special form:

    y00x fx;yx; yx0 y0; y0x0 _y0; 15and is given by:

    yn1 2ynyn1 1

    12h

    2fxn1;yn1 10fxn;yn fxn1;yn1

    ;

    with local truncation error:

    LTEyxh 2yx yxh h2

    12y00xh 10y00x y00xh 1

    240h6y6x Oh8:

    The general solution of the equation Ly 0 is y(x) =C1+C2x+C3x2 +C4x3 +C5x4 +C6x5 and hence we consider the algebraicsystem:

    yx C1C2xC3x2 C4x3 C5x4 C6x5;y0x C2 2C3x 3C4x2 4C5x3 5C6x4;y00x 2C3 6C4x 12C5x2 20C6x3;

    8>: 16

    where we can choose different possibilities for eliminating the parametersCiand the variablesx,y(x) andy0(x) (note that the

    resulting differential equation must be of second-order). For the sake of brevity, in what follows we analyze one case in de-

    tail; the other possibilities may be obtained in a similar way and will be shown below.

    Eliminating C3 and y0(x) in the above system, the following differential equation is obtained:

    x2y00x 2yx 2C1 2C2x 4C4x3 10C5x4 18C6x5: 17

    0.5 1.0 1.5 2.0

    2

    1

    1

    2

    Fig. 1. Exact and numerical solutions for problem(13)with the exact non-standard method, takingh = 0.2 for initial values y0= 2,0.2, 0.2, 2.

    H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 643

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    6/11

    Let us check whether the Numerov method is exact for this equation. The general solution of this differential equation is:

    yx C1C2xC4x3 C5x4 C6x5 k1x2 k2x ;

    where k1 and k2 are arbitrary constants. From this we may easily obtain the value y(xn+h).

    After applying the Numerov method to the differential equation, bearing in mind the localization hypothesis thatyn1andyn are the exact values, the value yn+1 is obtained. We have that the above two values are different, with:

    yxnh yn1k2h6 5h2 9x2n

    3 x3nh2xn 3 ; 18

    and therefore the Numerov method in general is not exact for the above differential equation. However, by choosingk2= 0 it

    is evident thaty(xn+h) =yn+1; that is, the Numerov method is exact for the differential equations of the type in(17), whose

    solutions are of the form:

    yx C1C2xC4x3 C5x4 C6x5 k1x2:Proceeding in a similar way, we have found the following differential equations for which the Numerov method is exact:

    eliminating any combination ofC1, C2, y(x) ory 0(x) in(16)results in the differential equation:y00

    2C3

    6C4x

    12C5x

    2

    20C6x

    3;

    eliminatingC4 in (16)results in the differential equation:x2y00x 6C16C2x 4C3x2 6C5x4 14C6x5 6y;

    for which the Numerov method is exact if the solution is of the form:

    yx C1C2xC3x2 C5x4 C6x5 k1x3; eliminatingC5 in (16)results in the differential equation:

    x2y00x 12C1 12C2x 10C3x2 6C4x3 8C6x5 12y;for which the Numerov method is exact if the solution is of the form:

    yx C1C2xC3x2 C4x3 C6x5 k1x4; eliminatingC6 in (16)results in the differential equation:

    x2y00x 20C1 20C2x 18C3x2 14C4x3 8C5x4 20y;for which the Numerov method is exact if the solution is of the form:

    yx C1C2xC3x2 C4x3 C5x4 k1x5;where k1 is an arbitrary constant.

    Any other combination of the parameters and variables to be eliminated for which the method is exact leads to some of

    the previous cases. Note that the resulting differential equations must be of the form in(15).

    3. Considerations about systems of differential equations

    Let us consider the numerical method shown in [13]for solving the I.V.P. in(1) given by:

    yn1yn 2hf

    2n

    2fnhf0n; 19

    where yn=y(xn), yn+1 y(xn+1), fn=f(xn,yn) and:

    f0n@f

    @xxn;yn

    @f

    @yxn;ynfn;

    whose local truncation error may be expressed as:

    LTEyx;h y00x2

    4y0x y3x

    6

    !h

    3 Oh4: 20

    We observe that the method in(19)can also be written in the form:

    644 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    7/11

    yn1ynh 2 y0n 2

    2y0nhy00n; 21

    as presented in[6], or as previously appeared in[14]. In fact, the procedure presented in[13]for obtaining one-step methods

    for solving I.V.P.s leads in the simpler case to the first method of the family of rational one-step methods of van Niekerk[14].

    This method has appeared elsewhere in the literature without properly citing [14], such as in[15](cf. Eq.(8)) or in[16](cf.

    Eq.(8)).

    The method in(19)is not appropriate for solving higher order differential equations directly. In [6],the above method is

    applied to the third-order I.V.P.

    2y0xy3x 3y00x2; y0 y0; y00 _y0; y000 y0: 22To do this, the third-order equation may be rewritten as a first-order system and so the method in (19)could be applied

    using a component-wise implementation, as indicated in [6]. The corresponding first-order system for(22)is:

    y0z; z0w; w03w2

    2z : 23

    The component-wise implementation of method(19)for this system results in the difference system:

    yn1yn 2hz

    2n

    2znhwn ;

    zn1zn 4hznwn4zn 3hwn ;

    wn1wn 3hw2n

    2zn 2hwn ;

    (compare this system with that in [6, p. 1063], where the two first equations were written incorrectly as yn+1 =yn+hzn,

    zn+1=zn+hwn).

    The exact solution for the system in(23)may be written as:

    yx C3 C2C1x ; zx

    C2

    C1x2; wx 2C2C1x3

    ;

    where C1, C2 and C3 are arbitrary constants. Assuming the localization hypothesis for numerical methods that in previous

    points the values were exact, we have that the local truncation error for the first component is:

    LTEyx;h yxh yx 2hzx2

    2zx hwx0;

    as would be expected in view of the local truncation error in (20). Nevertheless, for the other components the local trunca-

    tion errors are not zero, and the method is not exact for the above system.

    At this point it is necessary to make an observation about the comment in [6]:Method (27)[cf.(21)] can only be applied . . .

    using a componentwise implementation. For the autonomous system in(23), it is also possible to use a matrix formulation of

    the method in(19), following a similar procedure as in[15]for the Lintrap scheme. Lety0 = f(y) be the autonomous systemwith y; fy 2 Rm; the scheme in(21)for this problem may be written as:

    yn1yn 2hkn;2IhJn knfyn;

    whereI is the identity matrix, and Jnis the Jacobian of the system evaluated on thenth iteration. The matrix formulation ofthe method for solving systems of differential equations is not applicable in the non-autonomous case. Nevertheless, it

    should be recalled that it is possible, at the cost of raising the dimension by 1, to write a non-autonomous problem in auton-

    omous form.

    The method thus obtained is different from that of component-wise implementation. We have done some computations

    using both approaches and the numerical results are better for the component-wise implementation than for the matrix one.

    The largest number of calculations with the matrix implementation results in slightly larger errors and takes about twice the

    amount of computation time.Table 1shows the performance of the method in (19)for the problem in(23)taking initial

    values y0= 0, z0= 1, w0= 0.1 over the integration interval [0,1.5]. We have considered the number of steps, N, the computa-

    tion time, and the maximum errors measured in the infinity norm:

    Err maxi1;...;N

    kvxi vik1;

    wherev(x

    i) = (y

    (x

    i),z

    (x

    i),w

    (x

    i)) are the exact values, andvi= (y

    i,z

    i,w

    i) are the approximate values obtained with the numericalmethod.

    H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 645

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    8/11

    4. Procedure for obtaining a first-order system for which a numerical method is exact

    Now, the next question is as follows: given a numerical method, how can we obtain a system of first-order differential

    equations for which the method is exact? We show how to proceed with an example.

    We consider the system of two ordinary differential equations given by:

    y0x f1x;yx;zx; z0x f2x;yx;zx;for which we wish the method in(19)to be exact using a component-wise implementation. Based on the local truncation

    error in(20), we consider the system given by:

    y3x 3y00x22y0x ; z

    3x 3z00x22z0x ;

    obtained after equating the principal term of the local errors for each component to zero. The general solution of the above

    system is given by:

    yx C3 C22C1x ; zx C6

    C52C4x ;

    where C1, . . . , C6 are arbitrary constants. From this solution we form the algebraic system:

    yx C3 C22C1x ;y0x C22C1x2;

    zx C6 C52C4x ;z0x C52C4x2;

    8>>>>>>>>>>>:

    24

    where we can eliminate different combinations of the values:

    x;yx;y0x;zx;z0x; C1; . . . ;C6f g;to obtain first-order systems of differential equations for which the numerical method could be exact.

    We can consider 55 different pairs of variables to be eliminated in (24), although not all of them lead to a well formed

    system of first-order differential equations. If we had considered one, two or three variables to be eliminated, the total num-

    ber of combinations would have risen to 231. For the sake of brevity we only show a few of the systems obtained:

    eliminatingC1 and C4 in (24), we obtain the system:

    y0C23 2C3yy2

    C2; z0C

    26 2C6zz2

    C5

    ( );

    eliminatingC1 and C5 in (24), we obtain the system:

    y0C23 2C3yy2

    C2; z0 C6z

    2C4x

    ( );

    eliminatingx and C5 in (24), we obtain the system:

    y0C23 2C3yy2

    C2; z0 C3C6C3zC6yyz

    2C1y 2C4yC2 2C3C42C1C3

    ( );

    eliminatingx and z(x) in(24),we obtain the system:

    Table 1

    Data for problem(23)on [0,1.5] taking initial values y0= 0, z0= 1, w0= 0.1, using the component-wise and matrix implementations.

    N Componentwise Matrix

    Err Time (s) Err Time (s)

    250 5.4701 109 0.015 9.1682 108 0.032500 1.3680 109 0.031 2.2920 108 0.063

    1000 3.4208 1010 0.062 5.7301 109 0.1102000 8.5529

    1011 0.109 1.4325

    109 0.250

    646 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    9/11

    y0 C232C3yy2C2

    ;

    z0 C5 C232C3yy2

    C22C1C32C1y2C3C42C4y 2;

    8>:

    eliminatingz(x) and C2 in (24)we obtain the system:

    y0 C3y2C1

    x; z0 C5

    2C4

    x

    2

    ( ):

    We have checked that for these systems the numerical method in (19)applied in a component-wise implementation is

    exact. The analytical solutions were obtained using the Mathematica command DSolve[17]. The use of Mathematica was

    also helpful for obtaining the second derivatives, which are needed to obtain the values yn+1, zn+1 by using the numerical

    method in(19).

    To illustrate the above results we have considered a differential system of one of the above types given by:

    y0y2;z0yyz;

    ( 25

    which for initial values y(0) =y0,z(0) =z0 has the exact solution:

    yx y01

    xy0

    ; zx xy0z01

    xy0

    :

    Each component of the solution has a singularity of the movable pole type [18]located at the same point, x = 1/y0, and for

    y0> 0 each corresponding curve on [0,1) consists of two branches separated by a vertical asymptote, near which the solu-tion has a two-sided infinite discontinuity. Takingy0= 1/3,z0= 0, we have solved the problem with the method in (19)over

    the interval [x0,xN] = [0,5]. InFigs. 2 and 3the exact and numerical solutions for each component (when N= 32) are shown,

    where the vertical lines reflect the existence of the singularity. We observe that the numerical solution reproduces the

    behavior of the true solution faithfully and the method has no difficulties in crossing the singularity.

    Table 2presents the results for each component taking different number of steps, N= 2j forj = 3, . . . ,9. The errorsErrmaxhave been obtained as the maximum of the absolute errors at the nodal points xj=x0+jh,j = 1, . . . , NI. For this problem with

    unbounded solutions, the relative error is a useful quantity, so we have included the error ErrRelmax, which is the maximum

    of the relative errors at the nodal points. Since the errors are due only to round-off considerations, we note that as the num-

    ber of steps increases so does the corresponding error. In fact, using exact arithmetic the errors prove to be zero.

    The procedure in this Section may be summarized as follows:

    Proposition 2. Given any discrete numerical scheme aimed at solving a first-order I.V.P., letLy be the principal term of the localtruncation error of the method, and y(x) = s(x, C1, C2, . . . , Cr) the general solution ofLy 0, with the Ciarbitrary constants. Thus,the m-systems of first-order differential equations obtained after eliminating all the different combinations of parameters and

    variables in the algebraic system:

    yjx sx;C1j; C2j; . . . ;Crj;y0jx

    dsx;C1j ;C2j ;...;Crjdx

    ; j1; . . . ;m;

    (

    1 2 3 4 5

    4

    2

    2

    4

    Fig. 2. Exact and numerical solutions for y(x) with the method in (19),takingN= 25.

    H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 647

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    10/11

    are candidates to be solved exactly by the numerical scheme on the basis of a component-wise implementation, assuming that

    appropriate initial values are provided.

    5. Conclusions

    A procedure for obtaining differential equations for which a given discrete numerical method is exact is shown. The pro-

    cedure applies not only to one-step methods, but also to multistep methods, either linear or nonlinear. If the numerical

    method is intended for higher order initial value problems, the procedure allows us to obtain the corresponding higher order

    differential equations. Moreover, it is shown how to proceed for obtaining a system of first-order ordinary differential equa-

    tions for which the component-wise application of a numerical method results to be exact.

    Acknowledgements

    The author wishes to thank the anonymous referees for their careful reading of the manuscript.

    References

    [1] R.E. Mickens, Nonstandard Finite Difference Models of Differential Equations, World Scientific, Singapore, 1994.[2] R.B. Potts, Best difference equation approximation to Duffings equation, J. Aust. Math. Soc. Ser. B 23 (1982) 349456.[3] R.B. Potts, Nonlinear difference equations, Nonlinear Anal. 6 (1982) 659665.[4] R.E. Mickens, Applications of Nonstandard Finite Difference Schemes, World Scientific, Singapore, 2000.[5] M.N. Le Roux, Semidiscretization in time of nonlinear parabolic equations with blowup of the solution, SIAM J. Numer. Anal. 31 (1994) 170195.

    [6] F.R. Villatoro, Given a one-step numerical scheme, on which ordinary differential equations is it exact?, J Comput. Appl. Math. 223 (2009) 10581065.

    1 2 3 4 5

    15

    10

    5

    5

    10

    Fig. 3. Exact and numerical solutions for z(x) with the method in (19),taking N= 25.

    Table 2

    Errors for each component of the problem in (25) on [0,5], taking initial values y0= 1/3,z0= 0, with the method in(19).

    j Errmax ErrRelmax

    y(x) 3 1.7763 1014 2.2204 10154 1.5099 1014 2.8310 10155 8.1712 1014 2.5535 10156 9.5568 1013 2.9865 10147 9.0949 1013 1.0658 10148 1.7848 1011 1.3944 10139 1.4142 1010 2.7622 1013

    z(x) 3 5.6843 1014 2.2737 10154 4.7961 1014 3.1974 10155 2.2737 1013 2.4158 10156 2.8137 1012 2.9618 1014

    7 2.7853 1012

    1.0712 1014

    8 5.3205 1011 1.3819 10139 4.2518 1010 2.7699 1013

    648 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649

  • 7/21/2019 Differential Systems Exactly Solved by Multistep Finite Difference Schemes

    11/11

    [7] J.D. Lambert, Numerical Methods for Ordinary Differential Systems, John Wiley, England, 1991.[8] M.J. Gander, R. Meyer-Spasche, An introduction to numerical integrators preserving physical properties, in: R.E. Mickens (Ed.), Applications of

    Nonstandard Finite Difference Schemes, World Scientific, Singapore, 2000, pp. 181246.[9] E. Hairer, S.P. Norsett, G. Wanner, Solving Ordinary Differential Equations I. Nonstiff problems, Springer, Berlin, 1993.

    [10] B.V. Numerov, A method of extrapolation of perturbations, R. Ast. Soc. Mon. Not. 84 (1924) 592601.[11] L.G. Ixaru, Numerical Methods for Differential Equations and Applications, Editura Academiei, Romania, 1984.[12] P. Henrici, Discrete Variable Methods in Ordinary Differential Equations, John Wiley, New York, 1962.[13] H. Ramos, A non-standard explicit integration scheme for initial-value problems, Appl. Math. Comput. 189 (2007) 710718.[14] F.D. van Niekerk, Rational one-step methods for initial value problems, Comput. Math. Appl. 16 (1988) 10351039.[15] R. Meyer-Spasche, Difference schemes of optimum degree of implicitness for a family of simple ODEs with blow-up solutions, J. Comput. Appl. Math.

    97 (1998) 137152.[16] F.J. Solis, B. Chen-Charpentier, Nonstandard discrete approximations preserving stability properties of continuous mathematical models, Math.

    Comput. Model. 40 (2004) 481490.[17] S. Wolfram, Mathematica. A System for Doing Mathematics by Computer, Addison-Wesley, Redwood City, CA, 2000.[18] E. Hille, Ordinary Differential Equations in the Complex Domain, John Wiley & Sons, New York, 1976.

    H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 649