A continuous Trigonometrically-fitted Second Derivative Method (CTSDM) whose coefficients depend on the frequency and stepsize is constructed using trigonometric basis functions. A discrete Trigonometrically-fitted second derivative method (TSDM) is recovered from the CTSDM as a by-product and applied to solve initial value problems (IVPs) with oscillating solutions. We discuss the stability properties of the TSDM and present numerical experiments to demonstrate the efficiency of the method.

AMS Subject Classification

65L05; 65L06

Introduction

In this paper, we consider the subclass of first order differential equation

with periodic or oscillating solutions where f:ℜ×ℜ^{m}→ℜ^{m}, y,y_{0}∈ℜ^{m}. Oscillatory IVPs frequently arise in areas such as classical mechanics, celestial mechanics, quantum mechanics, and biological sciences. Several numerical methods based on the use of polynomial basis functions have been developed for solving this class of important problems (see Lambert 1991, 1973, Hairer et al. in (Hairer and Wanner 1996), Hairer 1982, and Sommeijer 1993). Other methods based on exponential fitting techniques which take advantage of the special properties of the solution that may be known in advance have been proposed (see Simos 1998, Vanden Berghe et al. 2001a, Vanden Berghe et al. 2009, Vigo-Aguiar et al. 2003, Franco 2002, Fang et al. 2009, Nguyen et al. 2007, Ozawa 2005, Jator et al. 2012, and Ngwane et al. 2012b). In the spirit of 2005, the motivation governing the exponentially-fitted methods is inherent to the fact that if the frequency or a reasonable estimate of it is known in advance, these methods will be more advantageous than the polynomial based methods.

The aim of this paper is to construct a TSDM. This construction is done by initially developing a CTSDM which then provides a discrete method that is applied as a TSDM which takes the frequency of the solution as a priori knowledge. In particular, CTSDM consists of a sum of continuous functions while TSDM is a by-product of CTSDM. The coefficients of the TSDM are functions of the frequency and the stepsize, hence the solutions provided by the proposed method are highly accurate if (1) has periodic solutions with known frequencies. We adopt the approach given in Jator et al. in (Ngwane and Jator 2012a; Jator et al. 2012), where the TSDM is used to obtain the approximation y_{n+1} to the exact solution y(x_{n+1}) on the interval [ x_{
n
},x_{n+1}], h=x_{n+1}−x_{
n
}, n=0,…,N−1, on a partition [ a,b], where a,b\in \mathbb{R}, h is the constant stepsize, n is a grid index and N>0 is the number of steps. We note that second derivative methods with polynomial basis functions were proposed to overcome the Dahlquist 1956 barrier theorem whereby the conventional linear multistep method was modified by incorporating the second derivative term in the derivation process in order to increase the order of the method, while preserving good stability properties (see Enright 1974).

This paper is organized as follows. In Section “’’, we obtain a trigonometric basis representation U(x) for the exact solution y(x) which is used to generate a TSDM for solving (1). The analysis and implementation of the TSDM are discussed in Section “Error analysis and stability” to show the accuracy and efficiency of the TSDM. Finally, we give some concluding remarks in Section “Conclusion”.

Development of method

In this section, our objective is to construct a CTSDM which produces a discrete method as a by-product. The method has the form

where u=wh, β_{
j
}(u), γ_{
j
}(u), j=0,1, are coefficients that depend on the stepsize and frequency. We note that y_{n+j} is the numerical approximation to the analytical solution y(x_{n+j}), and

with j=0,1. In order to obtain equation (2) we proceed by seeking to approximate the exact solution y(x) on the interval [ x_{
n
},x_{
n
}+h] by the interpolating function U(x) of the form

where a_{0},a_{1},a_{2},a_{3} and a_{4} are coefficients that must be uniquely determined. We then impose that the interpolating function in (3) coincides with the analytical solution at the point x_{
n
} to obtain the equation

U\left({x}_{n}\right)={y}_{n}.

(4)

We also demand that the function (3) satisfies the differential equation (1) at the points x_{n+j}, j=0,1 to obtain the following set of three equations:

Equations (4) and (5) lead to a system of five equations which is solved by Cramer’s rule to obtain a_{
j
}, j=0,1,2,3,4. Our continuous CTSDM is constructed by substituting the values of a_{
j
} into equation (3). After some algebraic manipulation, the CTSDM is expressed in the form

where w is the frequency, β_{0}(w,x), β_{1}(w,x), γ_{0}(w,x), and γ_{1}(w,x), are continuous coefficients. The continuous method (6) is used to generate the method of the form (2). Thus, evaluating (6) at x=x_{n+1} and letting u=wh, we obtain the coefficients of (2) as follows:

We note that when u→0 the coefficients given by (7) are vulnerable to heavy cancellations and hence the following Taylor series expansion must be used (see Simos 1998).

The method (2) specified by (8) is a fourth-order method and reduces to a one-step conventional second derivative method as u→0 (see Lambert 1973, p. 201).

Stability

Proposition1

The TSDM (2) applied to the test equations y^{′}=λy and y^{′′}=λ^{2}y yields

We begin by applying (2) to the test equations y^{′}=λy and y^{′′}=λ^{2}y which are expressed as f(x,y)=λy and g(x,y)=λ^{2}y respectively; letting q=hλ and u=wh, we obtain a linear equation which is used to solve for y_{n+1} with (11) as a consequence.

Remark2

The rational function M(q;u) is called the stability function which determines the stability of the method.

Definition1

A region of stability is a region in the q−u plane, in which |M(q;u)|≤1.

The method (12) is zero-stable provided the roots of the first characteristic polynomial have modulus less than or equal to unity and those of modulus unity are simple (see Lambert 1991).

Definition3

The method (12) is consistent if it has order p>1 (see (Fatunla 1991)).

Remark3

The TSDM (12) is consistent as it has order p>1 and zero-stable, hence it is convergent since zero-stability + consistency = convergence.

In the q−u plane the TSDM (12) is stable for q≤0, and u∈[ −2π,2π], since from above |M(q;u)|≤1, q≤0.

Remark5

Figure 1 is a plot of the stability region and Figure 2 shows the zeros and poles of M(q;u). We note from Figure 2 that the stability region includes the entire left side of the complex plane.

Definition4

The TSDM with the stability function (11) is said to be A-stable at u=u_{0}, −2π≤u_{0}≤2π, if |M(q;u)|≤1, \forall q\in {\mathbb{C}}^{-}, (see Nguyen et al. 2007).

Remark6

We observe from definition 1, remarks 4, 5, and Figure 2, that TSDM is A-stable. In particular, |M(q;iy)|=1\forall y\in \mathbb{R}, and by the maximum principle, the method will be A-stable if |M(q;u)| has no poles in the left plane (see E. Hairer et al. 1996, p.43, 53). Moreover, the real part of the zeros of |M(q;u)| must be negative, while the real part of the poles of |M(q;u)| must be positive.

Implementation

In the spirit of Ngwane et al. in (Ngwane and Jator 2012a; 2012b), the TSDM (12) is implemented to solve (1) without requiring starting values and predictors. For instance, if we let n=0 in (12), then y_{1} is obtained on the sub-interval [ x_{0},x_{1}], as y_{0} is known from the IVP. Similarly, if n=1, then y_{2} is obtained on the sub-interval [ x_{1},x_{2}], as y_{1} is known from the previous computation, and so on; until we reach the final sub-interval [ x_{N−1},x_{
N
}]. We note that for linear problems, we solve (1) directly using the feature solve[ ] in Matlab, while nonlinear problems use the Newton’s method in Matlab enhanced by the feature fsolve[ ].

Numerical examples

In this section, we give numerical examples to illustrate the accuracy (small errors) and efficiency (fewer number of function evaluations (NFEs)) of the TSDM. We find the approximate solution on the partition π_{
N
}, where π_{
N
}:a=x_{0}<x_{1}<x_{2}<...<x_{
n
}<x_{n+1}<…<x_{
N
}=b, and we give the errors at the endpoints calculated as Error= y_{
N
}−y(x_{
N
}). We note that the method requires only two function evaluations per step and in general requires (2N+2) NFEs on the entire interval. All computations were carried out using a written code in Matlab.

Example 1

Consider the given two-body problem which was solved by Ozawa 2005.

where k is the solution of the Kepler’s equation k=x+e sin(k). We choose ω=1.

Table 1 contains the results obtained using the TSDM. These results are compared with the explicit singly diagonally implicit Runge-Kutta (ESDIRK) and the functionally fitted ESDIRK (FESDIRK) methods given in Ozawa 2005. In terms of accuracy, Table 1 clearly shows that TSDM performs better than those in Ozawa 2005.

Example 2

We consider the nonlinear Duffing equation which was also solved Ixaru et al. 2004.

where Ω=1.01, B=0.002, C_{0}=0.200426728069, C_{1}=0.200179477536, C_{2}=0.246946143×10^{−3}, C_{3}=0.304016×10^{−6}, C_{4}=0.374×10^{−9}. We choose ω=1.01 and for more on frequency choice see Ramos et al. 2010.

We compare the end-point global errors for TSDM with the fourth order methods in Ixaru et al. 2004. We see from Table 2 that the results produced by TSDM are better than Simos’ method used in (Ixaru and Berghe 2004), as TSDM produces better error magnitude while using less number of steps and fewer number of function evaluations. TSDM is very competitive to the method used by Ixaru et al. 2004.

Example 3

We consider the following inhomogeneous IVP by Simos 1998.

The exponentially-fitted method in Simos 1998 is fourth order and hence comparable to our method, TSDM. We see from Table 3 that TSDM is more efficient than the method in Simos 1998. We also compare the computational efficiency of the two methods by considering the NFEs over N integration steps for each method. Our method, TSDM, requires only 2N+2 function evaluations in N steps compared to 4N function evaluations in N steps for the method in Simos 1998. Hence for this example, TSDM performs better.

Example 4

Linear Kramarz problem We consider the following second-order IVP, (see Nguyen et al.2007[p. 204])

We use this example to show the efficiency of TSDM on linear systems. Nguyen et al.2007 used the “trigonometric implicit Runge-Kutta”, TIRK3, method to solve the above linear Kramarz problem. Clearly, TSDM performs better as seen in Table 4.

This problem demonstrates the performance of TSDM on a well-known oscillatory problem. We compare the results from TSDM with the Dissipative Chebyshev exponential-fitted methods, CHEBY24 and CHEBY1 used in Vigo-Aguiar et al.2003. We see that TSDM uses fewer number of function evaluations with better accuracy than CHEBY24 that is designed to use fewer number of steps. Integrating in the interval [ 0,1] with a stepsize equal to the total length of the interval, we obtain an error of order 10^{−21}. Hence TSDM is a more efficient integrator. We note that compared with the methods CHEBY24 and CHEBY1 which use stepsizes considerably larger than those used in multistep methods, TSDM is very competitive and superior to both CHEBY24 and CHEBY1.

Example 6

A nearly sinusoidal problem

We consider the following IVP on the range 0≤t≤10, (see Nguyen et al.2007, p. 205)

We choose β=−3 and β=−1000 in order to illustrate the phenomenon of stiffness. Given the initial conditions y_{1}(0)=2 and y_{2}(0)=3, the exact solution is β-independent and is given by

This example is chosen to demonstrate the performance of TSDM on stiff problems. We compute the solutions to Example (6) with β=−3, −1000. We obtain better absolute errors than Nguyen et al. (2007). This efficiency is achieved using fewer number of steps and less number of function evaluations than Nguyen et al. (2007). For example when β=−3, our method generates a solution with error magnitude 10^{−6} involving just 6 steps and 28 function evaluations, whereas (Nguyen et al. 2007) attains the same error magnitude using 10 steps and 47 function evaluations. When β=−1000, TSDM generates solutions with comparable error magnitude. We see that TSDM is competitive and better than the method in Nguyen et al. (2007) which is of order six and is thus expected to do better.

An implementation in predictor-corrector mode

In this section, we also implement our CTSDM in a predictor-corrector mode. The predictor is given by

As we expected, the predictor-corrector (PreCor) mode runs faster than the TSDM but is less accurate compared to the TSDM. We illustrate this by applying the predictor-corrector to Example 2 and Example 3. We plot the efficiency curves showing the accuracy versus the CPU computation time, and the accuracy versus the NFEs.

Estimating the frequency

A preliminary testing indicates that a good estimate of the frequency can be obtained by demanding that LTE=0, and solving for the frequency. That is, solve for ω given that \left(-\frac{{h}^{5}}{720}\left({w}^{2}{y}^{\left(3\right)}\left({x}_{n}\right)+{y}^{\left(5\right)}\left({x}_{n}\right)\right)\right)=0, where y^{(j)},j=2,…,5 denote derivatives. We used this procedure to calculate ω for the problem given in example (5) and obtained ω≈± 314.16, which approximately gives the known frequency ω=314.16. Hence, this procedure is interesting and will be seriously considered in our future research.

We note that estimating the frequency and the choice of the frequency in trigonometrically-fitted methods is challenging and has grown in interest. Existing references on how to estimate the frequency and on the choice of the frequency include G. Vanden Berghe et al.2001b, and Ramos et al.2010.

Conclusion

We have proposed a TSDM for solving oscillatory IVPs. The TSDM is A-stable and hence, an excellent candidate for solving stiff IVPs. This method has the advantages of being self-starting, having good accuracy with order 4, and requiring only two functions evaluation at each integration step. We have presented representative numerical examples that are linear, non-linear, stiff and highly oscillatory. These examples show that the TSDM is more accurate and efficient than those in Nguyen et al.2007, Simos1998, Ixaru et al.2004, and Ozawa2005. Details of the numerical results are displayed in Tables 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10 and the efficiency curves are presented in Figures 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12. Our future research will incorporate a technique for accurately estimating the frequency as suggested in subsection “Estimating the frequency” as well as implementing the method in a variable step mode.

References

Calvo M, Franco J, Montijano J, Randez L: Sixth-order symmetric and symplectic exponentially fitted Runge-Kutta methods of the Gauss type. J Comput Appl Math 2009, 223: 387-398. 10.1016/j.cam.2008.01.026

Fang Y, Song Y, Wu X: A robust trigonometrically fitted embedded pair for perturbed oscillators. J Comput Appl Math 2009, 225: 347-355. 10.1016/j.cam.2008.07.053

Franco J: Runge-Kutta-Nyström methods adapted to the numerical intergration of perturbed oscillators. Comput Phys Comm 2002, 147: 770-787. 10.1016/S0010-4655(02)00460-5

Jator S, Swindle S, French R: Trigonometrically fitted block Numerov type method for y^{′′}= f ( x , y , y^{′}). Numerical Algorithms 2012. doi:10.1007/s11075-012-9562-1

Simos T: An exponentially-fitted Runge-Kutta method for the numerical integration of initial-value problems with periodic or oscillating solutions. Comput Phys Commun 1998, 115: 1-8. 10.1016/S0010-4655(98)00088-5

Vanden Berghe G, Ixaru L, De Meyer H: Frequency determination and step-length control for exponentially-fitted RungeŰKutta methods. J Comput Appl Math 2001b, 132: 95-105. 10.1016/S0377-0427(00)00602-6

Vanden Berghe G, Van Daele M: Exponentially-fitted Obrechkoff methods for second-order differential equations. Appl Numer Math 2009, 59: 815-829. 10.1016/j.apnum.2008.03.018

The authors declare that they have no competing interests.

Authors’ contributions

SJ proposed the algorithm. FN and SJ developed, analyzed and implemented the method. FN and SJ drafted the manuscripts. All authors read and approved the final manuscript.

Authors’ original submitted files for images

Below are the links to the authors’ original submitted files for images.

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0), which permits use, duplication, adaptation, distribution, and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.