Abstract

We derive a variable step of the implicit block methods based on the backward differentiation formulae (BDF) for solving stiff initial value problems (IVPs). A simplified strategy in controlling the step size is proposed with the aim of optimizing the performance in terms of precision and computation time. The numerical results obtained support the enhancement of the method proposed as compared to MATLAB's suite of ordinary differential equations (ODEs) solvers, namely, ode15s and ode23s.

1. Introduction

Consider the first-order ordinary differential equations in the form of π‘¦ξ…ž=𝑓(π‘₯,𝑦)(1.1) with given initial values 𝑦(π‘Ž)=𝑦0 in the given interval π‘₯∈[π‘Ž,𝑏]. The system of (1.1) is said to be stiff if the eigenvalues of the matrix πœ•π‘“(π‘₯,𝑦)/πœ•π‘¦ have negative real parts at every time π‘₯ and varies greatly in magnitude. Solving stiff ODEs which aroused from mainly applied problems, for example, from physical, chemical, and biological phenomena is made easy with several methods of interest appeared in subroutine libraries [1]. Some examples can be seen in [2–4]. From the code pioneered by Gear called DIFSUB, the wide interest in stiff ODEs has caused many other codes evolved to meet the same objective of finding the most accurate approximation for IVPs [5]. Some renowned codes are EPISODE and LSODE [5]. With the advancements of the existing methods of solving ODEs, many of these codes are preinstalled in MATLAB to work as numerical solvers. An overview of MATLAB’s numerical solvers presented in [2] shows a wide choice of solvers according to the problem type, step, and order to deal with stiff and nonstiff problems. Since then, several measures have been brought up by many researchers to evaluate which method turns out to be the most efficient method [6]. Despite that there exist some limitations in each method, these methods proven to have their own strength in solving certain initial value problems [1].

The need to solve large systems of stiff IVPs has also influenced the development of other existing method. These include iterative linear equation solvers and sparse direct linear equation solvers. Further discussion and additional references on this method are discussed in more detail in [2]. The method that incorporated with BDF proposed by Gear has been expanded gradually to become an improved method [7]. The study on producing block approximations 𝑦𝑛+1,𝑦𝑛+2,𝑦𝑛+3,…,𝑦𝑛+π‘˜ also known as block backward differentiation formulae (BBDF) [7] was inspired by Gear’s method. BBDF method in [7] has verified the competency of computing concurrent solution values at different points. Apart from that, block approximations have been used in different methods to improve the methods to give a better accuracy and computation time. Consequently, the study by Ibrahim et al. in [8] is extended in a way that the accuracy is improved with reduction of total steps and lesser computational time.

In the next section, we discuss the derivation of the 5th-order variable step block backward differentiation formulae (5oBBDF). The strategies and implementations are presented next, followed by the results and discussion. It is also one of the main aims of this paper to prove that the method proposed acts as an alternative way in solving IVPs which arise in engineering and applied sciences. We are interested to compare the numerical results obtained with stiff ODEs solvers provided by MATLAB, namely, ode15s and ode23s.

2. General 5oBBDF Formulation

The ratio distance between current (π‘₯𝑛) and previous step (π‘₯π‘›βˆ’1) is represented as π‘ž in Figure 1. In this paper, the step size is given selection to decrease to half of the previous steps or increase up to a factor of 1.9. For simplicity, π‘ž is assigned as 1,2 and 10/19 for the case of constant, halving, and increasing the step size, respectively. The zero stability is achieved for each of these cases and explained in the next section.

We find approximating polynomials π‘ƒπ‘˜(π‘₯) by means of a π‘˜-degree polynomial interpolating the values of 𝑦 at given points are (π‘₯π‘›βˆ’2,π‘¦π‘›βˆ’2),(π‘₯π‘›βˆ’1,π‘¦π‘›βˆ’1),…,(π‘₯𝑛+2,𝑦𝑛+2), π‘ƒπ‘˜=π‘˜ξ“π‘—=0𝑦π‘₯𝑛+1βˆ’π‘—ξ€Έβ‹…πΏπ‘˜,𝑗(π‘₯),(2.1) where πΏπ‘˜,𝑗(π‘₯)=π‘˜ξ‘π‘–=0𝑖≠𝑗π‘₯βˆ’π‘₯𝑛+1βˆ’π‘–ξ€Έξ€·π‘₯𝑛+1βˆ’π‘—βˆ’π‘₯𝑛+1βˆ’π‘–ξ€Έforeach𝑗=0,1,…,π‘˜.(2.2) Define 𝑠=(π‘₯βˆ’π‘₯𝑛+1)/β„Ž to find the 4th-order interpolating polynomial for (2.1), 𝑃π‘₯(π‘₯)=𝑃𝑛+1ξ€Έ=+π‘ β„Ž(2π‘ž+1+𝑠)(π‘ž+1+𝑠)(1+𝑠)(𝑠)𝑦4(π‘ž+1)(π‘ž+2)𝑛+2+(2π‘ž+1+𝑠)(π‘ž+1+𝑠)(1+𝑠)(π‘ βˆ’1)π‘¦βˆ’(π‘ž+1)(2π‘ž+1)𝑛+1+(2π‘ž+1+𝑠)(π‘ž+1+𝑠)(𝑠)(π‘ βˆ’1)4π‘ž2𝑦𝑛+(2π‘ž+1+𝑠)(1+𝑠)(𝑠)(π‘ βˆ’1)βˆ’π‘ž2𝑦(π‘ž+1)(π‘ž+2)π‘›βˆ’1+(π‘ž+1+𝑠)(1+𝑠)(𝑠)(π‘ βˆ’1)4π‘ž2𝑦(2π‘ž+1)(π‘ž+1)π‘›βˆ’2(2.3)𝑠 is equated to 0 and 1 after the polynomial is differentiated with respect to 𝑠, when π‘₯=π‘₯𝑛+1andπ‘₯=π‘₯𝑛+2, respectively, β„Žπ‘“π‘›+1=1+2π‘ž2+3π‘žπ‘¦4(π‘ž+1)(π‘ž+2)𝑛+2+2+3π‘žπ‘¦(π‘ž+1)(2π‘ž+1)𝑛+1+βˆ’1βˆ’2π‘ž2βˆ’3π‘ž4π‘ž2𝑦𝑛+1+2π‘žπ‘ž2𝑦(π‘ž+1)(π‘ž+2)π‘›βˆ’1+βˆ’1βˆ’π‘ž4π‘ž2𝑦(2π‘ž+1)(π‘ž+1)π‘›βˆ’2,β„Žπ‘“π‘›+2=10+3π‘ž2+12π‘žπ‘¦2(π‘ž+1)(π‘ž+2)𝑛+2+βˆ’4π‘ž2βˆ’12π‘žβˆ’8𝑦(π‘ž+1)(2π‘ž+1)𝑛+1+2+π‘ž2+3π‘ž2π‘ž2𝑦𝑛+βˆ’4π‘žβˆ’4π‘ž2𝑦(π‘ž+1)(π‘ž+2)π‘›βˆ’1+π‘ž+22π‘ž2𝑦(2π‘ž+1)(π‘ž+1)π‘›βˆ’2.(2.4) Upon substituting π‘ž=1,2 and 10/19 into π‘ƒξ…ž(π‘₯𝑛+1) and π‘ƒξ…ž(π‘₯𝑛+2), we obtained the coefficients for points 𝑦𝑛+1 and 𝑦𝑛+2 as follows: 𝑦forπ‘ž=1,𝑛+1=65β„Žπ‘“π‘›+1βˆ’3𝑦10𝑛+2+95π‘¦π‘›βˆ’35π‘¦π‘›βˆ’1+1𝑦10π‘›βˆ’2,𝑦𝑛+2=1225β„Žπ‘“π‘›+1+48𝑦25𝑛+2βˆ’36𝑦25𝑛+16𝑦25π‘›βˆ’1βˆ’3𝑦25π‘›βˆ’2,𝑦forπ‘ž=2,𝑛+1=158β„Žπ‘“π‘›+1βˆ’75𝑦128𝑛+2+225𝑦128π‘›βˆ’25𝑦128π‘›βˆ’1+3𝑦128π‘›βˆ’2,𝑦𝑛+2=1223β„Žπ‘“π‘›+2+192𝑦115𝑛+1βˆ’18𝑦23𝑛+3𝑦23π‘›βˆ’1βˆ’2𝑦115π‘›βˆ’2,𝑦forπ‘ž=10/19,𝑛+1=11311292β„Žπ‘“π‘›+1βˆ’14703𝑦82688𝑛+2+1279161𝑦516800π‘›βˆ’183027𝑦108800π‘›βˆ’1+10469𝑦27200π‘›βˆ’2,𝑦𝑛+2=13923095β„Žπ‘“π‘›+2+89088𝑦40235𝑛+1βˆ’242208𝑦77375𝑛+198911𝑦77375π‘›βˆ’1βˆ’658464𝑦1005875π‘›βˆ’2.(2.5)

3. Implementation of 5oBBDF Method

It is commonly known that stiff ODEs codes must solve both nonlinear and linear systems at each step of differentiation. This is due to implicity of the formulae for solving stiff IVPs. Throughout this section, we illustrate the effect of Newton-type scheme to find the approximation solutions of 𝑦𝑛+1 and 𝑦𝑛+2 simultaneously in every step. The general forms of the 5th-order BBDF method are 𝑦𝑛+1=𝛼1β„Žπ‘“π‘›+1+πœƒ1𝑦𝑛+2+πœ“1,𝑦𝑛+2=𝛼1β„Žπ‘“π‘›+2+πœƒ1𝑦𝑛+1+πœ“2(3.1) with πœ“1 and πœ“2 are the back values. Equation (3.1) in matrix-vector form is equivalent to (πΌβˆ’π΄)π‘Œπ‘›+1,𝑛+2=β„Žπ΅πΉπ‘›+1,𝑛+2+πœ‰π‘›+1,𝑛+2.(3.2) By setting 𝐼=1001ξ€», π‘Œπ‘›+1,𝑛+2=𝑦𝑛+1𝑦𝑛+2ξ€», 𝐴=0πœƒ1πœƒ20ξ‚„, 𝐡=𝛼100𝛼2ξ‚„, 𝐹𝑛+1,𝑛+2=𝑓𝑛+1𝑓𝑛+2ξ‚„, and πœ‰π‘›+1,𝑛+2=ξ€Ίπœ“1πœ“2ξ€», (3.1) is simplified as 𝑓𝑛+1,𝑛+2=(πΌβˆ’π΄)π‘Œπ‘›+1,𝑛+2βˆ’β„Žπ΅πΉπ‘›+1,𝑛+2βˆ’πœ‰π‘›+1,𝑛+2=0.(3.3) Newton iteration is performed to the system 𝑓𝑛+1,𝑛+2=0, by taking the analogous form π‘Œ(𝑖+1)𝑛+1,𝑛+2βˆ’π‘Œ(𝑖)𝑛+1,𝑛+2=βˆ’(πΌβˆ’π΄)βˆ’β„Žπ΅πœ•πΉξ‚€π‘Œπœ•π‘Œ(𝑖)𝑛+1,𝑛+2ξ‚ξ‚„βˆ’1(πΌβˆ’π΄)π‘Œ(𝑖)𝑛+1,𝑛+2ξ‚€π‘Œβˆ’β„Žπ΅πΉ(𝑖)𝑛+1,𝑛+2ξ‚βˆ’πœ‰π‘›+1,𝑛+2,(3.4) where 𝐽𝑛+1,𝑛+2=(πœ•πΉ/πœ•π‘Œ)(π‘Œ(𝑖)𝑛+1,𝑛+2) is the Jacobian matrix of 𝐹 with respect to π‘Œ. Equation (3.4) is separated to three different matrices denoted as 𝐸(𝑖+1)1,2=π‘Œ(𝑖+1)𝑛+1,𝑛+2βˆ’π‘Œ(𝑖)𝑛+1,𝑛+2,(3.5)𝐴=(πΌβˆ’π΄)βˆ’β„Žπ΅πœ•πΉξ‚€π‘Œπœ•π‘Œ(𝑖)𝑛+1,𝑛+2,(3.6)𝐡=(πΌβˆ’π΄)π‘Œ(𝑖)𝑛+1,𝑛+2ξ‚€π‘Œβˆ’β„Žπ΅πΉ(𝑖)𝑛+1,𝑛+2ξ‚βˆ’πœ‰π‘›+1,𝑛+2.(3.7)

Two-stage Newton iteration is now introduced in order to find the approximate solution to (1.1). Thus, the corresponding linear system to be solved is 𝐴𝐸(𝑖+1)1,2=𝐡. According to Jackson in [9], evaluating the Jacobian 𝐽𝑛+1,𝑛+2 and LU factorization of 𝐴 require the most computation time during the operations. As a result, two strategies which are based on the step size are applied to ensure the efficiency of the method:(i)no calculation of new matrices 𝐴 and 𝐡 if the step size β„Ž remains as previous step size. Hence, there is no new calculation of the Jacobian matrix 𝐽𝑛+1,𝑛+2,(ii)the matrices 𝐴 and 𝐡 are updated with new evaluation of the Jacobian matrix 𝐽𝑛+1,𝑛+2 for every occurrence of changing step size.

As a result, this paper agrees with [10] that this method has a higher tendency in saving computational time. Unlike most modern solvers that incorporated full Newton iterations, 5oBBDF method offers refined strategy for reevaluating the Jacobian matrix 𝐽𝑛+1,𝑛+2.

3.1. Stability Conditions for 5oBBDF

In this section, we provide the conditions for the stability of 5oBBDF method as in (2.5). To begin with, we include some definitions to support the practical criterion for a method to be useful in solving ODEs.

Definition 3.1. A method is said to be zero stable if the roots of the polynomial 𝜌(𝑧)=πœ‹(𝑧,0) satisfy the condition 𝑧1=1≀|𝑧2|,𝑧2β‰ 1.

Definition 3.2. A method is said to be absolute stable in a region 𝑅 for a given β„Žπœ† if for that β„Žπœ†, all the roots π‘Ÿπ‘  of the stability polynomial πœ‹(π‘Ÿ,β„Žπœ†)=𝜌(π‘Ÿ)βˆ’β„Žπœ†πœŽ(π‘Ÿ)=0 satisfy |π‘Ÿπ‘ |<1, 𝑠=1,2,…,π‘˜.

The stability polynomial, 𝑅(𝑑,β„Ž), associated with the method of (2.5) is given by det(𝐴𝑑2βˆ’π΅π‘‘βˆ’πΆ), while the absolute stability region of this method in the β„Žπœ† plane is determined by solving det(𝐴𝑑2βˆ’π΅π‘‘βˆ’πΆ=0). Below are the absolute stability regions in the method of (2.5) for different step size selections: (π‘ž=1)(π‘ž=2) and (π‘ž=10/19), respectively, π‘…ξ‚€ξβ„Žξ‚=𝑑,197𝑑1254βˆ’42𝑑254β„Žβˆ’153𝑑1253βˆ’9𝑑252+72𝑑1254β„Ž2βˆ’252𝑑1253β„Žβˆ’18𝑑12521β„Ž+π‘…ξ‚€ξβ„Žξ‚=125𝑑=0,𝑑,91𝑑464βˆ’441𝑑1844β„Žβˆ’173𝑑923βˆ’289𝑑29442+45𝑑464β„Ž2βˆ’1155𝑑73633β„Žβˆ’π‘‘9221β„Ž+π‘…ξ‚€ξβ„Žξ‚=2944𝑑=0,𝑑,1393273𝑑9996854βˆ’5298909𝑑39987404β„Žβˆ’42149421𝑑1999370003βˆ’544951521𝑑4209200002+393588𝑑9996854β„Ž2βˆ’1398292623𝑑3998740003β„Žβˆ’753768𝑑13153752β„Ž+47045881420920000𝑑=0.(3.8) To determine for zero stable, we substitute ξβ„Ž=β„Žπœ†=0 to (3.8). We will have the following equations for each step size selection mentioned previously: 197𝑑1254βˆ’153𝑑1253βˆ’9𝑑252+1125𝑑=0,91𝑑464βˆ’173𝑑923βˆ’289𝑑29442+12944𝑑=0,1393273𝑑9996854βˆ’42149421𝑑1999370003βˆ’544951521𝑑4209200002+47045881420920000𝑑=0.(3.9) Hence, the roots for three different step size selections obtained by using Maple are listed below(1)𝑑=βˆ’.24414201370,𝑑=0.02079175991, and 𝑑=1,(2)𝑑=βˆ’0.052708171410,𝑑=0.003257621961, and 𝑑=1,(3)𝑑=βˆ’0.93455113330,𝑑=0.08581158625, and 𝑑=1.

Since all of the roots have modulus less than or equal to 1, the method (2.5) when (π‘ž=1)(π‘ž=2) and (π‘ž=10/19) is zero stable.

The stability region was given by the set of points determined by the boundary 𝑑=π‘’π‘–πœƒ,0β‰€πœƒβ‰€2πœ‹. The stability region is obtained by finding the region for which |𝑑|<1. Figure 2 shows the stability for the cases (π‘ž=1)(π‘ž=2) and (π‘ž=10/19), respectively. The stability regions lie outside the closed region for each case.

Based on Figure 2, the 5th-order BBDF possesses the region absolute stability, which contains almost whole of the half-plane Re(β„Žπœ†)<0.

3.2. Choosing Step Size

The importance in choosing the step size is to achieve reduction in computation time and number of iterations. Therefore, this paper proposed three basic strategies for the step size selections. For each successful step, the step size remains constant (π‘ž=1) or increased by a factor of 1.9 (π‘ž=10/19). Inversely, when a fail step occurs, the next step size will be halved of the previous step size (π‘ž=2). The user initially will have to provide an error tolerance limit, TOL on any given step, and obtain the local truncation error (LTE) for each iteration. The LTE is obtained from LTE=𝑦(π‘˜+1)𝑛+2βˆ’π‘¦(π‘˜)𝑛+2,π‘˜=4,(3.10) where 𝑦(π‘˜+1)𝑛+2 is the (π‘˜+1)th order method, and 𝑦(π‘˜)𝑛+2 is the π‘˜th order method.

The successful step is dependent on the condition LTE<TOL. If this condition fails, the values of 𝑦𝑛+1, 𝑦𝑛+2 are rejected, and the current step is reiterated with step size selection (π‘ž=2). On the contrary, the step size increment for each successful step is defined as β„Žnew=π‘Γ—β„ŽoldΓ—ξ‚€TOLLTE1/𝑝.(3.11)

And if β„Žnew>1.9Γ—β„Žold, then β„Žnew=1.9Γ—β„Žold. Where 𝑐 is the safety factor, 𝑝 is the order of the method, while β„Žold and β„Žnew are the step size from previous and current blocks, respectively. In this paper,𝑐 is set to be 0.8.

4. MATLAB’s Stiff Numerical Solvers

MATLAB offers several numerical solvers to solve either stiff or nonstiff ordinary differential equations. These built-in numerical solvers are capable in approximating solutions to almost any system of differential equations [2]. As far as this paper is concerned, we are interested in solving stiff ODEs. For comparison purposes, this paper considers only ode15s and ode23s. This is because both of the methods deal with stiff differential equations based on backward differentiation formulas (BDFs) and on a modified Rosenbrock formula of order 2, respectively. Therefore, a fair comparison is obtained, and the discussions are made easy.

5. Numerical Results

We carry out numerical experiments to compare the performance of the 5th-order BBDF method with stiff ODE solvers in MATLAB mentioned above. Three sets of stiff test problems aroused from problems in physics are tested for the purpose of elucidating the difference in numerical results obtained. These test problems are performed under different conditions of error tolerancesβ€”(a) 10βˆ’2, (b) 10βˆ’4, and (c) 10βˆ’6, and the error trend is defined by ||𝑦Error=approximateβˆ’π‘¦actual||.(5.1) The test problems and solution are listed below (1)basic circuit problem is π‘¦ξ…ž=βˆ’20𝑦+24,𝑦(0)=0,0≀π‘₯≀10,(5.2) with solution 𝑦(π‘₯)=6/5βˆ’(6/5)π‘’βˆ’20π‘₯,(2) oscillatory problems in physics: Torsion spring oscillator with dry and viscous friction [7] π‘¦ξ…ž1=998𝑦1+1998𝑦2,𝑦1𝑦(0)=1,0≀π‘₯≀10,ξ…ž2=βˆ’999𝑦1βˆ’1999𝑦2,𝑦2(0)=2,(5.3) with solution 𝑦1(π‘₯)=2π‘’βˆ’π‘₯βˆ’π‘’βˆ’1000π‘₯,𝑦2(π‘₯)=βˆ’π‘’βˆ’π‘₯+π‘’βˆ’1000π‘₯,(5.4) eigenvalues, πœ†=βˆ’1,βˆ’1000,(3)Physical problem [11] is π‘¦ξ…ž1=βˆ’20𝑦1βˆ’0.25𝑦2βˆ’19.75𝑦3,𝑦1𝑦(0)=1,0≀π‘₯≀10,ξ…ž2=20𝑦1βˆ’20.25𝑦2+0.25𝑦3,𝑦2𝑦(0)=0,ξ…ž3=20𝑦1βˆ’19.75𝑦2βˆ’0.25𝑦3,𝑦3(0)=βˆ’1,(5.5) with solution 𝑦1𝑒(π‘₯)=0.5βˆ’0.5π‘₯+π‘’βˆ’20π‘₯ξ€»,𝑦(cos20π‘₯+sin20π‘₯)2𝑒(π‘₯)=0.5βˆ’0.5π‘₯βˆ’π‘’βˆ’20π‘₯ξ€»,𝑦(cos20π‘₯βˆ’sin20π‘₯)3𝑒(π‘₯)=βˆ’0.5βˆ’0.5π‘₯+π‘’βˆ’20π‘₯ξ€»,(cos20π‘₯βˆ’sin20π‘₯)(5.6) eigenvalues, πœ†=βˆ’0.5,βˆ’20Β±20𝑖.

From Table 1, among the three methods tested, our method, 5oBBDF, requires the shortest execution time for each given tolerance level. On top of that, this method also gives the smallest maximum error and average error. From Figure 3, we can see that 5oBBDF gives the lowest maximum error for every tolerance level. When we look at the convergence of the methods compared in Figure 3, our method comparably converges faster with minimum number of steps taken.

From Table 2, once again, 5oBBDF requires the shortest execution time for each given tolerance level. From the error trends described in Figure 4, we can see that the maximum errors for 5oBBDF are the smallest for each TOL as compared to ode15s and ode23s. So the convergence of the method, 5oBBDF is found to converge fastest among the methods tested.

From Table 3, similarly, 5oBBDF gives the shortest execution time for each given tolerance level. This method is also completed with lesser total steps except when TOL is 10βˆ’2. The error trends for all of the methods tested are depicted in Figure 5. The error trend shows that 5oBBDF converged fastest with smallest maximum error for each TOL as compared to ode15s and ode23s.

6. Conclusion

For all problems tested, it is proven that, the 5th-order variable step BBDF has outperformed the ode15s and ode23s in terms of average errors as well as maximum errors. It also managed to reduce the number of total steps taken in most of the cases especially when TOL is less than 10βˆ’2. When we tested the convergence of the methods compared in this paper, the error trend worked as the identifier for the fastest error of the method approaches zero. Figures 3, 4, and 5 illustrate how fast the error of 5th-order variable step BBDF converged as compared to the other two methods used. As a result, we found that this method converges fastest for all problems tested. In terms of computation timewise, it gave lesser values for all of the test problems. Therefore, we can conclude that the 5th-order variable step BBDF is one compatible alternative solver for solving stiff ordinary differential equations which mostly arise in engineering and applied sciences.

Abbreviations

TS:The total number of steps taken
TOL:The initial value for the local error estimate
MAXE:The maximum error
AVEE:The average error
METHOD:The method used
TIME:The total execution time (seconds)
5oBBDF:5th-order variable step BBDF
𝑒:Error for each point of approximations.