1 Introduction

The non-linear Hunter–Saxton equation (HS) is a PDE which was firstly considered by Hunter and Saxton [5], given by

$$\begin{aligned} (u_t+uu_x)_x=\frac{1}{2}u_x^2, ~x\in [a,b],~t\ge 0 \end{aligned}$$
(1)

where t and x are the time and space variables, and u corresponds to splay waves that propagate throughout liquid crystal molecules. This equation describes the orientation waves that cause disclinations throughout the crystal structure. The HS equation modeled as high frequency limit of the shallow water equation, the Camassa-Holm equation, models soliton as well as breaking waves [11]. This equation describes the geodesic flow on the diffeomorphism group of the unit circle [17]. Different real-life applications of this equation entice researchers to find its analytical and numerical solutions.

Numerous numerical methods available in the literature have been applied to the HS equation. Rouhparvar [20] used a semi-analytical differential transform method. A finite difference scheme has been performed by Holden [13], and Arbabi [4] applied a Haar wavelet quasilinearization approach along with a finite difference scheme. Behzadi [7] provided approximate solutions using the Adomian decomposition method, while Aratyn [6] used the Padé approximation technique. Other schemes using collocation based on cubic trigonometric B-splines [12], quintic B-splines [14], Laguerre wavelets [24] and Barycentric interpolation [26] have been implemented to give approximate solutions of the HS equation.

A well-known simple and cost-efficient approach considered by researchers is the differential quadrature method (DQM). DQM is a numerical technique used to approximate derivatives of the solution and was firstly introduced by Bellman et al.[8]. Later, Quan and Chang [18] improved the DQM by introducing weighting coefficients. A generalized formula for higher order derivatives was given by Shu [22]. To find better approximations, several types of trial functions, like Lagrange interpolation polynomial, B-spline basis functions and many others have been considered [9, 15, 16, 25]. To the best of our knowledge, DQM has never been applied to the HS equation. Moreover, to overcome the numerical instability, DQM based on cubic trigonometric B-splines can be a rescuer in this situation.

Along with DQM, several methods, for instance, finite difference schemes or multi-stage methods such as SSP-RK can be used for the temporal dimension. A major shortcoming of these schemes is the requirement for a finer grid size to attain acceptable accuracy and stability. To overcome the limitations of the above-mentioned schemes, hybrid block methods come into the scene. Hybrid methods assess the information at off-step points and usually leads to zero-stability and better stability characteristics. Additionally, hybrid methods have the ability to change the step size and violate the Dahlquist’s barrier [10]. Apart of the property of being self-starting, hybrid block methods have been developed which claimed to be A-stable. Therefore, these methods are qualified to deal with stiff-problems [23] and are cost-efficient [19] compared to other methods.

Hybrid block methods have recently been used to solve non-linear parabolic PDEs in [2, 3]. The behavior of such methods has not been studied with mixed derivatives yet. Furthermore, to study the effect of the proposed algorithm, the results obtained were compared with exact solutions and gave better accuracy using a considerably small number of grid points in comparison to existing methods in the literature.

Table 1 Values of \({\mathbb{T}\mathbb{B}}_l(x)\) and its derivatives at the nodal points

2 Description of the numerical algorithm

2.1 A DQM based on modified cubic trigonometric B-splines

Consider the discretization of the space domain, \(a=x_0<x_1\dots <x_N= b\), into \(N+1\) equidistant nodes with step size \(h=x_{l+1}-x_l\), \(l=0,1,\dots ,N-1\). The cubic trigonometric B-splines \({\mathbb{T}\mathbb{B}}_l(x)\) at the nodes \(x_l\), \(l=-1,0,\dots ,N+1\) are defined as [25]

$$\begin{aligned} {\mathbb{T}\mathbb{B}}_l(x)=\frac{1}{\mu } {\left\{ \begin{array}{ll} \phi ^3(x_l) &{} x\in [x_{l},x_{l+1}),\\ \phi (x_l)(\phi (x_l)\psi (x_{l+2})+\psi (x_{l+3})\phi (x_{l+1}))+\\ \psi (x_{l+4})\phi ^2(x_{l+1}) &{} x\in [x_{l+1},x_{l+2}),\\ \psi (x_{l+4})(\phi (x_{l+1})\psi (x_{l+3})+\psi (x_{l+4})\phi (x_{l+2}))+\\ \phi (x_{l})\psi ^2(x_{l+3})&{} x\in [x_{l+2},x_{l+3}),\\ \psi ^3(x_{l+4}) &{} x\in [x_{l+3},x_{l+4}),\\ 0 &{} \text {otherwise},\\ \end{array}\right. } \end{aligned}$$

where \( \psi (x_l)=\sin (\frac{x_l-x}{2}) \), \( \phi (x_l)=\sin (\frac{x-x_l}{2}) \), \( \mu =\sin (\frac{h}{2})\sin (h)\sin (\frac{3h}{2}) \). The B-spline functions \(\{{\mathbb{T}\mathbb{B}}_{-1}\),\({\mathbb{T}\mathbb{B}}_{0}\),...,\({\mathbb{T}\mathbb{B}}_{N+1}\}\) form a basis over the space domain [a,b]. Table 1 lists the values of function \({\mathbb{T}\mathbb{B}}_l\) and its derivatives at the nodal points, where the components \(d_i,~i=1,2,\dots ,6\) are defined as

$$\begin{aligned} d_1{} & {} = \frac{\sin ^2(\frac{h}{2})}{\sin (h)\sin \left( \frac{3h}{2}\right) },~d_2=\frac{2}{1+2\cos (h)}, \\ d_3{} & {} = \frac{-3}{4\sin \left( \frac{3h}{2}\right) },~d_4=\frac{3}{4\sin \left( \frac{3h}{2}\right) }, \\ d_5{} & {} = \frac{3(1+3\cos (h))}{16\sin ^2\left( \frac{h}{2}\right) \left( 2\cos \left( \frac{h}{2}\right) +\cos \left( \frac{3h}{2}\right) \right) },~d_6=\frac{-3\cos ^2\left( \frac{3h}{2}\right) }{\sin ^2\left( \frac{3h}{2}\right) (2+4\cos (h))}. \end{aligned}$$

Further, cubic \({\mathbb{T}\mathbb{B}}\)-basis functions are modified as [25]

$$\begin{aligned} \mathbb {MTB}_{l}(x)=\left\{ \begin{aligned}&{\mathbb{T}\mathbb{B}}_0(x)+2{\mathbb{T}\mathbb{B}}_{-1}(x)\quad l=0\\&{\mathbb{T}\mathbb{B}}_1(x)-{\mathbb{T}\mathbb{B}}_{-1}(x) \qquad l=1\\&{\mathbb{T}\mathbb{B}}_l(x) \qquad \qquad l=2,3,\dots ,N-2\\&{\mathbb{T}\mathbb{B}}_{N-1}(x)-{\mathbb{T}\mathbb{B}}_{N+1}(x)\quad l=N-1\\&{\mathbb{T}\mathbb{B}}_{N}(x)+2{\mathbb{T}\mathbb{B}}_{N+1}(x) \quad l=N,\\ \end{aligned} \right. \end{aligned}$$
(2)

in the domain [ab], where \(\{\mathbb {MTB}_0\), \(\mathbb {MTB}_1\),...,\(\mathbb {MTB}_N\}\) constitutes a basis over the domain [ab].

Now, assuming that the function u(xt) is sufficiently smooth on its entire solution domain, the approximate values of the derivatives with respect to x at \(x_i\) can be approximated by

$$\begin{aligned} u_x^{(q)}(x_i,t)=\frac{\partial ^q u(x_i,t)}{\partial x^q}=\sum _{j=0}^{N}a_{ij}^{(q)}u(x_j,t),\text {for }q=1,2, \end{aligned}$$
(3)

where q denotes the order of the derivative and \(a_{ij}^{(q)}\) represent the weighting coefficients for the q-th order derivative.

2.2 Evaluation of weighting coefficients

To determine the weighting coefficients, consider the \(\mathbb {MTB}\)s as the test functions in the DQM Eq. (3) using \(q=1\) for the approximation of first order derivatives, which gives

$$\begin{aligned} \mathbb {MTB}_l'(x_i)=\sum _{j=0}^{N}a_{i j}^{(1)}\mathbb {MTB}_l(x_j), \text { for }l=0,1,\dots ,N\text { ; } i=0,1,\dots ,N. \end{aligned}$$
(4)

This results in an algebraic system of equations that can be written in matrix form as

$$\begin{aligned} MA=S, \end{aligned}$$

where the m-th column of A is \(A_m=[a_{m-1\,0}^{(1)},a_{m-1\,1}^{(1)},\dots ,a_{m-1\,N}^{(1)}]^T,\quad \text { for } \quad m=1,2,\dots ,N+1,\)

$$\begin{aligned}M=\begin{bmatrix} d_2+2d_1&{}d_1&{}0&{}&{}&{}\\ 0&{}d_2&{}d_1&{}0&{}&{}\\ 0&{}d_1&{}d_2&{}d_1&{}&{}\\ &{}&{}..&{}..&{}..&{}\\ &{}&{}..&{}..&{}..&{}\\ &{}&{}&{}d_1&{}d_2&{}0\\ &{}&{}&{}0&{}d_1&{}d_2+2d_1\\ \end{bmatrix}, \end{aligned}$$

and the columns of S are

$$\begin{aligned} S_1= & {} [2d_4,d_3-d_4,0,\dots ,0]^T,\\ S_2= & {} [d_3,0,d_4,0,\dots ,0]^T,\\ S_3= & {} [0,d_3,0,d_4,0,\dots ,0]^T,\\{} & {} \quad \dots \\{} & {} \quad \dots \\ S_{N+1}= & {} [0,\dots ,0,d_4-d_3,2d_3]^T. \end{aligned}$$

By using MATLAB 2017b, we solve each tridiagonal system \(MA_i=S_i\), \(i=1,\dots ,N+1\), thus obtaining the weighting coefficients \(\{a_{i1}^{(1)}\), \(a_{i2}^{(1)}\),...,\(a_{iN+1}^{(1)}\}\) for \(i=1,2,\dots ,N+1\).

Now, considering Shu’s recurrence formula [21], the coefficients in (3) for approximating the second order derivatives can be evaluated as follows

$$\begin{aligned} \begin{aligned} a_{ij}^{(2)}&=2\Big [a_{ij}^{(1)}a_{ii}^{(1)}-\frac{a_{ij}^{(1)}}{x_i-x_j}\Big ],\text { for }i\ne j\\ a_{ii}^{(2)}&=-\sum _{j=1,i\ne j}^{N+1}a_{ij}^{(2)}.\\ \end{aligned} \end{aligned}$$
(5)

Hence, we have obtained all weighting coefficients and using them, approximations to the partial derivatives can be obtained using the formula in (3).

Note that the Hunter–Saxton Eq. (1) can also be written as

$$\begin{aligned} u_{xt}+uu_{xx}+\frac{1}{2}u_x^2=0,~ x\in [a,b],~ t\ge 0, \end{aligned}$$
(6a)

with boundary conditions

$$\begin{aligned} u(a,t)=g_0(t), ~~u(b,t)=g_1(t),~ t\ge 0, \end{aligned}$$
(6b)

and initial condition

$$\begin{aligned} u(x,0)=v_0(x),~ a\le x\le b. \end{aligned}$$
(6c)

Initially, the DQM is applied to the Hunter–Saxton Eq. (6) using the approximations given in equation (3). This transforms the partial differential Eq. into an initial value problem system (IVP) given by:

$$\begin{aligned} \begin{aligned} \sum _{j=0}^{N}a_{i j}^{(1)}\frac{\text{ d }u_{j}}{\text{ d }t} =&-u_i\left( \sum _{j=0}^{N}a_{i j}^{(2)}u_{j}\right) -\frac{1}{2}\left( \sum _{j=0}^{N}a_{i j}^{(1)}{u_{j}}\right) ^2, \end{aligned} \end{aligned}$$
(7)

for \(i=1,2,\dots ,N-1\) and, where the boundary conditions are incorporated through

$$\begin{aligned} \frac{\hbox {d}u_0}{\hbox {d}t}=\frac{\hbox {d}g_0(t)}{\hbox {d}t} \quad \text { and } \quad \frac{\hbox {d}u_N}{\hbox {d}t}=\frac{\hbox {d}g_1(t)}{\hbox {d}t}. \end{aligned}$$

To solve the obtained IVP system of ODEs, we will consider a block method, which is described in the next section.

2.3 Hybrid block method for the temporal variable

Here, we present the time-stepping scheme considered for the HS equation, which is a sixth-order hybrid block method. Using the concept of interpolation and collocation, an optimized one-step hybrid block method for solving a first order IVP of the form \(\{y'=f(t,y); y(t_0)=y_0\}\) has been derived in [23], which was proven to be convergent and A-stable. The four equations of the block method in [23] to be applied on an interval \([t_i,t_{i+1}],\,\,\text {with}\,\, k=t_{i+1}-t_i,\) are as follows:

$$\begin{aligned} y_{i+\mu _1}&=y_{i}+k\Bigg [\Bigg (\frac{83+29\sqrt{3}}{360(3+\sqrt{3})}\Bigg )f_i+\Bigg (\frac{171+63\sqrt{3}}{360(3+\sqrt{3})}\Bigg )f_{i+\mu _1}\nonumber \\ {}&\quad +\Bigg (\frac{32-64\sqrt{3}}{360(3+\sqrt{3})}\Bigg )f_{i+\mu _2}\nonumber \\ {}&\quad +\Bigg (\frac{81-27\sqrt{3}}{360(3+\sqrt{3})}\Bigg )f_{i+\mu _3}+\Bigg (\frac{-7-\sqrt{3}}{360(3+\sqrt{3})}\Bigg )f_{i+1}\Bigg ], \end{aligned}$$
(7a)
$$\begin{aligned} y_{i+\mu _2}&=y_{i}+k\Bigg [\frac{31}{480}f_i+\Bigg (\frac{72+45\sqrt{3}}{480}\Bigg )f_{i+\mu _1}+\frac{64}{480}f_{i+\mu _2}+\Bigg (\frac{72-45\sqrt{3}}{480}\Bigg )f_{i+\mu _3}\nonumber \\&\quad +\frac{1}{480}f_{i+1}\Bigg ], \end{aligned}$$
(7b)
$$\begin{aligned} y_{i+\mu _3}&=y_{i}+k\Bigg [\Bigg (\frac{83-29\sqrt{3}}{360(3-\sqrt{3})}\Bigg )f_i+\Bigg (\frac{81+27\sqrt{3}}{360(3-\sqrt{3})}\Bigg )f_{i+\mu _1}\nonumber \\ {}&\quad +\Bigg (\frac{32+64\sqrt{3}}{360(3-\sqrt{3})}\Bigg )f_{i+\mu _2}\nonumber \\ {}&\quad +\Bigg (\frac{171-63\sqrt{3}}{360(3-\sqrt{3})}\Bigg )f_{i+\mu _3}+\Bigg (\frac{-7+\sqrt{3}}{360(3-\sqrt{3})}\Bigg )f_{i+1}\Bigg ], \end{aligned}$$
(7c)
$$\begin{aligned} y_{i+1}&=y_{i}+k\Bigg [\frac{1}{15}f_i+\frac{3}{10}f_{i+\mu _1}+\frac{4}{15}f_{i+\mu _2}+\frac{3}{10}f_{i+\mu _3}+\frac{1}{15}f_{i+1}\Bigg ], \end{aligned}$$
(7d)

where \(\mu _1=\frac{3}{6}-\frac{\sqrt{3}}{6}\), \(\mu _2=\frac{1}{2}\) and \(\mu _3=\frac{3}{6}+\frac{\sqrt{3}}{6}.\)

The above method comprising four equations, is further applied to the system of ODEs (7) and the resulting system of equations on each iteration is solved using the “fsolve” function of the Matlab software. Figure 1 shows the flowchart for the algorithm DQM-OHB.

Fig. 1
figure 1

Flowchart for DQM-OHB

3 Stability analysis

The hybrid block method in [23] is convergent and A-stable. If the system of ODEs obtained after the use of the DQM is stable, then the algorithm DQM-OHB will be unconditionally stable. In order to prove the stability of the non-linear system (7), linearize the non-linear terms by assuming u to be locally constant [1]. Therefore, we get the following linear system of equations

$$\begin{aligned} \begin{aligned} \sum _{j=0}^{N}a_{i j}^{(1)}\frac{\text{ d }u_{j}}{\text{ d }t} =&-u_{eq}\left( \sum _{j=0}^{N}a_{i j}^{(2)}u_{j}\right) ,~i=1,\dots ,N-1, \end{aligned} \end{aligned}$$
(8)

Now, rewriting it in matrix form, one gets

$$\begin{aligned} KU'=LU+F, \end{aligned}$$

where

$$\begin{aligned} K=\begin{bmatrix} 0&{}{}0&{}{}\dots &{}{}0\\ a^{(1)}_{20}&{}{}a^{(1)}_{21}&{}{}\dots &{}{}a^{(1)}_{2 N}\\ \dots &{}{}\dots &{}{}\dots &{}{}\dots \\ \dots &{}{}\dots &{}{}\dots &{}{}\dots \\ a^{(1)}_{N-1\,0}&{}{}a^{(1)}_{N-1\,1}&{}{}\dots &{}{}a^{(1)}_{N-1\, N}\\ 0&{}{}0&{}{}\dots &{}{}0\\ \end{bmatrix}, \qquad \begin{aligned} L=-u_{eq}\begin{bmatrix} 1&{}{}0&{}{}\dots &{}{}0\\ a^{(2)}_{20}&{}{}a^{(2)}_{21}&{}{}\dots &{}{}a^{(2)}_{2 N}\\ \dots &{}{}\dots &{}{}\dots &{}{}\dots \\ \dots &{}{}\dots &{}{}\dots &{}{}\dots \\ a^{(2)}_{N-1\,0}&{}{}a^{(2)}_{N-1\,1}&{}{}\dots &{}{}a^{(2)}_{N-1\, N}\\ 0&{}{}0&{}{}\dots &{}{}1\\ \end{bmatrix}, \end{aligned} \end{aligned}$$

\(U=[u_0,u_1,\dots ,u_N]^T,~U'=\left[ \frac{\hbox {d}u_0}{\hbox {d}t},\frac{\hbox {d}u_1}{\hbox {d}t},\dots ,\frac{\hbox {d}u_N}{\hbox {d}t}\right] \) and F consists of the non-homogeneous part, which is related to the boundary conditions. If the real part of all the eigenvalues of the coefficient matrix have negative values then the system of ODEs is stable. We have plotted the eigenvalues of the coefficient matrix \((K)^{-1}L\) of the linear system (8) for different values of N in Figure 2. Since all the eigenvalues have negative real part, this implies that the linearized system of ODEs is stable. As there is no restriction concerning the grid size, therefore, the algorithm DQM-OHB is unconditionally stable.

Fig. 2
figure 2

Eigenvalues of the coefficient matrix for different values of N

4 Numerical results

In this section, three test problems have been considered to validate the efficiency of the presented method. The numerical results were obtained using Matlab 2017b on a personal computer with Intel Core i5-4210U processor at 2.40 GHz. For error determination, the following formula is used:

$$\begin{aligned} L_{\infty }=\max _{i}|u^{exact}_i-u^{numerical}_i|, \end{aligned}$$

where \(u^{exact}_i\) and \(u^{numerical}_i\) refer to the exact and approximate solutions evaluated at \((x_i,t)\) where t will specified on each case. The formula to calculate the approximate order of convergence in terms of the \(L_{\infty }\) errors with respect to time is given below:

$$\begin{aligned} AOC= \frac{\log _{10}[L_{\infty }(k_i)/L_{\infty }(k_{i+1})]}{\log _{10}[k_i/k_{i+1}]} , \end{aligned}$$

where \(k_i, k_{i+1}\) are two temporal step sizes.

Test problem 1 Consider the exact solution for the Hunter–Saxton Eq. (6) as follows:

$$\begin{aligned} u(x,t)=\frac{4(x-1)-t}{2(t - 2)},~x\in [0,1],~t\ge 0. \end{aligned}$$

By extracting the initial condition and boundary conditions, the problem is solved using DQM-OHB taking \(N=79\). Table 2 lists the absolute error at \(t=1\) taking \(k=0.1\). The approximate orders of convergence are given in Table 3. We can see that the orders of convergence are close to six, as expected. The 3D-plot of the obtained numerical solution is shown in Fig. 3.

Table 2 Absolute errors for test problem 1 at \(t=1\) using \(N=79\)
Table 3 Time convergence rate of the \(L_{\infty }\) error for problem 1 at \(t=1\) using \(N=79\)
Fig. 3
figure 3

3-D numerical solution of problem 1 with \(N=79\) and \(k=0.1\)

Test problem 2 We assume the following initial condition for Eq. (6):

$$\begin{aligned} u(x,0)=2x,~x\in [0,1], \end{aligned}$$

and boundary conditions to be

$$\begin{aligned} u(0,t)=0,~~u(1,t)=\frac{2}{1+t}. \end{aligned}$$

Its exact solution is as follows:

$$\begin{aligned} u(x,t)=\frac{2x}{1+t},~x\in [0,1],~t\ge 0. \end{aligned}$$

Comparison of the results with the numerical methods in [4, 12] and that of the algorithm DQM-OHB for \(t=0.1\) is shown in Table 4 considering \(N=128\) taking five time-steps. The results show the advantage of higher accuracy of DQM over other collocation methods. Table 5 displays the absolute errors for \(t=0.01\) taking five time-steps and Table 6 shows the results for \(t=0.001\) taking one time-step. These results demonstrate the efficiency and accuracy of the proposed algorithm over existing ones. Figure 5 represents a 3-D plot generated by DQM-OHB by taking \(N=128\) and \(k=0.1\) up to time \(t=1\). Convergence analysis performed for DQM-OHB is shown in Fig. 4 for different number of steps. Table 7 shows \(L_{\infty }\) errors computed for larger values of t.

Table 4 Absolute errors for problem 2 at \(t=0.1\)
Table 5 Absolute errors for problem 2 at \(t=0.01\)
Table 6 Absolute errors for problem 2 at \(t=0.001\)
Fig. 4
figure 4

Convergence of DQM-OHB for problem 2 at \(t=0.1\)

Fig. 5
figure 5

3-D numerical solution of problem 2 by DQM-OHB with \(N=128\) and \(k=0.1\)

Table 7 \(L_{\infty }\) errors for test problem 2 at different times t using \(N=128\)
Table 8 Absolute errors for test problem 3 at \(t=0.1\) using \(N=127\)
Table 9 Absolute errors for test problem 3 at \(t=0.01\) using \(N=127\)

Test problem 3 Consider the Eq. (6), where \(x\in [1,2]\) and assuming the initial condition as

$$\begin{aligned} u(x,0)=(2x)^{\frac{2}{3}}+2x. \end{aligned}$$

Boundary conditions are extracted from the exact solution

$$\begin{aligned} u(x,t)=\frac{(2x(1+t))^{\frac{2}{3}}+2x(1+t)}{(1+t)^2}. \end{aligned}$$

In Table 8, absolute errors for \(t=0.1\) are tabulated by taking \(k=0.1\) and \(N=127\) for DQM-OHB. The absolute errors calculated for \(t=0.01\) and \(t=0.001\) are given in Table 9 and Table 10, respectively. Each of the tables lists the results obtained in a single time-step.

5 Conclusion

Numerical experimentations of the presented algorithm for the Hunter–Saxton equation highlight the efficiency of DQM over collocation methods performed so far in the literature. The order of convergence with respect to time for DQM-OHB is six and unconditional stability is proved. To solve non-linear mixed derivative PDEs, the proposed method does not require linearization approaches or any initial guesses and hence, is a direct method. DQM-OHB can obtain higher temporal as well as spatial resolution. This work extends the scope of hybrid block methods in the field of partial differential equations.

Table 10 Absolute errors for problem 3 at \(t=0.001\) using \(N=127\)