A Trigonometrically Fitted Block Method for Solving Oscillatory Second-Order Initial Value Problems and Hamiltonian Systems

In this paper, we present a block hybrid trigonometrically fitted Runge-Kutta-Nyström method (BHTRKNM), whose coefficients are functions of the frequency and the step-size for directly solving general second-order initial value problems (IVPs), including Hamiltonian systems such as the energy conserving equations and systems arising from the semidiscretization of partial differential equations (PDEs). Four discrete hybrid formulas used to formulate the BHTRKNM are provided by a continuous one-step hybrid trigonometrically fitted method with an off-grid point. We implement BHTRKNM in a block-by-block fashion; in this way, the method does not suffer from the disadvantages of requiring starting values and predictors which are inherent in predictor-corrector methods. The stability property of the BHTRKNM is discussed and the performance of the method is demonstrated on some numerical examples to show accuracy and efficiency advantages.


Introduction
In what follows, we consider the numerical solution of the general second-order IVPs of the form where  : R × R 2 → R 2 ,  > 0 is an integer, and  is the dimension of the system.Problems of form (1) frequently arise in several areas of science and engineering such as classical mechanics, celestial mechanics, quantum mechanics, control theory, circuit theory, astrophysics, and biological sciences.Equation ( 1) is traditionally solved by reducing it into a system of first-order IVPs of double dimension and then solved using the various methods that are available for solving systems of first-order IVPs (see Lambert [1,2], Hairer and Wanner in [3], Hairer [4], and Brugnano and Trigiante [5,6]).Nevertheless, there are numerous methods for directly solving the special second-order IVPs in which the first derivative does not appear explicitly and it has been shown that these methods have the advantages of requiring less storage space and fewer number of function evaluations (see Hairer [4], Hairer et al. [7], Simos [8], Lambert and Watson, and [9], Twizell and Khaliq [10]).Fewer methods have been proposed for directly solving second-order IVPs in which the first derivative appears explicitly (see Vigo-Aguiar and Ramos [11], Awoyemi [12], Chawla and Sharma [13], Mahmoud and Osman [14], Franco [15], and Jator [16,17]).It is also the case that some of these IVPs possess solutions with special properties that may be known in advance and take advantage of when designing numerical methods.In this light, several methods have been presented in the literature which take advantage of the special properties of the solution that may be known in advance (see Coleman and Duxbury [18], Coleman and Ixaru [19], Simos [20], Vanden Berghe et al. [21], Vigo-Aguiar and Ramos [11], Fang et al. [22], Nguyen et al. [23], 2 International Journal of Differential Equations Ramos and Vigo-Aguiar [24], Franco and Gómez [25], and Ozawa [26]).However, most of these methods are restricted to solving special second-order IVPs in a predictor-corrector mode.
Our objective is to present a BHTRKNM that is implemented in a block-by-block fashion; in this way, the method does not suffer from the disadvantages of requiring starting values and predictors which are inherent in predictorcorrector methods (see Jator et al. [27], Jator [16], and Ngwane and Jator [28]).We note that multiderivative trigonometrically fitted block methods for   = (, ,   ) have been proposed in Jator [29] and Jator [16].However, the BHTRKNM proposed in this paper avoids the computation of higher order derivatives which have the potential to increase computational cost, especially, when applied to nonlinear systems.In this paper, we propose a BHTRKNM which is of order 3 and its application is extended to solving oscillatory systems, PDEs, and Hamiltonian systems including the energy conserving equation.
The organization of this article is as follows.In Section 2, we derive the BHTRKNM for solving (1).The analysis and implementation of the BHTRKNM are discussed in Section 3. Numerical examples are given in Section 4 to show the accuracy and efficiency of the BHTRKNM.Finally, the conclusion of the paper is given in Section 5.

Development of the BHTRKNM
In order to numerical integrate (1) we define the BHTRKNM as consisting of the following four discrete formulas: where   ,    ,   , and    are coefficients that depend on the step-length ℎ and frequency .In general, the frequency  is chosen near the exact frequency of the true solution (see [30]).The coefficients of the method are chosen so that the method integrates the IVP (1) exactly where the solutions are members of the linear space ⟨1, ,  2 , sin(), cos()⟩.
The main method has the form where  0 ,  0 , and  0 ,  V , and  1 are to be determined coefficient functions of the frequency and step-size.In order to derive the main method and additional methods we initially seek a continuous local approximation Π() on the interval [  ,  +1 ] of the form where  0 (),  0 (), and   (),  = 0, V, 1, are continuous coefficients.The first derivative of ( 4) is given by We assume that  + = Π( + ) is the numerical approximation to the analytical solution ( + ),   + = Π  ( + ) is the numerical approximation to   ( + ), and  + = Π  ( + ) is an approximation to   ( + ),  = 0, V, 1.
The following theorem shows how the continuous method (4) is constructed.This is done by requiring that on the interval from   to  +1 =   + ℎ the exact solution is locally approximated by function ( 4) with ( 5) obtained as a consequence.) ) ) ) and   is obtained by replacing the th column of  by the vector .Let the following conditions be satisfied: then the continuous representations ( 4) and ( 5) are equivalent to the following: Proof.To prove this theorem, we use the approach given in Jator [17] with appropriate notational modification.We start International Journal of Differential Equations 3 by requiring that the method (4) be defined by the assumed basis functions where  +1,0 , ℎ +1,0 , and ℎ 2  +1, are coefficients to be determined.Substituting (10) into (4) we get which is simplified to and expressed as where By imposing conditions (7) on (13), we obtain a system of five equations which can be expressed as where  = (ℓ 0 , ℓ 1 , . . ., ℓ 4 )  is a vector whose coefficients are determined via Cramer's rule as where   is obtained by replacing the th column of  by .
In order to obtain the continuous approximation, we use the elements of  to rewrite (13) as whose first derivative is given by Remark 2. We note that, in the derivation of the BHTRKNM, the basis functions   () =   ,  = 0, 1, 2,  3 () = sin , and  4 () = cos  are chosen because they are simple to analyze.Nevertheless, other possible bases are possible (see Nguyen et al. [23]).

Specification of the Method.
The continuous methods (8) and ( 9) which are equivalent to forms (4) and ( 5) are used to generate two discrete methods and two additional methods.The discrete and additional methods are then applied as a BHTRKNM for solving (1).We choose V = 1/2 and evaluating (8) at  =  +V and  =  +1 , respectively, gives the two discrete methods  +V = Π(  + Vℎ) and  +1 = Π(  + ℎ) which takes the form of the main method.Evaluating (9) at  =  +V and  =  +1 , respectively, gives the additional methods   +V = Π  (  +Vℎ) and   +1 = Π  (  +ℎ).The coefficients and their corresponding Taylor series equivalence of  +V ,  +1 , ℎ  +V , and ℎ  +1 are, respectively, given as follows: International Journal of Differential Equations Remark 3. We note that the Taylor series expansions in (19) through (22) must be used when  → 0 because the corresponding trigonometric coefficients given in these equations are vulnerable to heavy cancelations (see [8]).

Block Form.
BHTRKNM is formulated from the four discrete hybrid formulas stated in (2) which are provided by the continuous one-step hybrid trigonometrically fitted method with one off-grid point given by ( 4) and its first derivative (5).We define the following vectors: where  = 0, . . ., ,  = 0, . . ., .The methods in (2) specified by the coefficients ( 19)-( 22) are combined to give the BHTRKNM, which is expressed as where  0 ,  1 ,  0 , and  1 are matrices of dimension four whose elements characterize the method and are given by the coefficients of (2).
(ii) From the local truncation error constant computation, it follows that the method (24) has order  at least three.

Stability.
The linear-stability of the BHTRKNM is discussed by applying the method to the test equation   = − 2 , where  is a real constant (see [18]).Letting Υ = ℎ, it is easily shown as in [19] that the application of ( 24) to the test equation yields where the matrix (Υ 2 ; ) is the amplification matrix which determines the stability of the method.In the spirit of [22], the spectral radius of ((Υ 2 ; )) can be obtained from the characteristics equation where  = ℎ, Γ(Υ 2 ; ) = trace (Υ 2 ; ), and Θ(Υ 2 ; ) = det (Υ 2 ; ) are rational functions.We let  = ℎ in the following definition.Definition 6.A region of stability is a region in the - plane, throughout which ((Υ 2 ; )) ≤ 1 and any closed curve given by ((Υ 2 ; )) = 1 defines the stability boundary of the method (see [22]).We note that the plot for the stability region of the BHTRKNM method is given in Figure 1.

Implementation.
The main method and the additional methods specified by ( 19)-( 22) are combined to form the block method BHTRKNM (24), which is used to solve (1) without requiring starting values and predictors.BHTRKNM is implemented in a block-by-block fashion using a Mathematica 10.0 code, enhanced by the feature V[ ] for linear problems while nonlinear problems were solved by Newton's method enhanced by the feature [ ] (see Keiper and Gear [33]).Mathematica can symbolically compute derivatives and so the entries of the Jacobian matrix which involve partial derivatives are automatically generated.In what follows, we summarize how BHTRKNM is applied.
Step 3. The process is continued for  = 2, . . .,  − 1 and  = 2, . . ., Γ − 1 to obtain the numerical solution to (1) on the subintervals In order to illustrate the efficiency of our method, we solved a variety of problems including oscillatory systems, PDEs such as the Telegraph equation, and Hamiltonian systems.The following methods are selected for comparison: (i) BHTRKNM given in this paper.

Numerical Examples
In this section, numerical experiments are performed using a code in Mathematica 10.0 to illustrate the accuracy and efficiency of the method.
where the analytical solution is given by Exact:  () = cos (10) + sin (10) + sin () .This example was solved using the order 3 BHTRKNM and the endpoint errors (Err = |(  ) −   |) obtained were compared to the order 4 exponentially fitted method given in Simos [8].In Table 1 it is shown that BHTRKNM is more efficient than the method in Simos [8].We also compare the computational efficiency of the two methods in Figure 2 by considering the FNEs (number of function evaluations) over  integration steps for each method.This example illustrates that the BHTRKNM performs better.
Example 3. We consider the following two-body problem which was solved by Ozawa [26] on [0, 50]: where  (0 ≤  < 1) is an eccentricity.The exact solution of this problem is where  is the solution of Kepler's equation  =  +  sin().
We show in Table 3 that the results obtained using the BHTRKNM method are more accurate than the explicit singly diagonally implicit Runge-Kutta (ESDIRK) and the functionally fitted ESDIRK (FESDIRK) methods given in Ozawa [26].In Figure 4, we also illustrate the efficiency advantage of the BHTRKNM method over those in Ozawa [26].
This problem was chosen to demonstrate the stability of the BHTRKNM (Figure 5).As mentioned in Remark 7, the method is stable when  ∈ [0, 47.06] and  ∈ [−, ].

Problems Where 𝑦 󸀠 Appears Explicitly
Example 5. We consider the harmonic oscillator with frequency Ω and small perturbation  that was solved in Franco [15] and Guo and Yan [34]: where the analytical solution is given by Exact: where Ω = 1,  = 10 −6 , and  = 10 −10 .Guo and Yan [34] solved this problem using ARKN method.The results in Table 4 show that the BHTRKNM is competitive with the order 5 Runge-Kutta-Nyström method.
In order to solve this PDE using the BHTRKNM, we carry out the semidiscretization of the spatial variable  using the second-order finite difference method to obtain the following second-order system in the second variable .
The system also has the angular momentum  =  1   2 −  2   1 as a first integral.We take the parameter value  = 10 −3 .
This problem is solved in the interval [0, 1000] using the BHTRKNM for various values of ℎ = 0.1/2 −1 ,  = 0, 1, 2, 3, 4. The BHTRKNM preserves the Hamiltonian energy and to demonstrate this, we plot the logarithm of the global error of the Hamiltonian EH = |  −  0 | and the momentum EL = |  −  0 | as given in Figures 7(a) and 7(b), respectively.The problem was also solved using N4 given in Sommeijer [35] and in Figure 7(c), the efficiency curves for the BHTRKNM and N4 are compared showing that the BHTRKNM is superior.
Example 8. We consider the pendulum oscillator in [36] This problem is solved using the BHTRKNM on the interval [0, 50] for ℎ = 1 and  = 1, 1.4, 2 and the results for the phase diagrams produced by the BHTRKNM in the -  plane are presented in Figures 8(a), 8(b), and 8(c), respectively.We observe that the BHTRKNM gives good results for all the values of , since all the diagrams follow the exact flow of the pendulum problem as given in Figure 8(e).As illustrated in these Figures, the numerical solutions are periodic and in accordance with the fact that the pendulum equation has a periodic solution.We note that Van Daele and Vanden Berghe in [36] obtained similar results for a smaller step-size ℎ = 0.5 and  = 1 using / method including other versions of the / method and it was observed that the 1  method in [36] produced better numerical results for  = 1 than for  = 1.4.The problem was also solved using the fourth-order Runge-Kutta method (RK4) and the results presented in Figure 8(d) show a distortion in the flow diagram for the RK4; hence the BHTRKNM is superior.The pendulum problem was also presented in Figure 9.

Conclusion
This paper presents a BHTRKNM whose coefficients are functions of the frequency and the step-size for directly solving general second-order initial value problems (IVPs), oscillatory systems, and Hamiltonian systems, as well as systems arising from the semidiscretization of hyperbolic PDEs, such as the Telegraph equation.We implement the BHTRKNM in a block-by-block fashion; thus the method does not need starting values and predictors which are inherent in predictor-corrector methods.Numerical experiments presented in this paper clearly demonstrate that our method has a reasonably wide stability region and enjoys accuracy and efficiency advantages when compared to existing methods in the literature.Technique for accurately estimating the frequency as suggested in [30,41] as well as implementing the method in a variable step mode will be considered in future.

Figure 5 :
Figure 5: These figures illustrate the stability of the BHTRKNM applied to Example 4. In (a) the method is stable with  = 722,  ∈ [0, 47.96], and the global error is 1.7 × 10 −10 , whereas in (b) the method is unstable with  = 721,  > 47.96, and the global error is 7005.78.

4. 3 . 2 Figure 7 :
Figure 7: Perturbed Kepler problem: the logarithm of the global error of the Hamiltonian EH = |  −  0 | against  for ℎ = 0.2 and the momentum EL = |  −  0 | are presented in (a) and (b), respectively.In (c) we compare the efficiency curves for the BHTRKNM and N4.Timing comparison is provided in (d).It is clear from the timing curves that BHTRKNM is very efficient.

Figure 8 :
Figure 8: The pendulum problem: phase diagrams for BHTRKNM with  = 1, 1.4, 2 are presented in (a), (b), and (c), respectively.(d) illustrates a distortion in the flow for the RK4, while (e) shows exact flow of the pendulum problem.In the diagrams,  = ;   =   .

1 Figure 9 :
Figure 9: The pendulum problem: Hamiltonian error EH = |  −  0 | using RK4 with ℎ = 0.5 is presented in (a), while (b) shows EH for BHTRKNM.We also solve the problem on a larger interval of integration [0, 500], using the BHTRNM in (c) and (d) and the RK4 in (e) and (f), respectively.
(and  references herein)  given by   = − sin  (cos . and  4 () = cos  be basis functions and let  = (  ,    ,   ,  +V ,  +1 )  be a vector, where  is the transpose.Define the matrix  by