In this paper, a mid-knot cubic non-polynomial spline is applied to obtain the numerical solution of a system of second-order boundary value problems. The numerical method is proved to be uniquely solvable and it is of second-order accuracy. We further include three examples to illustrate the accuracy of our method and to compare with other methods in the literature.

Introduction

We consider a system of second-order boundary value problems of the type

$$ \begin{aligned} &y''(x)= \textstyle\begin{cases} f(x), &a \leq x \leq c,\\ g(x)y(x)+f(x)+r,&c \leq x \leq d,\\ f(x), &d \leq x \leq b, \end{cases}\displaystyle \\ &y(a)=\bar{a}, \qquad y(b)=\bar{b}, \end{aligned} $$

(1.1)

with continuity conditions of y and \(y'\) at c and d. Here, f and g are continuous functions on \([a,b]\) and \([c,d]\), respectively, r, ā and b̄ are real finite constants. This type of systems arise in the study of obstacle, unilateral, moving and free boundary value problems [7, 9, 10, 16, 23]. For instance, in modeling an elastic string lying over an elastic obstacle, it has been first shown in [19] that a variational inequality can be transformed to Eq. (1.1) by using the penalty function technique of Lewy and Stampacchia [17].

There are substantial interests on the numerical treatment of the problem (1.1). Noor and Khalifa [19] have used a collocation method with cubic B-splines as basis functions to solve (1.1), while the well-known Numerov method and finite difference schemes based on the central difference have been employed in [22]. Thereafter, Al-Said et al. [5] show that cubic spline method gives numerical solutions that are more accurate than that computed by quintic spline and finite difference techniques. The numerical results of [5, 19, 22] indicate first-order accuracy for these methods. In [4], a two-stage method is developed where a finite difference scheme is first employed to obtain the numerical solutions at mid-knots of a uniform mesh, then a second-order interpolation is used to obtain the numerical solutions at the knots. This method is of second-order accuracy. Other proven second-order accurate methods include polynomial spline methods that employ quadratic spline [1], cubic spline [2, 3] and quintic spline [6]. The numerical solutions are obtained at mid-knots of a uniform mesh in [1–3], while numerical solutions are obtained at the knots in [6]. These polynomial spline methods use ‘continuous’ spline, and derivatives of the spline are involved in the spline relations. On the other hand, discrete spline uses differences instead of derivatives in the spline relations. In [8], Chen and Wong have developed a deficient discrete cubic spline method for (1.1). It is proved that the accuracy of the method is two, and the numerical experiments demonstrate better accuracy over polynomial spline methods.

Besides continuous polynomial splines, non-polynomial splines have also been applied to solve (1.1). Non-polynomial spline, also known as parametric spline [13], depends on a parameter \(k>0\), and reduces to the ordinary cubic or quintic spline when \(k\to0\). Due to the parameter k, the numerical solutions obtained by non-polynomial splines in the literature are observed to be more accurate than that computed by polynomial splines. In fact, a cubic non-polynomial spline method has been proposed by Khan and Aziz [12] and subsequently by Siraj-ul-Islam and Tirmizi [25] to solve (1.1) at the knots of a uniform mesh. The method is shown to be of order two, and numerical results indicate better accuracy over polynomial spline methods. Higher degree non-polynomial splines have also been used in higher-order boundary value problems, for example quartic non-polynomial spline for third-order boundary value problem [24, 26], quintic non-polynomial spline for fourth-order boundary value problem [14] and sextic non-polynomial spline for fifth-order boundary value problem [15]. Out of all these work, only [26] gives the numerical solutions of the third-order boundary value problem at mid-knots of a uniform mesh while the rest obtains the numerical solutions at the knots. The methods mentioned so far yield discrete numerical schemes. There are also iterative methods such as Adomian decomposition method [18] and variational iteration method [20]. Both of these methods do not require discretization.

Motivated by the above work especially those involving the use of non-polynomial splines, in this paper we shall develop a cubic non-polynomial spline scheme at mid-knots of a uniform mesh for the problem (1.1). The unique solvability and convergence analysis will be carried out which indicates a second-order accurate method. Finally, three examples will be presented to illustrate the numerical efficiency and the better performance over other methods in the literature.

Mid-knot cubic non-polynomial spline method

Let \(\Omega:a=x_{0}< x_{1}<\cdots<x_{n}=b \) be a uniform mesh of \([a,b]\) with \(x_{i}=a+ih\), \(0\leq i\leq n\), where \(h=\frac{b-a}{n}\) is the step size. Without loss of generality, let

and we require the positive integer n, \(n\geq12\), to be divisible by 4. Thus, the points c and d are in Ω.

Define the mid-knots of the mesh Ω as

$$ x_{i-1/2}=a+ \biggl(i-\frac{1}{2} \biggr)h, \quad1 \leq i \leq n. $$

(2.1)

Note that the breakup points c and d are not any of the mid-knots defined above, in fact \(c\in[x_{n/4-1/2}, x_{n/4+1/2}]\) and \(d\in[x_{3n/4-1/2}, x_{3n/4+1/2}]\).

Throughout the paper, for any function \(v(x)\) we shall denote \(v^{(j)}(x_{i})=v^{(j)}_{i}\) and likewise \(v^{(j)}(x_{i-1/2})=v^{(j)}_{i-1/2}\). In the following, we define the cubic non-polynomial spline in terms of mid-knots of the mesh Ω. Note that [13] gives a similar definition but in terms of the knots of Ω.

Definition 2.1

For a given mesh Ω, we say \(P(x)\) is the cubic non-polynomial spline with parameterk (>0) if \(P(x)\in C^{(2)}[a,b]\), \(P(x)\) has the form \(\operatorname{span}\{1,x, \sin kx,\cos kx\}\), and its restriction \(P_{i}(x)\) on \([x_{i-1/2},x_{i+1/2}]\), \(1\leq i \leq n-1\) satisfies

Then, using the continuity of the first derivative of the spline, namely, \(P'_{i-1}(x_{i-1/2})=P'_{i}(x_{i-1/2})\), \(2\leq i \leq n-1\), we obtain from (2.4)

When \(k\to0\), we have \((\alpha,\beta)\to (\frac{1}{6},\frac{1}{3} )\) and the cubic non-polynomial spline relation of Eq. (2.5) reduces to the well-known cubic spline relation. Further, for the consistency of relation (2.5), we have \(2\alpha+2\beta=1\) [13].

We shall approximate a solution \(y(x)\) of (1.1) by the non-polynomial spline \(P_{i}(x)\) over the subinterval \([x_{i-1/2}, x_{i+1/2}]\), \(1\leq i \leq n-1\). Hence, it follows from (2.5) that

Due to the consistency relation \(2\alpha+2\beta=1\), (2.8) immediately gives \(t_{i}=O(h^{4}),~2\leq i\leq n-1\). If, in addition, \(\alpha=\frac{1}{12}\) (which implies \(\beta=\frac{5}{12}\)), then (2.8) yields \(t_{i}=O(h^{6}),~2\leq i\leq n-1\).

Next, since we approximate a solution \(y(x)\) of (1.1) by the non-polynomial spline \(P(x)\), it is natural to set the second derivative of the spline as

$$ D_{i-1/2}= \textstyle\begin{cases} f_{i-1/2}, & 1\leq i\leq\frac{n}{4},\\ g_{i-1/2}S_{i-1/2}+f_{i-1/2}+r, & \frac{n}{4}+1 \leq i \leq\frac{3n}{4},\\ f_{i-1/2}, & \frac{3n}{4}+1 \leq i \leq n. \end{cases} $$

(2.9)

Note that in (2.9), by considering the second derivative at mid-knots, we avoid the breakup points c and d at which \(y''\) is discontinuous.

Substituting (2.9) into (2.5) yields the following equations:

To set up a system of n equations for the unknown \(S_{i-1/2}\), \(1\leq i\leq n\), we need two more equations besides (2.10)–(2.16). Using the method of undetermined coefficients, we obtain the following two equations which have truncation errors of \(O(h^{6})\):

We have now derived the mid-knot cubic non-polynomial spline scheme which comprises Eqs. (2.10)–(2.16) and (2.18) with \(2\alpha+2\beta=1\). The solvability of the system and the convergence analysis will be tackled in the next section.

Solvability and convergence

In this section, we shall establish the unique solvability of the mid-knot cubic non-polynomial spline scheme (2.10)–(2.16) and (2.18) and also conduct a convergence analysis. To begin with, we define the norms of a column vector \(T=[t_{i}]\) and a matrix \(Q=[q_{ij}]\) as follows:

Let \(e_{i-1/2}=y_{i-\frac{1}{2}}-S_{i-\frac{1}{2}}\), \(1\leq i\leq n\) be the errors. Let \(Y=[y_{i-1/2}]\), \(S=[S_{i-1/2}]\), \(W=[w_{i}]\), \(T=[t_{i}]\) and \(E=[e_{i-1/2}]\) be n-dimensional column vectors. The system (2.10)–(2.16) and (2.18) can be written as

$$\begin{aligned} v_{i-1/2}= \textstyle\begin{cases} 0,& 1\leq i \leq\frac{n}{4},\\ g_{i-1/2}, & \frac{n}{4}+1\leq i \leq\frac{3n}{4},\\ 0,& \frac{3n}{4}+1\leq i \leq n. \end{cases}\displaystyle \end{aligned}$$

By Lemma 3.1, the inverse \(A_{0}^{-1}\) exists, hence for the existence of the unique solution S it remains to show that \((I+A_{0}^{-1}h^{2}QG)\) is nonsingular.

From the definitions of matrices Q and G, it is clear that

$$\begin{aligned} \Vert Q \Vert =1, \qquad \Vert G \Vert =\max _{\frac{n}{4}+1\leq i \leq \frac{3n}{4}} \vert g_{i-\frac{1}{2}} \vert \leq\hat{g}. \end{aligned}$$

Since \(K<1\), it follows immediately from Lemma 3.2 that \((I+A_{0}^{-1}h^{2}QG)\) is nonsingular. It is hence proven that (3.1) has a unique solution given by (3.14).

Next, we consider the error E, which from (3.8) can be written as

From (3.9), we note that \(\|T\|=O(h^{4})\) in the general case, i.e., \(2\alpha+2\beta=1\). Together with Lemma 3.2, (3.16) and (3.10), it follows that

This shows that (3.1) is a second-order convergence method in the general case when \(2\alpha+2\beta=1\).

On the other hand, for the special case \(\alpha=\frac{1}{12}\), \(\beta=\frac{5}{12}\), we have from (3.9) that \(\|T\|=O(h^{6})\). So by using a similar argument as above, we obtain \(\|E\|\leq O(h^{4})\), which indicates that (3.1) is a fourth-order convergence method. However, the solution of problem (1.1) exists continuously only up to the second derivative. Therefore, the numerical method is only second-order accurate over the whole interval for the special case \(\alpha=\frac{1}{12}\), \(\beta=\frac{5}{12}\). Indeed, a similar conclusion can be observed in [4–6, 8, 12, 25]. In summary, the numerical method (3.1) is of second order for all α and β satisfying \(2\alpha+2\beta=1\). □

Remark 3.2

Other than the two equations in (2.17) which have truncation errors of \(O(h^{6})\), we can also obtain, by the method of undetermined coefficients, the following two equations, which have truncation errors of \(O(h^{4})\):

It is possible to use (2.10)–(2.16) and (3.18) (instead of (2.18)) to form a ‘new’ numerical scheme for the general case when \(2\alpha+2\beta=1\) (except \(\alpha=\frac{1}{12}\), \(\beta=\frac{5}{12}\)). In fact, the coefficient matrix A of the new system (2.10)–(2.16) and (3.18) is exactly the same as that of the original proposed scheme (2.10)–(2.16) and (2.18) (see (3.1)), therefore the unique solvability of the new system is guaranteed. Further, by following a similar argument to the proof of Theorem 3.1, we can show that the new scheme is also of second order. Although the convergence order of the new scheme is the same as the original proposed scheme, from numerical simulation we notice that the errors obtained by the new scheme are generally larger than that obtained by the original proposed scheme. As such, the original scheme (2.10)–(2.16) and (2.18) is a better choice.

Application to obstacle boundary value problem

To illustrate the application of the mid-knot cubic non-polynomial spline scheme (2.10)–(2.16) and (2.18), we consider the following well-known obstacle value problem

where \(f(x)\) is a given force on the string and \(\psi(x)\) is the elastic obstacle function.

The problem (4.1) has been considered by many authors. Noor and Khalifa [19] first discussed it using the variational inequality approach and showed that the problem (4.1) is equivalent to the variational inequality problem (also see [7, 9, 16, 21])

$$\begin{aligned} \rho(y, v-y)\geq\langle f, v-y \rangle, \quad \mbox{for all } v \in C, \end{aligned}$$

(4.2)

where \(\rho(\cdot,\cdot)\) is a coercive continuous bilinear form and C is the closed convex set given by \(C= \{ v \in H_{0}^{1}(\Omega) | v \geq\psi\mbox{ on }\Omega\}\) and \(H_{0}^{1}(\Omega)\) is a Sobolev space.

Following the idea and technique of Lewy and Stampacchia [17], the variational inequality (4.2) can be written as

where \(\mu(t)\), known as the penalty function, is the discontinuous function defined by

$$\begin{aligned} \mu(t)= \textstyle\begin{cases} 1, & t \geq0, \\ 0, & t < 0, \end{cases}\displaystyle \end{aligned}$$

(4.4)

and ψ is the given obstacle function defined by

$$\begin{aligned} \psi(x)= \textstyle\begin{cases} -1, & 0 \leq x \leq\frac{\pi}{4}, \\ 1, & \frac{\pi}{4} \leq x \leq\frac{3 \pi}{4}, \\ -1, & \frac{3 \pi}{4} \leq x \leq\pi. \end{cases}\displaystyle \end{aligned}$$

(4.5)

Equation (4.3) describes the equilibrium configuration of an obstacle string pulled at the ends and lying over elastic step of constant height 1 and unit rigidity.

From Eqs. (4.3)–(4.5), one obtains the following system of second-order boundary value problems:

$$\begin{aligned} \begin{aligned} &y''= \textstyle\begin{cases} f, & 0 \leq x \leq\frac{\pi}{4}\mbox{ and } \frac{3\pi}{4} \leq x \leq\pi, \\ y+f-1, & \frac{\pi}{4} \leq x \leq\frac{3 \pi}{4}, \end{cases}\displaystyle \\ & y(0)=y(\pi)=0, \end{aligned} \end{aligned}$$

(4.6)

with continuity conditions of y and \(y'\) at \(\frac{\pi}{4}\) and \(\frac{3 \pi}{4}\).

In Example 4.1, we shall consider a well-known special case of the system (4.6) when \(f=0\). This special case is first discussed in [19] and subsequently considered in almost every paper on system of second-order boundary value problems.

where \(\gamma_{1}=\pi+4 \coth\frac{\pi}{4}\) and \(\gamma_{2}= \pi\sinh\frac{\pi}{4}+4 \cosh\frac{\pi}{4}\).

In Table 1, we present the maximum absolute errors \(\|E\|=\max_{1\leq i\leq n}|e_{i-1/2}|\) obtained from our mid-knot cubic non-polynomial spline scheme for various values of α and β, and also the maximum absolute errors obtained from other methods.

From Table 1, the numerical results confirm that our method is of second order. Compared to the parametric cubic spline method [12, 25], our method gives the smallest errors for all cases of \((\alpha,\beta)\). Furthermore, our method outperforms all other methods [1–6, 8, 19, 22] in all cases.

To illustrate graphically, in Figs. 1 and 2, we plot the exact solution, the numerical solution obtained from the mid-knot cubic non-polynomial spline method, and the associated absolute errors when \((\alpha,\beta,h)= (\frac{1}{12},\frac{5}{12}, \frac{\pi}{80} )\). It is observed from the figures that this method gives a good approximation to the exact solution.

Finally, to investigate the effect of α on the maximum absolute error \(\|E\|\), in Fig. 3 we plot the maximum absolute errors for different values of \(\alpha\in(0,0.5)\) (in steps of \(\frac{1}{32}\)) when \(h=\frac{\pi}{80}\). It is observed that the minimum \(\|E\|\) is obtained at about \(\alpha=\frac{1}{8}\).

In the next two examples, unlike Example 4.1, we consider the problem (1.1) with nonzero f.

Example 4.2

We consider the boundary value problem

$$\begin{aligned} \begin{aligned} &y''= \textstyle\begin{cases} 2, & 0\leq x \leq\frac{\pi}{4}, \\ -y+\frac{\pi^{2}}{16}+\frac{7}{4}\pi+1, & \frac{\pi}{4}\leq x \leq\frac{3\pi}{4},\\ 2, & \frac{3\pi}{4} \leq x \leq\pi, \end{cases}\displaystyle \\ &y(0)=0, \qquad y(\pi)=\frac{\pi^{2}}{2}+\frac{5\pi}{2}+2. \end{aligned} \end{aligned}$$

(4.9)

Here, \(f(x)=2\), \(g(x)=-1\) and \(r=\frac{\pi^{2}}{16}+\frac{7}{4}\pi-1\). The analytical solution of (4.9) is given by

$$\begin{aligned} y(x)= \textstyle\begin{cases} x^{2}+x, & 0\leq x\leq\frac{\pi}{4},\\ -\frac{\sqrt{2}\pi}{2}\sin x -\sqrt{2}(\pi+1)\cos x+\frac{\pi^{2}}{16}+\frac{7\pi}{4}+1, & \frac{\pi }{4}\leq x \leq\frac{3\pi}{4},\\ x^{2}+x-\frac{\pi^{2}}{2}+\frac{3\pi}{2}+2, & \frac{3\pi}{4} \leq x \leq\pi. \end{cases}\displaystyle \end{aligned}$$

(4.10)

In this example, we focus on comparing the three more accurate methods observed in Table 1, namely: (i) mid-knot cubic non-polynomial spline (MCNS), (ii) parametric cubic spline (PCS) [12, 25], and (iii) deficient discrete cubic spline (DDCS) [8]. In Table 2, we present the maximum absolute errors and the convergence orders of these methods. It is clear that the mid-knot cubic non-polynomial spline scheme obtains the smallest errors in all the cases.

Next, the effect of α on the maximum absolute error is illustrated in Fig. 4, where we plot the maximum absolute errors for different values of \(\alpha\in(0,0.5)\) (in steps of \(\frac{1}{32}\)) when \(h=\frac{\pi}{80}\). We notice that the minimum \(\|E\|\) is obtained at about \(\alpha=\frac{1}{16}\), which is different from Example 4.1.

In this example, \(f(x)=2\), \(g(x)=1\) and \(r=-\frac{29}{16}\). The analytical solution of (4.11) is given by

$$\begin{aligned} y(x)= \textstyle\begin{cases} x^{2}+x+1, & 0 \leq x \leq\frac{1}{4}, \\ \frac{3}{2}e^{x-\frac{1}{4}}-\frac{3}{16}, & \frac{1}{4}\leq x \leq\frac{3}{4}, \\ x^{2}+ (\frac{3}{2}e^{\frac{1}{2}}-\frac{3}{2} )x+\frac {3}{8}e^{\frac{1}{2}}+\frac{3}{8}, & \frac{3}{4}\leq x \leq1. \end{cases}\displaystyle \end{aligned}$$

(4.12)

Once again we compare the three better methods arising from Table 1, namely: (i) mid-knot cubic non-polynomial spline (MCNS), (ii) parametric cubic spline (PCS) [12, 25], and (iii) deficient discrete cubic spline (DDCS) [8]. In Table 3, we present the maximum absolute errors of these methods and it is clear that the mid-knot cubic non-polynomial spline scheme outperforms in all the cases.

In Fig. 5, we illustrate the effect of α on the maximum absolute error. It is observed that the minimum \(\|E\|\) is obtained at about \(\alpha=\frac{1}{8}\), which is a different value from Example 4.2 but is about the same value as in Example 4.1.

Conclusion

In this paper, we have developed a numerical scheme for a system of second-order boundary value problems, which arises from second-order obstacle problem. Our scheme is obtained by using cubic non-polynomial spline at mid-knots to avoid the breakup points c and d. We have proved the unique solvability and established convergence order of our scheme. To demonstrate the numerical efficiency and to compare with other methods in the literature, three examples are presented. The numerical results illustrate that our method gives the smallest errors in all the cases.

References

Al-Said, E.A.: Spline solutions for system of second-order boundary-value problems. Int. J. Comput. Math. 62, 143–154 (1996)

Al-Said, E.A.: The use of cubic splines in the numerical solution of a system of second-order boundary value problems. Comput. Math. Appl. 42, 861–869 (2001)

Al-Said, E.A., Noor, M.A.: Modified Numerov method for solving system of second-order boundary-value problems. Korean J. Comput. Appl. Math. 8, 129–136 (2001)

Al-Said, E.A., Noor, M.A., Al-Shejari, A.A.: Numerical solutions for system of second order boundary value problems. Korean J. Comput. Appl. Math. 5, 659–667 (1998)

Chen, F., Wong, P.J.Y.: Deficient discrete cubic spline solution for a system of second order boundary value problems. Numer. Algorithms 66, 793–809 (2014)

Khan, A., Aziz, T.: Parametric cubic spline approach to the solution of a system of second-order boundary-value problems. J. Optim. Theory Appl. 118, 45–54 (2003)

Khan, A., Noor, M.A., Aziz, T.: Parametric quintic-spline approach to the solution of a system of fourth-order boundary-value problems. J. Optim. Theory Appl. 122, 309–322 (2004)

Khan Siraj-ul-Islam, M.A., Tirmizi, I.A., Twizell, E.H., Ashraf, S.: A class of methods based on non-polynomial sextic spline functions for the solution of a special fifth-order boundary-value problems. J. Math. Anal. Appl. 321, 651–660 (2006)

Noor, M.A., Noor, K.I., Rafiq, M., Al-Said, E.A.: Variational iteration method for solving a system of second-order boundary value problems. Int. J. Nonlinear Sci. Numer. Simul. 11, 1109–1120 (2010)

Siraj-ul-Islam, Khan, M.A., Tirmizi, I.A., Twizell, E.H.: Non polynomial spline approach to the solution of a system of third-order boundary-value problems. Appl. Math. Comput. 168, 152–163 (2005)

Siraj-ul-Islam, Tirmizi, I.A.: Nonpolynomial spline approach to the solution of a system of second-order boundary-value problems. Appl. Math. Comput. 173, 1208–1218 (2006)

Siraj-ul-Islam, Tirmizi, I.A., Khan, M.A.: Quartic non-polynomial spline approach to the solution of a system of third-order boundary-value problems. J. Math. Anal. Appl. 335, 1095–1104 (2007)

None of the authors have any competing interests in the manuscript.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided 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.

Ding, Q., Wong, P.J.Y. Mid-knot cubic non-polynomial spline for a system of second-order boundary value problems.
Bound Value Probl2018, 156 (2018). https://doi.org/10.1186/s13661-018-1075-y