1. Introduction
Boundary value problems (BVPs) are paramount in the modeling of several real-life problems with diverse applications. Boundary conditions of different types often accompany these problems. Dirichlet boundary conditions are the most common and more straightforward to implement. The Neumann boundary conditions are also not too complicated to deal with. On the other hand, the implementation of Robin boundary conditions poses significant difficulties to many researchers. As a result, BVPs with Robin boundary conditions have not received much attention. The Robin boundary condition, also referred to as the third-type boundary condition, was named after Victor Gustave Robin, who was behind its inception [
1]. The Robin boundary condition is a linear combination of the solution and its derivative at the boundary point. It arises in diverse physical situations.
If a differential equation is to be solved over a domain
, where
denotes the domain’s boundary, the Robin boundary condition is:
on the
boundary. Our focus, in this work, is to solve second-order boundary value problems of the form
subject to the Robin boundary conditions
where
, and
are constants.
Numerous approximation methods have been developed and implemented to solve Equation (
2). They include the homotopy perturbation method [
2], homotopy analysis method [
3], Adomian decomposition method [
4], variational iteration method [
5], spectral method [
6], shooting method [
7], and finite differences [
8], to name a few. The Robin boundary conditions have not been covered that extensively because they are difficult to deal with. Some of the methods that have been utilized to solve Equation (
2) with Robin boundary conditions include the diagonal block method [
9], modified Adomian decomposition method [
10], Bernoulli polynomials [
11], the compact finite difference method [
12].
Compact finite difference schemes (CFDSs) have gained popularity in the field of numerical approximations in recent years. In [
13], Lele gave an in-depth description of CFDSs for various applications such as interpolation, filtering, and evaluating derivatives. They have been applied to solve differential equations such as Poisson’s equation [
14], Burger’s equation [
15,
16], American option pricing problems [
17], Navier–Stokes equation [
18], integro-differential equation [
19,
20], Korteweg–de Vries equation [
21], Black–Scholes equation [
22,
23], dynamical systems [
24,
25], and many more [
26,
27,
28,
29,
30]. Their main advantage is that, with few grid points, they attain very high-order accuracy.
In this work, we use the higher-order compact finite difference schemes to solve two-point boundary value problems with Robin boundary conditions. Usually, when finite difference methods are used to solve differential equations subjected to Neumann or Robin boundary conditions, the first-order finite difference formula is used to approximate the derivative in the boundary condition, even if a higher-order method is being used to solve the equation. The disadvantage with that is that the overall accuracy is compromised because of the lower-order approximation at the boundaries. Hence, we develop new higher-order finite difference schemes to approximate the Robin boundary conditions in this work. This enhances the overall accuracy. We consider some examples of boundary value problems that are subjected to Robin boundary conditions to test the applicability and accuracy of the new schemes.
The rest of the paper is laid out as follows. In
Section 2, we discuss the quasilinearization technique. In
Section 3, we present the derivations of the sixth-order compact finite difference schemes. In
Section 4 we discuss the development of CFDSs with Robin boundary conditions. We discuss the convergence of method in
Section 5. The results and discussion are presented in
Section 6, followed by the conclusions in
Section 7.
6. Numerical Examples
In this section, we consider several examples to highlight the applicability and high accuracy of the proposed algorithm in solving two-point boundary value problems subjected to Robin boundary conditions. To check the accuracy, we compute the maximum absolute error (
) between the exact and numerical solutions, i.e.,
where
and
represent the CFDM solution and exact solution at the grid point
, respectively. In addition, we compute the numerical rate of convergence, which is defined as
where
and
are absolute errors corresponding to grids with step size
and
, respectively. We compare our results with published results obtained using other methods.
Example 1. Consider the linear boundary value problem:with boundary conditions: We present the results of Example 1 in
Table 1. We display the maximum absolute error computed using different values of grid points
N. In this example, we obtain the maximum accuracy, with an error of about
, when
. When compared to the results in [
9,
11], our results are much more accurate. For instance, with a step size
, the error in [
9] is about
, but our error is about
, with a slightly larger step size. Our results are also better compared to the results of [
11] obtained using Bernoulli polynomials. The agreement between the exact and numerical solutions is depicted in
Figure 1, with the errors from the different values of
N again shown in
Figure 2.
Example 2. Consider the nonlinear second-order boundary value problem:with boundary conditions: Figure 3 depicts the solution of Example 2. A good agreement between the exact and the numerical solution can be observed. In this example,
gives the maximum error of about
, and this is shown in
Table 2. Again, when compared to the results in [
9], the method shows remarkable accuracy on a slightly larger step size than in [
9]. The errors are also shown in
Figure 4 for the different values of
N.
Figure 5 shows that six iterations of the quasilinearization are required to reach full convergence.
Example 3. Consider the nonlinear second-order boundary value problem:with boundary conditions: The results of Example 3 are similar to those of the previous examples.
Figure 6 shows the plots of the exact and numerical solution, which are in good agreement. The maximum absolute error, computational times, and rates of convergence (ROCs) are presented in
Table 3, with results from Nasir et al. [
9] included. As shown in the table, the proposed method gives accurate results with fewer grid points compared to the results in [
9]. Plots of the maximum absolute errors for various values of
N are shown in
Figure 7. Finally,
Figure 8 shows the convergence plots for the various
N values. It can be seen from the plot that the method reaches full convergence after six iterations.
Example 4. Consider the nonlinear second-order boundary value problem:with boundary conditions: For Example 4, we also compute the approximate solution using the proposed CFDM for various values of
N. Likewise, the error norm, rates of convergence, and computational times are presented in
Table 4. As shown in the table, for
, the CFDM has an error of about
, whereas in [
9], the error is
for
. This comparison confirms that the CFDM gives accurate results with fewer grid points. A graphical comparison of the CFDM results and the exact solution is shown in
Figure 9. Plots of the absolute errors for various
N values is shown in
Figure 10. Lastly,
Figure 11 shows the convergence plots for the various
N values. The plot indicates the method reaches full convergences after six iterations.
Example 5. Consider the nonlinear second-order boundary value problem:with boundary conditions: Likewise, in Example 5, we estimate the solution of the nonlinear differential equation using the CFDM for various values of
N. The error norm, rates of convergence, and execution times of the proposed method are presented in
Table 5, with results from Nasir et al. [
9]. The table indicates that the CFDM achieves accuracy on a slightly larger step size than in [
9]. A graphical comparison of the CFDM results and the exact solution is shown in
Figure 12. The errors for various values of
N are shown in
Figure 13. Lastly, convergence plots for the different
N values are depicted in
Figure 14, depicting that the method reaches full convergence after about 6 to 8 iterations, depending on the value of
N.
Example 6. Consider the nonlinear second-order boundary value problem:with boundary conditions: Lastly, a graphical comparison of the CFDM results and the exact solution is shown in
Figure 15. The maximum absolute errors of Example 6 obtained using various values of
N are displayed in
Table 6 and also shown in
Figure 16. We observe that with the same step size, we obtain better accuracy than the results in [
32,
34]. Lastly, convergence plots for the different
N values are depicted in
Figure 17, depicting that the method reaches full convergence after 8 or 9 iterations, depending on the value of
N used.
In
Table 1,
Table 2,
Table 3,
Table 4,
Table 5 and
Table 6, we present the computed rates of convergence for all the examples, which are consistent with the theoretical order of convergence obtained in Theorem 1.