Medicine, Science & Technology

A numerical ODE solver that preserves the fixed points and their stability

Description
A numerical ODE solver that preserves the fixed points and their stability
Published
of 12
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
   Journal of Computational and Applied Mathematics 235 (2011) 1856–1867 Contents lists available at ScienceDirect  Journal of Computational and AppliedMathematics  journal homepage: www.elsevier.com/locate/cam A numerical ODE solver that preserves the fixed points and their stability  J. Vigo-Aguiar a,b , Higinio Ramos b,c, ∗ a Department of Applied Mathematics, Universidad de Salamanca, Spain b Scientific Computing Group, Universidad de Salamanca, Spain c Escuela Politécnica Superior de Zamora, Campus Viriato, 49022, Zamora, Spain a r t i c l e i n f o  Article history: Received 14 December 2009Received in revised form 28 June 2010 MSC: 65L0565L0665L70 Keywords: Fixed pointsExact finite difference methodsPredictor–corrector methodNonstandard finite-difference methodsInitial-value problems a b s t r a c t In this paper, we provide a one-step predictor–corrector method for numerically solvingfirst-order differential initial-value problems with two fixed points. The method preservesthe stability behaviour of the fixed points, which results in an efficient integrator for thiskind of problem.Some numericalexamplesareprovidedto show the good performance of the method. © 2010 Elsevier B.V. All rights reserved. 1. Introduction For the general scalar initial-value problem (IVP)  y ′ =  f  (  x ,  y ),  y (  x 0 )  =  y 0 ,  (1)with  y ,  f  (  x ,  y )  ∈  R ,and  x  ∈ [  x 0 ,  x N  ] ,anintervalontherealline,alargenumberofalgorithmshavebeendevelopedtoaddressit: for example the Runge–Kutta, multistep methods, or specific procedures for dealing with particular characteristics.Recently, particularly from the work of Mickens [1,2], the application of non-standard finite-difference methods has been increasing for solving the problem numerically in (1). Their use is mainly based on the fact that they are effective in conserving certain qualitative properties of the differential equation in hand, such as the preservation of fixed points, thepositivity, or the monotonicity of the solutions.ExamplesofsuchschemescanbefoundinRefs.[1,3,4].Thesediscretizationswithzerolocaltruncationerrorsreflectthe dynamics of the differential equations exactly. A well-known procedure of this type involves the logistic equation  y ′ =  y ( 1 −  y )  (2)for which an exact scheme is given by [1]  y n + 1  −  y n 1 − e − h  =  y n + 1 ( 1 −  y n ),  (3) ∗ Corresponding author at: Escuela Politécnica Superior de Zamora, Campus Viriato, 49022, Zamora, Spain. E-mail addresses:  jvigo@usal.es (J. Vigo-Aguiar), higra@usal.es (H. Ramos). 0377-0427/$ – see front matter © 2010 Elsevier B.V. All rights reserved.doi:10.1016/j.cam.2010.07.004   J. Vigo-Aguiar, H. Ramos / Journal of Computational and Applied Mathematics 235 (2011) 1856–1867  1857 which may also be rewritten as [4]  y n + 1  −  y n e h − 1 =  y n ( 1 −  y n + 1 ).  (4)Despitethisexample,ingeneralitisnotclearhowtofindanexactschemeforagivenIVP.Thisisnotthecaseiftheanalyticexact solution is known, from which an exact numerical scheme can be found easily. Consider the IVP corresponding to theequation in (2) given by  y ′ =  y ( 1 −  y ),  y (  x n )  =  y n .  (5)The exact solution for this problem is  y (  x )  = e  x  y n ( e  x − e  x n )  y n  + e  x n from which the numerical method can be readily deduced  y n + 1  = e h  y n 1 + ( e h − 1 )  y n (6)whichisexactforthelogisticIVP.Thisschemeisthesameasthosein(3)orin(4),butwehaveitexpressedinthreedifferent ways. This procedure could be applied to any other IVP for which an explicit exact solution is known.Here we propose a numerical scheme for solving first-order IVPs having two real fixed points. In particular, this schemeturns out to be exact (in the absence of rounding errors) for the problem in (5) or for any IVP whose differential equation isof the form  y ′ =  (  y − v 1 )(  y − v 2 ) . The next section shows how the problem may be simplified and we can assume that thefixed points are  y 1 (  x )  =  0 and  y 2 (  x )  =  1. Section 3 presents the formulation of the scheme with the expression for the localtruncation error, from which the order of the method can be deduced. The particular case of a double fixed point is outlinedin Section 4. Section 6 deals with the stability of the fixed points. In Section 7, we have included some numerical examples and show that the solutions obtained with the new method are very accurate. Finally, in Section 8, some conclusions are presented. 2. Description of the problem We consider a particular kind of the scalar IVP in (1) with two fixed or equilibrium points, given by  y ′ =  (  y − v 1 )(  y − v 2 )  g  (  y ),  y (  x n )  =  y n ,  (7)where  v 1  < v 2  ∈  R and  g  (  y )  ̸    =  0 is a bounded real-valued function with continuous derivatives.Without loss of generality, we may consider that the equilibrium points in the above problem are located at  y  =  0 and  y  =  1. To see this, consider the linear transformation given by  y  =  v 1  + w(v 2  − v 1 ) . After applying this transformation tothe problem in (7), we obtain w ′ =  w(w  − 1 ) ¯  g  (w), w(  x n )  =  w n ,  (8)where  ¯  g  (w)  ̸    =  0 is given by  ¯  g  (w)  =  (v 2  −  v 1 )  g  (v 1  +  w(v 2  −  v 1 ))  and  w n  =  (  y n  −  v 1 )/(v 2  −  v 1 ) . Henceforth, we mayassume that  v 1  =  0 and  v 2  =  1, which results in the problem  y ′ =  y (  y − 1 )  g  (  y ),  y (  x n )  =  y n .  (9) 3. The finite difference scheme The numerical scheme for solving the problem in (9) is based on the following proposition. Proposition 3.1.  Assuming that y n  ̸    =  0 , the solution of the problem in  (9)  may be expressed in the form y (  x ) − 1  y (  x ) =  y n  − 1  y n exp ( I  n ),  (10) withI  n  = ∫   x x n  g  (  y ( t  )) d t  .  1858  J. Vigo-Aguiar, H. Ramos / Journal of Computational and Applied Mathematics 235 (2011) 1856–1867 Proof.  Taking derivatives on both sides in the above expression, the differential equation in (9) follows easily.Note that the solution in (10) may be expressed explicitly as  y (  x )  =  y n  y n  + ( 1 −  y n ) exp (    x x n  g  (  y ( t  )), d t  ) from which we readily obtain that  y (  x n )  =  y n .   Taking  x  =  x n + h  =  x n + 1 ,where h isafixedstepsize,differentnumericalschemesmaybeobtainedafterapproximatingthe integral  I  n  in (10). We have considered two one-step formulas: •  an explicit one, obtained using the approximation for the integral  I  n  ≃  hg  (  y n ) , which results in the formula  y n + 1  − 1  y n + 1 =  y n  − 1  y n exp ( hg  (  y n ))  (11) •  an implicit one, obtained using the trapezoidal rule [5] for approximating the integral,  I  n  ≃  h (  g  (  y n ) +  g  (  y n + 1 ))/ 2, whichresults in the formula  y n + 1  − 1  y n + 1 =  y n  − 1  y n exp  h 2 (  g  (  y n ) +  g  (  y n + 1 ))  .  (12)The above methods will be used in a predictor–corrector implementation using the explicit one as a predictor and theimplicitoneasthecorrector.Inthatcase,theapproximationfor  y (  x n + 1 ) obtainedwiththepredictorwillbedenotedby  y  pn + 1 ,and the approximation obtained with the corrector by  y c n + 1 . The proposed method reads  y  pn + 1  =  y c n  y c n  + ( 1 −  y c n ) exp ( hg  (  y c n )) (13) ξ  n + 1  =  ξ  n  exp  h 2 (  g  (  y c n ) +  g  (  y  pn + 1 ))   (14)  y c n + 1  = 11 − ξ  n + 1 (15)where the first of the formulas has been obtained from (11) and the other two from (12) setting  ξ  n  =  y c n − 1  y c n .Note that the equation in (2) is of the form in (9), with  g  (  y )  = − 1. In this case, the integral in (10) is solved exactly, I  n  = − h , and thus the methods in (11) and in (12) are the same. In fact, the method is exact for this problem and is given by  y n + 1  = e h  y n 1 + ( e h − 1 )  y n ; that is, the above method in (6). Remark 1.  In (11) for the approximation of the integral  I  n , we have substituted the function  g  (  y )  by the interpolatingpolynomial passing through  (  x n ,  g  (  y n )) , while in (12) we have substituted  g  (  y )  by the interpolating polynomial passingthrough the points  (  x n ,  g  (  y n )),(  x n + 1 ,  g  (  y n + 1 )) , as in the Adams methods. Evidently, we could have considered betterapproximations to the integral by taking interpolating polynomials of higher degrees. However, these formulas would havepositive and negative coefficients and could result in a poor performance of the formulas. If   g   >  0  (<  0 ) , then the integral I  n  should be  I  n  >  0  ( I  n  <  0 ) , which is not guaranteed if the formulas have positive and negative coefficients. Remark 2.  We observe that the above scheme may also be used for non-autonomous differential problems of the form  y ′ =  y (  y − 1 )  g  (  x ,  y ) . Remark 3.  The method in (13)–(15) could have been formulated using a different approach, similarly to the Runge-Kuttamethods. Setting k 1  =  hg  (  y n ),  k 2  =  hg    11 − ξ  n  exp ( k 1 )  , the method reads  y n + 1  = 11 − ξ  n  exp (α 1 k 1  + α 2 k 2 ), where  α 1  =  α 2  =  1 / 2 and  ξ  n  =  (  y n  − 1 )/  y n .   J. Vigo-Aguiar, H. Ramos / Journal of Computational and Applied Mathematics 235 (2011) 1856–1867  1859 3.1. Local truncation error  The method in (11) may be written as (  y n + 1  − 1 )  y n  − (  y n  − 1 )  y n + 1  exp ( hg  (  y n ))  =  0 .  (16)Replacing the approximate values  y n ,  y n + 1  by the true values  y (  x n ),  y (  x n + h ) , bearing in mind the value of   g  (  y (  x ))  obtainedfrom (9), after expanding by means of the usual the Taylor formula we have that the local truncation error for the formula in (16) is given by LTE   p (  y (  x n ) ; h )  = 12  y (  x n )(  y (  x n ) − 1 )  g  ′ (  y (  x n )) h 2 + O ( h 3 ),  (17)where  g  ′ (  y (  x n ))  =  d  g  (  y (  x )) d  x  (  x n ) .Similarly, the implicit method in (12) may be written as (  y n + 1  − 1 )  y n  − (  y n  − 1 )  y n + 1  exp  h 2 (  g  (  y n ) +  g  (  y n + 1 ))   =  0 .  (18)Proceeding as before, the local truncation error for the formula in (18) results in LTE  c  (  y (  x n ) ; h )  =− 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ), where  g  ′′ (  y (  x n ))  =  d 2  g  (  y (  x )) d  x 2  (  x n ) .The analysisofthelocalerror forthemethodin(13)–(15)applied in P  ( EC  ) E   mode isabitcumbersomebecause thelocaltruncationerrorofthecorrectorwillbepollutedbythatofthepredictor.Fromthepredictormethodin(13),afterexpanding in the Taylor series, we have  y (  x n  + h ) −  y (  x n )  y (  x n ) + ( 1 −  y (  x n )) exp ( hg  (  y (  x n ))) = 12  y (  x n )(  y (  x n ) − 1 )  g  ′ (  y (  x n )) h 2 + O ( h 3 ).  (19)Taking into account the localizing assumption, on subtracting the formulas in (13) and (19) we have that  y (  x n  + h ) −  y  pn + 1  = 12  y (  x n )(  y (  x n ) − 1 )  g  ′ (  y (  x n )) h 2 + O ( h 3 ),  (20)where the principal term coincides with that of the local truncation error in (17), as expected. From the method in (14), setting  ξ(  x )  =  y (  x ) − 1  y (  x )  , after expanding in the Taylor series, we have ξ(  x n  + h )  =  ξ(  x n ) exp  h 2 (  g  (  y (  x n )) +  g  (  y (  x n  + h )))  +− 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ).  (21)Using the localizing assumption and the formula in (14), we have that ξ(  x n  + h ) − ξ  n + 1  =  ξ(  x n ) e h 2  g  (  y (  x n ))  e h 2  g  (  y (  x n + h )) − e h 2  g  (  y  pn + 1 )  +− 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ). Defining the function  F  (  y )  =  exp ( h 2  g  (  y )) , through the application of the mean value theorem to the bracket in the aboveformula, we have that ξ(  x n  + h ) − ξ  n + 1  =  ξ(  x n ) e h 2  g  (  y (  x n )) ∂ F  ∂  y (η)(  y (  x n  + h ) −  y  pn + 1 ) +− 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ) =  ξ(  x n ) e h 2  g  (  y (  x n )) e h 2  g  (η) h 2d  g  d  y (η)(  y (  x n  + h ) −  y  pn + 1 ) +− 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ) where  η  is an intermediate point between  y (  x n  + h )  and  y  pn + 1 .Introducing (20) in the previous formula, and expanding the exponentials in the Taylor series, we obtain ξ(  x n  + h ) − ξ  n + 1  = 116 (  y (  x n ) − 1 ) 2  g  ′ (  y (  x n )) d  g  d  y (η) h 3 − 112  y (  x n )(  y (  x n ) − 1 )  g  ′′ (  y (  x n )) h 3 + O ( h 4 ) =   116 (  y (  x n ) − 1 )  g  ′ (  y (  x n )) d  g  d  y (η) − 112  y (  x n )  g  ′′ (  y (  x n ))  (  y (  x n ) − 1 ) h 3 + O ( h 4 ).  (22)Finally, from Eq. (15), we have  y (  x n  + h ) −  y c n + 1  = 11 − ξ(  x n  + h ) − 11 − ξ  n + 1 = ξ(  x n  + h ) − ξ  n + 1 ( 1 − ξ(  x n  + h ))( 1 − ξ  n + 1 ).  (23)  1860  J. Vigo-Aguiar, H. Ramos / Journal of Computational and Applied Mathematics 235 (2011) 1856–1867 Now, using the formulas in (22) and in (13)–(14), bearing in mind the localizing hypothesis, we expand in the Taylor series. After some algebra, we obtain  y (  x n  + h ) −  y c n + 1  =   116 (  y (  x n ) − 1 )  g  ′ (  y (  x n )) d  g  d  y (η) − 112  y (  x n )  g  ′′ (  y (  x n ))  (  y (  x n ) − 1 )  y (  x n ) 2 h 3 + O ( h 4 ). Thus,inthefirstcorrectiontheorderofthe P  ( EC  ) E   modeisthatofthecorrector.However,theexpressionoftheprincipalterms of the local truncation errors is different. If we perform a second correction, or even more corrections, the  P  ( EC  ) m E  mode (with  m  ≥  2) has the same order, and its local truncation error has the same principal part as that of the corrector. 4. Particularization in the case of a double fixed point If the differential equation has a double fixed point, the IVP in (7) becomes  y ′ =  (  y − v) 2  g  (  y ),  y (  x n )  =  y n  (24)where  v  ∈  R  and  g  (  y )  ̸    =  0. A procedure for numerically solving the above IVP may be obtained similarly as in previoussections.As for the case before, without loss of generality, we may consider that the equilibrium point in the above problem islocated at  y  =  0. To see this, it suffices to consider the linear transformation given by  y  =  z   +  v . After applying thistransformation to the problem in (24), we obtain  z  ′ =  z  2 ˜  g  (  z  ),  z  (  x n )  =  z  n  (25)where  ˜  g  (  z  )  =  g   (v  +  z  )  ̸    =  0 and  z  n  =  y n  − v .Henceforth, in (24) we can assume that  v  =  0, and thus we might consider that the problem to be solved is of the form  y ′ =  y 2  g  (  y ),  y (  x n )  =  y n .  (26)The numerical scheme for solving the problem in (26) is based on the following proposition. Proposition 4.1.  The solution of the problem in  (26)  may be expressed in the form y (  x )  =  y n 1 −  y n I  n ,  (27) withI  n  = ∫   x x n  g  (  y ( t  )) d t  . Proof.  Taking derivatives on both sides in the above expression, the differential equation in (26) is easily obtained.From the solution in (27), it is straightforward to get that  y (  x n )  =  y n .   Taking  x  =  x n + h  =  x n + 1 ,where h isafixedstepsize,differentnumericalschemesmaybeobtainedafterapproximatingthe integral  I  n  in (27). We have considered two one-step formulas: •  an explicit one, obtained using the approximation for the integral  I  n  ≃  hg  (  y n ) , which results in the formula  y n + 1  =  y n 1 − hy n  g  (  y n ) (28) •  an implicit one, obtained using the trapezoidal rule for approximating the integral,  I  n  ≃  h (  g  (  y n ) +  g  (  y n + 1 ))/ 2, whichresults in the formula  y n + 1  =  y n 1 −  h 2  y n (  g  (  y n ) +  g  (  y n + 1 )).  (29)The above formulas will be used in a predictor–corrector implementation using the explicit one as a predictor and theimplicit one as the corrector. We readily see that the proposed method reads  y  pn + 1  =  y c n 1 − hy c n  g  (  y c n ) (30)  y c n + 1  =  y c n 1 −  h 2  y c n (  g  (  y c n ) +  g  (  y  pn + 1 )).  (31)
Search
Similar documents
View more...
Tags
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks