# On a New Reliable Algorithm

Authors: A. K. Alomari; M. S. M. Noorani; R. Nazar
Journal: International Journal of Differential Equations
 (2009)

---

## Abstract

An analytical expression for the solution of the prey-predator problem by an adaptation of the homotopy analysis method (HAM) is presented. The HAM is treated as an algorithm for approximating the solution
of the problem in a sequence of time intervals; that is, HAM is converted into a
hybrid numeric-analytic method called the multistage HAM (MSHAM). Comparisons between the MSHAM solutions and the fourth-order Runge-Kutta (RK4) numerical solutions reveal that the new technique is a promising tool
for the nonlinear systems of ordinary differential equations.


---

## Body

## 1. Introduction

Most modelling of biological problems is characterized by systems of ordinary differential equations (ODEs). For example, the relationship of increasing and decreasing in the population of two kind of animals (such as rabbits and foxes) can be described by the so-called mathematical model of the prey-predator problem which is given by a system of nonlinear equations:(1.1)dx(t)dt=x(t)(a-by(t)),x(t0)=c1,dy(t)dt=-y(t)(c+dx(t)),y(t0)=c2,
where x(t) and y(t) are, respectively, the populations of rabbits and foxes at the time t and a,b,c, and d are known coefficients (for more details, see [1]). Problems of this nature have been solved using classical numerical techniques such as Runge-Kutta and are now published in most textbooks on differential equations.Authors in [2, 3] used the Adomian decomposition method (ADM) to handle the systems of prey-predator problem. Yusufoğlu and Erbas [4] and Rafei et al. [5] employed the variational iteration method (VIM) to compute an approximation to the solution of the system of nonlinear differential equations governing the problem. Biazar et al. [6] used the power series method (PSM) to handle the systems. All the solutions above are in the form of convergent power series with polynomial base function.In recent years, a great deal of attention has been devoted to study HAM, which was first envisioned by Liao in his Ph.D. thesis [7] for solving a wide range of problems whose mathematical models yield differential equation or system of differential equations [8–12]. HAM has successfully been applied to many situations. For example, Hayat and Sajid [13], Hayat and Khan [14], and Hayat et al. [15, 16] used HAM to solve many kinds of modelling in fluid problems. Xu and Liao [17] applied HAM to give the dual solutions of boundary layer flow over an upstream moving plate. Abbasbandy [18] used HAM to present solitary wave solutions to the Kuramoto-Sivashinsky equation. Sami Bataineh et al. [19] modified the HAM (MHAM) to show that Taylor series converge to the exact solution by expanding the coefficients variables using Taylor series. Alomari et al. [20] introduced a new reliable algorithm based on an adaptation of the standard HAM to solve Chen system. In recent years, this method has been successfully employed to solve many types of problems in science and engineering [21–28].In this paper, we are interested to find the approximate analytic solution of the system of coupled nonlinear ODEs (1.1) by treating the HAM as an algorithm for approximating the solution of the problem in a sequence of time intervals. We shall call this technique as the multistage homotopy analysis method (MSHAM). The freedom of choosing the linear operator and the auxiliary parameter ℏ is still present in this modification. Different from the series solution in [2–5], the solution we present here uses a combination of base functions, namely, the polynomial and exponential functions, and it is effective for longer time. Comparison with the classical fourth-order Runge-Kutta (RK4) shall be made.


## 2. Solution Procedure

Consider the following general system of first-order ordinary differential equations (ODEs):(2.1)yi′=fi(t,y1,y2,…,yn),yi(t0)=yi,0,i=1,2,…,n,
where fi are (linear or nonlinear) real-valued functions, t0∈ℜ is the initial condition, and yi,0∈ℜ.


### 2.1. Solution by HAM

In HAM [8], system (2.1) is first written in the form(2.2)Ni[yi(t)]=0,i=1,2,…,n,
where Ni are nonlinear operators, t denotes the independent variable, and yi(t) are the unknown functions. By means of generalizing the traditional homotopy method, Liao [8] constructs the so-called zeroth-order deformation equation:(2.3)(1-q)L[ϕi(t;q)-yi,0]=qℏiNi[ϕi(t;q)],
where q∈[0,1] is an embedding parameter, ℏi are the nonzero auxiliary parameters, L is an auxiliary linear operator, yi,0(t) are the initial guesses of yi(t), and ϕi(t;q) are the unknown functions. It is important to note that one has great freedom to choose auxiliary objects such as ℏi and L in HAM. We note that, in the framework of HAM, the solution yi(t) can be represented by many different base functions such as the polynomial functions, exponential functions and rational functions, and so forth. Obviously, when q=0 and q=1, both ϕi(t;0)=yi,0(t) and ϕi(t;1)=yi(t) hold. Thus, as q increases from 0 to 1, the solution ϕi(t;q) varies from the initial guess yi,0(t) to the solution yi(t). Expanding ϕi(t;q) in Taylor series with respect to q, one has
(2.4)ϕi(t;q)=yi,0(t)+∑m=1∞yi,m(t)qm,
where(2.5)yi,m(t)=1m!∂mϕi(t;q)∂qm|q=0.
If the auxiliary linear operators, the initial guesses, the auxiliary parameters ℏi, and the auxiliary function are so properly chosen, then the series (2.4) converges at q=1 and(2.6)ϕi(t;1)=yi,0(t)+∑m=1∞yi,m(t),
which must be one of the solutions of the original nonlinear equations, as proved by Liao [8].Define the vector(2.7)y⃗i,n(t)={yi,0(t),yi,1(t),…,yi,n(t)}.
Differentiating (2.3) m times with respect to the embedding parameter q and then setting q=0 and finally dividing them by m!, we have the so-called mth-order deformation equation:(2.8)L[yi,m(t)-χmyi,m-1(t)]=ℏiHi(t)Ri,m(y⃗i,m-1),
where(2.9)Ri,m(y⃗i,m-1)=1(m-1)!∂m-1Ni[ϕi(t;q)]∂qm-1|q=0,χm={0,m≤1,1,m>1.
It should be emphasized that yi,m(t)(m≥1) is governed by the linear (2.8) with the linear boundary conditions that come from the original problem, which can be easily solved by symbolic computation softwares such as Maple and Mathematica. Also,(2.10)yi(t)≃φi,k(t)=∑m=0kyi,m(t),


### 2.2. Solution by MSHAM

The approximate solutions (2.10) are generally, as shall be shown in the numerical experiments of this paper, not valid for large t. A simple way of ensuring validity of the approximations for large t is to treat (2.3) and (2.8) as an algorithm for approximating the solutions of (2.1) in a sequence of intervals: the solution from [t0,t) will be derived by subdividing this interval into [t0,t1),[t1,t2),…,[tn-1,t) and applying the HAM solution on each subinterval. The initial approximation in each interval is taken from the solution on the previous interval:(2.11)yi,0(t)=yi(t*)=c1*,
where t* is the left-end point of each subinterval.Now we solve (2.8) for unknowns yi,j(t)(i=1,2,…;j=1,2…,m). In order to carry out the iteration in every subinterval of equal length h, [t0,t1), [t1,t2), [t2,t3),…,[tj-1,t), we need to know the values of the following:(2.12)yi,0*=yi(t*),i=1,2,….
But, in general, we do not have these information at our disposal except at the initial point t*=t0. A simple way for obtaining the necessary values could be by means of the previous n-term approximations φ1,k,φ2,k,…,φi,k of the preceding subinterval given by (2.10), that is,(2.13)y1,0*=φ1,k(t*),y2,0*=φ2,k(t*),…,yi,0*=φi,k(t*).


## 2.1. Solution by HAM

In HAM [8], system (2.1) is first written in the form(2.2)Ni[yi(t)]=0,i=1,2,…,n,
where Ni are nonlinear operators, t denotes the independent variable, and yi(t) are the unknown functions. By means of generalizing the traditional homotopy method, Liao [8] constructs the so-called zeroth-order deformation equation:(2.3)(1-q)L[ϕi(t;q)-yi,0]=qℏiNi[ϕi(t;q)],
where q∈[0,1] is an embedding parameter, ℏi are the nonzero auxiliary parameters, L is an auxiliary linear operator, yi,0(t) are the initial guesses of yi(t), and ϕi(t;q) are the unknown functions. It is important to note that one has great freedom to choose auxiliary objects such as ℏi and L in HAM. We note that, in the framework of HAM, the solution yi(t) can be represented by many different base functions such as the polynomial functions, exponential functions and rational functions, and so forth. Obviously, when q=0 and q=1, both ϕi(t;0)=yi,0(t) and ϕi(t;1)=yi(t) hold. Thus, as q increases from 0 to 1, the solution ϕi(t;q) varies from the initial guess yi,0(t) to the solution yi(t). Expanding ϕi(t;q) in Taylor series with respect to q, one has
(2.4)ϕi(t;q)=yi,0(t)+∑m=1∞yi,m(t)qm,
where(2.5)yi,m(t)=1m!∂mϕi(t;q)∂qm|q=0.
If the auxiliary linear operators, the initial guesses, the auxiliary parameters ℏi, and the auxiliary function are so properly chosen, then the series (2.4) converges at q=1 and(2.6)ϕi(t;1)=yi,0(t)+∑m=1∞yi,m(t),
which must be one of the solutions of the original nonlinear equations, as proved by Liao [8].Define the vector(2.7)y⃗i,n(t)={yi,0(t),yi,1(t),…,yi,n(t)}.
Differentiating (2.3) m times with respect to the embedding parameter q and then setting q=0 and finally dividing them by m!, we have the so-called mth-order deformation equation:(2.8)L[yi,m(t)-χmyi,m-1(t)]=ℏiHi(t)Ri,m(y⃗i,m-1),
where(2.9)Ri,m(y⃗i,m-1)=1(m-1)!∂m-1Ni[ϕi(t;q)]∂qm-1|q=0,χm={0,m≤1,1,m>1.
It should be emphasized that yi,m(t)(m≥1) is governed by the linear (2.8) with the linear boundary conditions that come from the original problem, which can be easily solved by symbolic computation softwares such as Maple and Mathematica. Also,(2.10)yi(t)≃φi,k(t)=∑m=0kyi,m(t),


## 2.2. Solution by MSHAM

The approximate solutions (2.10) are generally, as shall be shown in the numerical experiments of this paper, not valid for large t. A simple way of ensuring validity of the approximations for large t is to treat (2.3) and (2.8) as an algorithm for approximating the solutions of (2.1) in a sequence of intervals: the solution from [t0,t) will be derived by subdividing this interval into [t0,t1),[t1,t2),…,[tn-1,t) and applying the HAM solution on each subinterval. The initial approximation in each interval is taken from the solution on the previous interval:(2.11)yi,0(t)=yi(t*)=c1*,
where t* is the left-end point of each subinterval.Now we solve (2.8) for unknowns yi,j(t)(i=1,2,…;j=1,2…,m). In order to carry out the iteration in every subinterval of equal length h, [t0,t1), [t1,t2), [t2,t3),…,[tj-1,t), we need to know the values of the following:(2.12)yi,0*=yi(t*),i=1,2,….
But, in general, we do not have these information at our disposal except at the initial point t*=t0. A simple way for obtaining the necessary values could be by means of the previous n-term approximations φ1,k,φ2,k,…,φi,k of the preceding subinterval given by (2.10), that is,(2.13)y1,0*=φ1,k(t*),y2,0*=φ2,k(t*),…,yi,0*=φi,k(t*).


## 3. Application

In this part, we apply the MSHAM for the prey-predator problem subject to the initial conditions(3.1)x(t*)=c1,y(t*)=c2.
We note that when t*=0, we have the initial condition of (1.1). Let the set of the base functions be(3.2){tne-st∣n≥0,s≥0}.
So the solutions are(3.3)x(t)=d0,0+∑s=0+∞∑n=0+∞dn,sntne-st,y(t)=b0,0+∑s=0+∞∑n=0+∞bn,sntne-st,
where dn,sn and bn,sn are the coefficients. It is straightforward to choose(3.4)x0(t)=c1,y0(t)=c2,
as our initial approximations of x(t) and y(t), and the linear operator should be(3.5)L[ϕ(t;q)]=∂ϕ(t;q)∂t+ϕ(t;q)
with the property(3.6)L[Ae-t]=0,
where A is the integration constant, which will be determined by the initial condition.Ifq∈[0,1] and ℏ indicate the embedding and nonzero auxiliary parameters, respectively, then the zeroth-order deformation problems are of the following form:(3.7)(1-q)L[x̂(t;q)-x0(t)]=qℏNx[x̂(t;q),ŷ(t;q)],(1-q)L[ŷ(t;q)-y0(t)]=qℏNy[x̂(t;q),ŷ(t;q)],
subject to the initial conditions(3.8)x̂(t*;q)=c1,ŷ(t*;q)=c2,
in which we define the nonlinear operators Nx and Ny as(3.9)Nx[x̂(t;q),ŷ(t;q)]=∂x̂(t;q)∂t-x̂(t;q)(a-bŷ(t;q)),Ny[x̂(t;q),ŷ(t;q)]=∂ŷ(t;q)∂t+ŷ(t;q)(c-dx̂(t;q)).
For q=0 and q=1, the above zeroth-order equations (3.7) have the solutions(3.10)x̂(t;0)=x0(t),ŷ(t;0)=y0(t),(3.11)x̂(t;1)=x(t),ŷ(t;1)=y(t).
When q increases from 0 to 1, then x̂(t;q) and ŷ(t;q) vary from x0(t) and y0(t) to x(t) and y(t). Expanding x̂ and ŷ in Taylor series with respect to q, we have(3.12)x̂(t;q)=x0(t)+∑m=1∞xm(t)qm,ŷ(t;q)=y0(t)+∑m=1∞ym(t)qm,
in which(3.13)xm(t)=1m!∂mx̂(t;q)∂qm|q=0,ym(t)=1m!∂mŷ(t;q)∂qm|q=0,
where ℏ is chosen in such a way that these series are convergent at q=1. Therefore, we have through (3.11) that(3.14)x(t)=x0(t)+∑m=1∞xm(t),y(t)=y0(t)+∑m=1∞ym(t).Define the vectors(3.15)x⃗(t)={x0(t),x1(t),…,xn(t)},y⃗(t)={y0(t),y1(t),…,yn(t)}.
Differentiating the zeroth-order equations (3.7) m times with respect to q, then setting q=0, and finally dividing by m!, we have the mth-order deformation equations:(3.16)L[xm(t)-χmxm-1(t)]=ℏRx,m(x⃗(t),y⃗(t)),L[ym(t)-χmym-1(t)]=ℏRy,m(x⃗(t),y⃗(t)),
with the following boundary conditions:(3.17)xm(t*)=0,ym(t*)=0,
for all m≥1, where(3.18)Rx,m(x⃗(t),y⃗(t))=xm-1′-axm-1+b∑i=0m-1xi(t)ym-1-i(t),Ry,m(x⃗(t),y⃗(t))=ym-1′+cxm-1-d∑i=0m-1yi(t)xm-1-i(t).
This way, it is easy to solve the linear nonhomogeneous Equations (3.16) at general initial conditions by using Maple, one after the other in the order m=1,2,3,….  Thus we successfully have
(3.19)x1(t)=-ℏc1a+ℏc1bc2-e-t(-ℏc1a+ℏc1bc2)e-t*,y1(t)=ℏc2c-ℏc2dc1-e-t(ℏc2c-ℏc2dc1)e-t*,x2(t)=(-ℏ2c1et*bc2t*-ℏc1eta+ℏc1etbc2+ℏ2c1a2et-ℏ2c1a2et*-2ℏ2c1abc2et+2ℏ2c1aet*bc2+ℏ2c1b2c22et-ℏ2c1b2c22et*+c1bℏ2c2cet-c1bℏ2c2cet*-c12bℏ2c2det+c12bℏ2c2det*+ℏc1et*a-ℏ2c1aet*t+ℏ2c1et*at*-ℏc1bc2et*+ℏ2c1et*a2t*-2ℏ2c1et*abc2t*+ℏ2c1et*b2c22t*+ℏ2c1et*bc2ct*-ℏ2c12et*bc2dt*+ℏ2c1bc2et*t-ℏ2c1a2et*t+2ℏ2c1aet*bc2t-ℏ2c1b2c22et*t-ℏ2c1bc2cet*t+ℏ2c12bc2det*t)e-t,y2(t)=(-2ℏ2c2cdc1et+ℏ2c2d2c12et+2ℏ2c2et*cdc1-ℏ2c2et*d2c12+c2dℏ2c1aet-c22dℏ2c1bet-c2dℏ2c1et*a+c22dℏ2c1et*b+etℏc2c-etℏc2dc1+ℏ2c2et*d2c12t*+ℏc2et*dc1-ℏ2c2et*ct*+ℏ2c2et*dc1t*+ℏ2c2et*c2t*-2ℏ2c2et*cdc1t*+ℏ2c2et*dc1at*-ℏ2c22et*c1bdt*+ℏ2c2et*ct-ℏ2c2et*dc1t-ℏ2c2et*c2t+2ℏ2c2et*cdc1t-ℏ2c2et*d2c12t-ℏ2c2dc1et*at+ℏ2c22c1bdet*t-ℏc2et*c+ℏ2c2c2et-ℏ2c2et*c2)e-t,⋮
By the same way we can get the first fourth term to be as analytical approximate solution as x(t)≃∑i=04xi(t) and y(t)≃∑i=04yi(t) terms. Now we divide the interval [0,T] to subintervals by time step Δt=0.01; Then we start from the initial conditions and we get the solution on the interval [0,0.01). Further, we take c1=x(0.01) and c2=y(0.01) and t*=0.01, so we get the solution on the new interval [0.01,0.02), and so on. Therefore, by choosing this initial approximation on the starting of each interval, the solution on the whole interval should be continuous. It is worth mentioning that if we take t*=0 and we fixed c1 and c2, then the solution will be the standard HAM solution which is not effective at large value of t.


## 4. Analysis of Results

In this section, we compare the fourth term of the MSHAM solution using step size0.01 with RK4 using step size Δt=0.001 for the following cases.Case 1.
a=1, b=1, c=0.1, d=1, and the initial conditions x(0)=14 and y(0)=18.Case 2.
a=0.1, b=1, c=1, d=1, and the initial conditions x(0)=14 and y(0)=18.Case 3.
a=1, b=1, c=0.1, d=1, and the initial conditions x(0)=16 and y(0)=10.Case 4.
a=0.1, b=1, c=1, d=1, and the initial conditions x(0)=16 and y(0)=10.Case 5.
a=1, b=1, c=1, d=1, and the initial conditions x(0)=3 and y(0)=2.Figure1 presents the ℏ-curves for 5th-order of approximations of the prey-predator problem at different cases. It is clear that ℏ=-1 is in the convergent region which is parallel to the x-axis. Figure 2 shows the MSHAM solutions in comparison with the RK4 and HAM solutions for the time span t∈[0,30] using 16 Digits in Maple software. This 4th-term HAM solution is not accurate enough when compared with the RK4 solution but the 4th-term MSHAM solution works very well. The results obtained in [2–5] are effective for t≤1 but the result in MSHAM is effective for t∈[0,30], that means the MSHAM is more effective than the methods in [2–5]. Moreover, the absolute errors between the new algorithm and RK4 using the same benchmark for Cases 2 and 5 are presented in Tables 1 and 2, respectively. These show high accuracy of the new method since the absolute error is up to 10-11 in Case 2 and 10-7 in Case 5, which is not possible to get if the linear operator is ∂ϕ(t;q)/∂t.Table 1
The absolute error from the MSHAM0.001 and RK40.001 for Case 2 of the prey-predator problem.
tΔxΔy25.7e–198.706789680e–1142e–201.178335759e–1161e–201.59470390e–1281e–202.1581968e–13102e–202.920801e–14122e–203.95288e–15143e–205.3496e–16163e–207.240e–17184e–209.80e–18205e–201.33e–18Table 2
The absolute error from the MSHAM0.001 and RK40.001 for Case 5 of the prey-predator problem.
tΔxΔy29.485175571e–117.47597295716e–0942.11031149193e–091.01672103021e–0961.342878008923e–081.62013088126e–0983.622447658889e–088.01736945777e–09102.30556152717e–097.48322990044e–09129.45333229572e–092.8908159395e–10144.095583288261e–081.069711065660e–08162.775596164304e–086.870599099914e–08185.92867898748e–091.486248603235e–08202.889428569743e–088.8012357714e–10228.411291006490e–085.211185305325e–08241.577852557681e–081.4199589913952e–07261.343266168038e–082.232418357863e–08287.258205361348e–082.93592979865e–09306.16977299703e–092.3582971107456e–07Theℏ-curves for 5th-order of approximations. (a) and (b) The curves of x for Cases 1 and 5. (c) and (d) The curves of y for Cases 1 and 5.
(a)(b)(c)(d)Comparisons between the populations of rabbitsx and foxes y at time t for (a) Case 1, (b) Case 2, (c) Case 3, (d) Case 4, and (e) Case 5, using the 4th-term classical HAM, 4th-term MSHAM (Δt=0.01), and RK4 (Δt=0.001).
(a)(b)(c)(d)(e)


## 5. Conclusions

In this paper, a prey-predator problem was simulated accurately by MSHAM. MSHAM has the advantages of giving an analytical form of the solution within each time interval which is not possible in purely numerical techniques like RK4, which provides solution only at the two ends of a given time interval, and provided that the interval is chosen small enough for convergence. The method also gives the freedom to choose the auxiliary linear operator and the auxiliary parameterℏ. The present technique offers an explicit time marching algorithm that works accurately over such a bigger time span. The results presented in this paper suggest that MSHAM is also readily applicable to more complex cases of nonlinear ordinary differential equations.



---

*Source: 710250-2010-02-22.xml*