1 Introduction

Fractional calculus [1] is developing fast and its various applications are extensively used in many fields of science and engineering. It has been applied to chaotic systems [2, 3] and optimal control problems [4]. In [5], the authors derived the fractional Euler–Lagrange equation in terms of the Caputo fractional derivatives. Kumar et al. [6] analyzed Fornberg–Whitham equation pertaining to a fractional derivative with Mittag–Leffler type kernel. The authors of [7] investigated a time-fractional modified Kawahara equation through a fractional derivative with exponential kernel. In [8] Singh et al. presented a fractional epidemiological model and solved the solution of the problem by using an iterative method.

Fractional differential equation [9] is used to describe mathematical phenomena of many areas, such as rheology, damping method, signal processing, control theory, polymers, viscoelastic materials, and so on. Many researchers [10, 11] focus on the numerical treatments of fractional differential equation, such as homotopy analysis transform method [12, 13], iterative reproducing kernel Hilbert space method [14], artificial neural network approach [15], variational iteration method and its modification [16], Wavelet method [1719], Bernstein polynomials [20], and fractional-order Legendre functions [21]. The authors of [22] researched space–time fractional Rosenou–Haynam equation. In [23] Baleanu et al. solved the time fractional third-order evolution (TOE) equation with Riemann–Liouville (RL) derivative.

Since multi-order fractional differential equations are applied in many fields, many scientists have begun to study the properties and numerical solutions of equations. Multi-order fractional differential equation [24] is one of the most important types of fractional differential equations. Authors of [25, 26] investigated the existence, uniqueness, convergence of the solution for multi-order fractional differential equation. Because there is no exact solution, most different numerical methods, such as stable fractional Chebyshev differentiation matrix [27], fractional-order operational method [28], spectral collocation methods [29], and so on, have been used to investigate the approximate solutions of multi-order fractional differential equation. The authors of [30] only researched the convergence effect of numerical solutions and exact solutions of equations. There is little literature with shifted Chebyshev polynomials to solve multi-order fractional differential equation and research error correction and convergence. In this paper, the numerical solutions of a class of multi-order fractional differential equations with error correction and convergence analysis are investigated. According to the function approximation theory and fractional differential operator matrix, the equation is transformed into algebraic equations. The correction solutions of multi-order fractional differential equation are investigated and the convergence of the shifted Chebyshev polynomials approximation function is analyzed. We do the correction for the numerical solution of low precision and obtain the absolute error of the correction solution, so that the accuracy of the numerical solution is improved.

In general, multi-order fractional differential equation is expressed as follows:

$${D^{\alpha}}u(x) = \sum_{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}}u(x)} + f(x),\quad x \in [ {0,1} ] $$

with the initial conditions

$${u^{ ( p )}} ( 0 ) = {d_{p}},\quad p = 0,1, \ldots ,n - 1, $$

where \(n-1<\alpha \le n\), the coefficient \({{y}_{i}}\) (\(i=0,1,\ldots ,k \)) is constant, and \(0<{{\beta }_{0}}<\cdots <{{\beta }_{k}}<\alpha \), \(f ( x )\) is a known function.

The rest of the paper is organized as follows: Sect. 2 introduces the definition of Caputo fractional derivatives and shifted Chebyshev polynomials. In Sect. 3, the function approximation theory is introduced. In Sect. 4, the process of error correction for multi-order fractional differential equation is introduced and the convergence of the shifted Chebyshev polynomials approximation function is analyzed. Section 5 deduces the fractional differential operator matrix based on shifted Chebyshev polynomials. Section 6 reduces the problem to a set of algebraic equations. In Sect. 7, the proposed method is applied to two examples. Conclusion is given in Sect. 8.

2 Preliminary knowledge

In this section, we give the definition of the Caputo fractional derivatives and shifted Chebyshev polynomials in [31].

2.1 The Caputo fractional derivatives

Definition 1

The Caputo fractional derivative operator \(D{}_{x}^{\alpha}\) of order α is defined in the following form:

$$ {}_{a}^{C}D{}_{x}^{\alpha}f ( x ) = \frac{1}{{\Gamma ( {m - \alpha } )}} \int_{ a}^{ x} {{{ ( {x - T} )}^{m - \alpha - 1}} {f^{ ( m )}} ( T )} \,dT, \quad \alpha > 0, $$
(1)

where \(m-1\le \alpha < m\), \(x> 0\).

For Caputo’s derivatives, we have

$$ {}_{a}^{C}D{}_{x}^{\alpha}C = 0, $$
(2)

where C is a constant.

$$ {}_{a}^{C}D{}_{x}^{\alpha}{x^{m}} = \frac{{\Gamma ( {m + 1} )}}{{\Gamma ( {m + 1 - \alpha } )}}{x^{m - \alpha }},\quad m \in {N_{1}},m \ge \lceil \alpha \rceil, $$
(3)

where \({N_{1}} = \{ {0,1,2, \ldots } \}\), we use the ceiling function \(\lceil \alpha \rceil\) to denote the smallest integer greater than or equal to α.

2.2 Shifted Chebyshev polynomials

The well-known Chebyshev polynomials can be defined on the interval \(x \in [-1,1]\) and can be determined with the following recurrence formula:

$$ \textstyle\begin{cases} {P_{0}^{*} ( {{x^{*} }} ) = 1,\qquad P_{1}^{*} ( {{x^{*} }} ) = {x^{*} }} \\ P_{i + 1}^{*} ( {{x^{*} }} ) = 2{x^{*} }P_{i}^{*} ( {{x^{*} }} ) - P_{i - 1}^{*} ( {{x^{*} }} ),\quad i = 1,2,3, \ldots . \end{cases} $$
(4)

In order to obtain these polynomials on the interval \([0,1]\), we introduce the change of variable \({x^{*} } = 2x - 1\) and substitute \({x^{*} }\) to \(P_{i}^{*} ( {{x^{*} }} ),i = 0,1,2, \ldots \) . The shifted Chebyshev polynomials can be defined as

$$ \textstyle\begin{cases} {P_{0}} ( x ) = 1,\qquad {P_{1}} ( x ) = 2x - 1, \\ {P_{i + 1}} ( x ) = 2 ( {2x - 1} ){P_{i}} ( x ) - {P_{i - 1}} (x ), \quad i = 1,2,3, \ldots . \end{cases} $$
(5)

The shifted Chebyshev polynomials \({P_{n}} ( x )\) of degree n can be given by

$$ {{P}_{n}} ( x )=\sum_{i=0}^{n}{{{ ( -1 )}^{n-i}} {{2}^{2i}}\frac{n ( n+i-1 )!}{ ( n-i )! ( 2i )!}{{x}^{i}}}, $$
(6)

the weight function is

$$ {w_{s}} ( x ) = \frac{1}{ {\sqrt {x- {x^{2}}} }}. $$
(7)

Combining (7) the orthogonality condition is

$$ \int_{0}^{1} {{P_{n}} ( x ){P_{m}} ( x )} \frac{{{{d}}x}}{ {\sqrt {x - {x^{2}}} }}\textstyle\begin{cases} 0 , & n \ne m, \\ \pi , & n = m = 0, \\ \pi /2 , & n = m \ne 0 . \end{cases} $$
(8)

We can define the shifted Chebyshev vector as follows:

$$ \Phi ( x ) = { \bigl[ {{P_{0}} ( x ),{P_{1}} ( x ), \ldots, {P_{n}} (x ) } \bigr]^{T}}, $$
(9)

the vector is represented as a matrix form as follows:

$$ \Phi ( x ) = A{T_{n}} ( x ), $$
(10)

where

$$A = \left [ \begin{matrix} 1&0& \cdots &0 \\ {{4^{0}}\frac{{1 ( {1 + 0 - 1} )!}}{{ ( {1 - 0} )! ( 0 )!}}}&{{4^{1}}\frac{{1 ( {1 + 1 - 1} )!}}{{ ( {1 - 1} )! ( 2 )!}}}& \cdots &0 \\ \vdots & \vdots & \ddots & \vdots \\ {{4^{0}}\frac{{n ( {n + 0 - 1} )!}}{{ ( {n - 0} )! ( 0 )!}}}&{{4^{1}}\frac{{n ( {n + 1 - 1} )!}}{{ ( {n - 1} )! ( 2 )!}}}& \cdots &{{4^{n}}\frac{{n ( {n + n - 1} )!}}{{ ( {n - n} )! ( {2n} )!}}} \end{matrix} \right ]. $$

3 Function approximation

The function \(u ( x )\) is a continuous function which can be expanded in shifted Chebyshev polynomials:

$$u ( x ) = \sum_{i = 0}^{\infty}{{c_{i}} {P_{i}} ( x )} . $$

A finite expansion in the first \((n+1)\)-term shifted Chebyshev polynomials is

$$ u ( x ) \cong \sum_{i = 0}^{n} {{c_{i}} {P_{i}} ( x ) = {C^{T}}\Phi ( x )}, $$
(11)

where the shifted Chebyshev vector \(\Phi ( x )\) and the shifted Chebyshev coefficient vector C are given by

$$\begin{aligned} &C = { [ {{c_{0}},{c_{1}}, \ldots, {c_{n}}} ]^{T}}, \\ &\Phi ( x ) = { \bigl[ {{P_{0}} ( x ),{P_{1}} ( x ), \ldots, {P_{n}} ( x ) } \bigr]^{T}}. \end{aligned}$$

The coefficient vector C can be determined by the inner product

$$C = {Q^{ - 1}} \bigl\langle {u,\Phi ( x )} \bigr\rangle , $$

where the inner product is defined as

$$\bigl\langle {f,\Phi(x)} \bigr\rangle = \int_{0}^{{x_{f}}} f(x)\Phi(x)\,\mathrm{d} x, $$

where Q is

$$\begin{aligned} \begin{aligned} Q &= \int_{0}^{{x_{f}}} \Phi ( x ){\Phi ^{T}} ( x )\, \mathrm{d} x \\ & = \int_{0}^{{x_{f}}} \bigl( {AT ( {{x}} )} \bigr){{ \bigl( {AT ( {{x}} )} \bigr)}^{T}}\,\mathrm{d} x \\ & = A \biggl( \int_{0}^{{x_{f}}} {T ( {{x}} ){T^{T}} ( {{x}} ) \,\mathrm{d} x} \biggr){A^{T}} \\ & = AH{A^{T}}, \end{aligned} \end{aligned}$$

where \({{x}_{f}=1}\), H is

$$H = \left [ \begin{matrix} 1 & {\frac{1}{2}} & \cdots & {\frac{1}{{n + 1}}} \\ {\frac{1}{2}} & {\frac{1}{3}} & \cdots & {\frac{1}{{n + 2}}} \\ \vdots & \vdots & \ddots & \vdots \\ {\frac{1}{{n + 1}}} & {\frac{1}{{n + 2}}} & \cdots & {\frac{1}{{2n + 2}}} \end{matrix} \right ]. $$

4 Error correction and convergence analysis

In this section, we do error correction for multi-order fractional differential equation and introduce convergence of shifted Chebyshev polynomials. The order of convergence is n.

4.1 Error correction

We solve multi-order fractional differential equation via the shifted Chebyshev polynomials. If the absolute error between the numerical solution and exact solution is larger, according to the correct solution and the exact solution, we can get the absolute error of correct solution. Error correction improves the precision of numerical solution.

We assume that the numerical solution of multi-order fractional differential equation is \({u_{M}} ( x )\), the exact solution is \(u ( x )\), the error between the numerical solution and the exact solution is

$$ {e_{M}} ( x ) = u ( x ) - {u_{M}} ( x ), $$
(12)

where \({e_{M}} ( x )\) is an error function.

Substituting the numerical solution of equation \({u_{M}} ( x )\) in multi-order fractional differential equation, we can get

$$ {D^{\alpha}} {u_{M}} ( x ) \approx \sum _{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}} {u_{M}} ( x )} + f ( x ). $$
(13)

A residual function \({w_{M}} ( x )\) is added to the right-hand side of the multi-order fractional differential equation, (13) can be transformed into

$$ {D^{\alpha}} {u_{M}} ( x ) = \sum _{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}} {u_{M}} ( x )} + f ( x ) + {w_{M}} ( x ). $$
(14)

Then we can get the equation

$$ Q \bigl[ {{u_{M}} ( x )} \bigr] = f ( x ) + {w_{M}} ( x ), $$
(15)

where

$$ Q \bigl[ {{u_{M}} ( x )} \bigr] = {D^{\alpha}} {u_{M}} ( x ) - \sum_{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}} {u_{M}} ( x )}. $$
(16)

We assume that ϕ is the unknown variables in the following equation:

$$ Q [ \phi ] = {D^{\alpha}}\phi - \sum_{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}}\phi }, $$
(17)

when \(\phi = u ( x )\) and \(\phi = {e_{M}} ( x )\), we have

$$\begin{aligned} &Q \bigl[ {u ( x )} \bigr] = {D^{\alpha}}u ( x ) - \sum _{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}}u ( x )} = f ( x ), \end{aligned}$$
(18)
$$\begin{aligned} &Q \bigl[ {{e_{M}} ( x )} \bigr] = {D^{\alpha}} {e_{M}} ( x ) - \sum_{i = 0}^{k} {{y_{i}} {{{D}}^{{\beta _{i}}}} {e_{M}} ( x )}. \end{aligned}$$
(19)

Combining (12) and (15)–(19), we can obtain

$$ Q \bigl[ {{e_{M}} ( x )} \bigr] = Q \bigl[ {u ( x )} \bigr] - Q \bigl[ {{u_{M}} ( x )} \bigr] = - {w_{M}} ( x ). $$
(20)

According to (19) and (20), we can get

$$ {D^{\alpha}} {e_{M}} ( x ) - \sum _{i = 0}^{k} {{y_{i}} {{\mathrm{D}}^{{\beta _{i}}}} {e_{M}} ( x )} = - {w_{M}} ( x ). $$
(21)

We name (21) multi-order fractional differential equation of error function. \({e_{M}} ( x )\) is the exact solution, \(e_{\omega}^{*} ( x )\) is the numerical solution, namely the approximate error function.

According to the numerical solution of multi-order fractional differential equation \({u_{M}} ( x )\) and the numerical solution of multi-order fractional differential equation of error function \(e_{\omega}^{*} ( x )\), correct solution \({u^{*} } ( x )\) can be obtained:

$$ {u^{*} } ( x ) = {u_{M}} ( x ) + e_{\omega}^{*} ( x ). $$
(22)

Combining (22) with the exact solution \(u ( x )\), we can get the absolute error of correct solution:

$$ \bigl\vert {{e_{r}} ( x )} \bigr\vert = \bigl\vert {u ( x ) - {u^{*} } ( x )} \bigr\vert . $$
(23)

The error \({e_{r}} ( x )\) between the exact solution and the numerical solution of multi-order fractional differential equation of error function is

$$ {e_{r}} ( x ) = {e_{M}} ( x ) - e_{\omega}^{*} ( x ) = u ( x ) - {u_{M}} ( x ) - e_{\omega}^{*} ( x ) $$
(24)

\({e_{r}} ( x )\) is a correction error function.

In the same way, according to the shifted Chebyshev polynomials function approximation theory, correct solution \({u^{*} } ( x )\) can be translated into a matrix form as follows:

$$ {u^{*}} ( x ) \cong \sum_{i = 0}^{m} {{c^{*} }_{i}{P_{i}} ( x ) = {{ \bigl( {{C^{*} }} \bigr)}^{T}} {\Phi ^{*}} ( x )}, $$
(25)

where \(( {n < m\in {N^{*}}} )\)

$$\begin{aligned} &{C^{*} } = { \bigl[ {c_{0}^{*} ,c_{1}^{*} , \ldots C_{m}^{*}} \bigr]^{T}}, \\ &{\Phi ^{*}} ( x ) = { \bigl[ {{P_{0}} ( x ),{P_{1}} ( x ), \ldots, {P_{m}} ( x ) } \bigr]^{T}}. \end{aligned}$$

4.2 Convergence analysis

Definition 2

In the interval \([ {a,b} ]\), we can define arbitrary function convergence coefficient of form as follows:

$$\omega ( {f,\delta } )=\sup_{x,y \in [ {a,b} ], \vert {x - y} \vert \le \delta } \bigl\vert {f ( x ) - f ( y )} \bigr\vert . $$

Theorem 1

In \([ {a,b} ]\), the function is uniformly convergent if and only if \(\lim _{\delta \to 0} \omega ( {f,\delta } )=0\).

Theorem 2

If \(f ( x )\) is bounded on \([ {0,1} ]\), then there is

$${ \bigl\Vert {f - q ( {f,n} )} \bigr\Vert _{ \infty }} \le \frac{3}{2}\omega \biggl( {f,\frac{1}{{\sqrt {n} }}} \biggr), $$

where

$$q ( {f,n} ) = \sum_{k = 0}^{n} {f \biggl( { \frac{k}{n}} \biggr){P_{k}}}, $$

and

$${ \Vert f \Vert _{ \infty }} = \sup \bigl\vert {f ( x )} \bigr\vert . $$

Theorem 3

When \(f ( x )\) satisfies α order Lipschitz condition in \([ {0,1} ]\), then there is

$$\bigl\Vert {f - q ( {f,n} )} \bigr\Vert { _{\infty}} \le \frac{3}{2}k{m^{ - \frac{\alpha }{2}}}, $$

where k is a Lipschitz constant.

Theorem 4

If \(f ( x )\) is bounded on \([ {0,1} ]\), \(Y = \operatorname{Span}\{ {P_{0}},{P_{1}},{P_{2}}, \ldots ,{P_{n}}\}\). If \({C^{T}}\Phi ( x )\) is the best approximation of f in the linear space Y, then there is

$${ \bigl\Vert {f - {c^{T}}\Phi } \bigr\Vert _{ 2}} \le \frac{3}{2}\omega \biggl( {f,\frac{1}{{\sqrt {n} }}} \biggr). $$

It is confirmed that shifted Chebyshev polynomials approximation converges to f; when n converges to ∞, approximation consistently converges to f.

5 Fractional differential operator matrix

According to (10), the differential operator can be derived as follows:

$$\begin{aligned} {\mathrm{D}}\Phi ( x ) &= D \bigl( {A{T_{n}} ( x )} \bigr) = A{ \mathrm{D}} \bigl( {{T_{n}} ( x )} \bigr) \\ & = A{\mathrm{D}}\left [ \begin{matrix} 1\\ x\\ \vdots \\ {{x^{n}}} \end{matrix} \right ] = A{\mathrm{D}}\left [ \begin{matrix} 0\\ 1\\ \vdots \\ {{x^{n - 1}}} \end{matrix} \right ] = A{Q_{(n + 1) \times n}}T_{n}^{*} ( x ). \end{aligned}$$

The above formula can be shown specifically as follows:

$$\begin{aligned} &{Q_{(n + 1) \times n}}= \left [ \begin{matrix} 0&0&0&0\\ 1&0& \cdots &0\\ 0&2& \cdots &0\\ \vdots & \vdots & \ddots & \vdots \\ 0&0& \cdots &n \end{matrix} \right ], \\ &T_{n}^{*} ( x )= {B^{*}}\Phi ( x ), \\ &{B^{*}}={\bigl[A_{[1]}^{ - 1},A_{[2]}^{ - 1}, \ldots, A_{[{\mathrm{n}}]}^{ - 1}\bigr]^{T}}, \end{aligned}$$

where \(A_{ [ \eta ]}^{-1}\) is line η of \({{A}^{ -1}}\), \(\eta ={1,2,\ldots,n}\).

So

$$ {\mathrm{D}}\Phi ( x ) = D \bigl( {A{T_{n}} ( x )} \bigr) = A{Q_{(n + 1) \times n}}T_{n}^{*} ( x ) = E\Phi ( x ). $$
(26)

First-order differential operator matrix is

$$ E = A{Q_{(n + 1) \times n}} {B^{*}}. $$
(27)

When \({\beta _{2}} \in [ {0,1} )\), combining (3) with (10), we can deduce

$$\begin{aligned} {\mathrm{D}}^{\beta _{2}} \Phi ( x ) &= {\mathrm{D}}^{\beta _{2}} \bigl( {A{T_{n}} ( x )} \bigr) = A{\mathrm{D}}^{\beta _{2}} {T_{n}} ( x ) \\ & = A{\mathrm{D}}^{\beta _{2}} \left[ \begin{matrix} 1\\ x\\ \vdots \\ {{x^{n}}} \end{matrix} \right] = A \left[ \begin{matrix} 0\\ {\frac{{\Gamma ( 2 )}}{{\Gamma ( {2 - {\beta _{2}}} )}}{x^{{-{{\beta _{2}}}}}}}\\ \vdots \\ {\frac{{\Gamma ( {n + 1} )}}{{\Gamma ( {n + 1 - {\beta _{2}}} )}}{x^{{-{{\beta _{2}}}}}}} \end{matrix} \right] \\ &= A \left[ \begin{matrix} 0&0&0& \cdots &0\\ 0&{\frac{{\Gamma ( 2 )}}{{\Gamma ( {2 - {\beta _{2}}} )}}{x^{{-{{\beta _{2}}}}}}}&0& \cdots &0\\ 0&0&{\frac{{\Gamma ( 3 )}}{{\Gamma ( {3 - {\beta _{2}}} )}}{x^{{-{{\beta _{2}}}}}}}& \cdots &0\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0&0&0&0&{\frac{{\Gamma ( {n + 1} )}}{{\Gamma ( {n + 1 - {\beta _{2}}} )}}{x^{{-{{{\beta _{2}}}}}}}} \end{matrix} \right] \left[ \begin{matrix} 1\\ x\\ \vdots \\ {{x^{n}}} \end{matrix} \right] \\ &= AN{A^{-1}}\Phi ( x ), \end{aligned}$$

where

$$N = \left[ \begin{matrix} 0&0&0& \cdots &0\\ 0&{\frac{{\Gamma ( 2 )}}{{\Gamma ( {2 - {\beta _{2}}} )}}{x^{{ - {{\beta _{2}}}}}}}&0& \cdots &0\\ 0&0&{\frac{{\Gamma ( 3 )}}{{\Gamma ( {3 - {\beta _{2}}} )}}{x^{{ - {{\beta _{2}}}}}}}& \cdots &0\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0&0&0&0&{\frac{{\Gamma ( {n + 1} )}}{{\Gamma ( {n + 1 - {\beta _{2}}} )}}{x^{{ - {{{\beta _{2}}}}}}}} \end{matrix} \right]. $$

So the fractional differential operator can be deduced

$$ {{\mathrm{D}}^{{\beta _{2}}}}\Phi ( x )=AN{A^{-1}}\Phi ( x ) = G\Phi ( x ). $$
(28)

Fractional differential operator matrix is

$$ G = AN{A^{-1}}. $$
(29)

6 The numerical algorithm

The multi-order fractional differential equation, which we study in this paper, can be expressed as follows:

$$\begin{aligned} {D^{\alpha}}u ( x ) = {}&{y_{0}} {{\mathrm{D}}^{{\beta _{0}}}}u ( x ) + {y_{1}} {{\mathrm{D}}^{{\beta _{1}}}}u ( x ) + {y_{2}} {{\mathrm{D}}^{{\beta _{2}}}}u ( x ) \\ &{}+ {y_{3}} {{\mathrm{D}}^{{\beta _{3}}}}u ( x ) + f ( x ),\quad x \in [ {0,1} ] \end{aligned}$$
(30)

with the initial conditions

$$ {u^{ ( 0 )}} ( 0 ) = {d_{0}},\qquad {u^{ ( 1 )}} ( 0 ) = {d_{1}}, $$
(31)

where \(\alpha = 2\), \(k = 3\), the coefficient \({y_{i}} ( {i = 0,1,2,3} )\) is constant, and \({\beta _{0}} = 0\), \({\beta _{1}} = 1\), \(0 < {\beta _{2}} < 1\), \(1 < {\beta _{3}} < 2\), \(f ( x )\) is a known function.

On the basis of (10), (11), (26), the item in equation can be converted into the matrix, we can deduce concretely them as follows:

$$\begin{aligned} &{\mathrm{D}}u ( x )\cong{\mathrm{D}} {C^{T}}\Phi ( x ) = {C^{T}}A{Q_{(n + 1) \times n}} {B^{*}}\Phi ( x ) = {C^{T}}E\Phi ( x ) , \end{aligned}$$
(32)
$$\begin{aligned} &{{\mathrm{D}}^{2}}u ( x )\cong{{\mathrm{D}}^{2}} {C^{T}}\Phi ( x ) = {C^{T}} {{\mathrm{D}}^{2}}\Phi ( x ) = {C^{T}} {{\mathrm{D}}^{2}} \bigl( {A{T_{n}} ( x )} \bigr) = {C^{T}}E{ ^{2}}\Phi ( x ). \end{aligned}$$
(33)

Then, the second-order differential operator matrix is

$$E { ^{2}} = {\bigl(A{Q_{(n + 1) \times n}} {B^{*}}\bigr)^{2}}. $$

When \({\beta _{2}} \in ( {0,1} )\), on the basis of (10), (11), (28), the item in equation can be converted into the matrix

$$ {{\mathrm{D}}^{{\beta _{2}}}}u ( x )\cong{{\mathrm{D}}^{{\beta _{2}}}} {C^{T}}\Phi ( x ) = {C^{T}} {{\mathrm{D}}^{{\beta _{2}}}}\Phi ( x ) = {C^{T}}AN{A^{-1}}\Phi ( x ) = {C^{T}}G\Phi ( x ). $$
(34)

When \({\beta _{3}} \in ( {1,2} ) \), \(( {{\beta _{2}} < {\beta _{3}}} )\), that is to say \({\beta _{2}} = {\beta _{3}} - 1 \in ( {0,1} )\), according to (10), (11), (26), (28), the item in equation can be converted into the matrix as follows:

$$\begin{aligned} {{\mathrm{D}}^{{\beta _{3}}}}u ( x )&\cong{{\mathrm{D}}^{{\beta _{3}}}} {C^{T}}\Phi ( x ) = {{\mathrm{D}}^{{\beta _{2}}}} \bigl( {D{C^{T}}\Phi ( x )} \bigr) = {C^{T}} {{\mathrm{D}}^{{\beta _{2}}}} \bigl( {E\Phi ( x )} \bigr) \\ &= {C^{T}}E {{\mathrm{D}}^{{\beta _{2}}}}\Phi ( x ) = {C^{T}}EAN{A^{-1}}\Phi ( x ) = {C^{T}}EG\Phi ( x ), \end{aligned}$$
(35)

where

$$ K = EAN{A^{-1}} = EG. $$
(36)

Combining (11) with (32)–(36), the equation can be converted into

$${C^{T}}E { ^{2}}\Phi ( x )={y_{0}} {C^{T}}\Phi ( x ) + {y_{1}} {C^{T}}E\Phi ( x ) + {y_{2}} {C^{T}}G\Phi ( x ) + {y_{3}} {C^{T}}K\Phi ( x ) + f ( x ). $$

Also, we substitute the correction solution into the original equation and translate the original equation into matrix as follows:

$$\begin{aligned} { \bigl( {{C^{*} }} \bigr)^{T}}E{ ^{2}} {\Phi ^{*}} ( x ) ={}& {y_{0}} { \bigl( {{C^{*} }} \bigr)^{T}} {\Phi ^{*}} ( x ) + {y_{1}} { \bigl( {{C^{*} }} \bigr)^{T}}E{\Phi ^{*}} ( x ) \\ &{} + {y_{2}} { \bigl( {{C^{*} }} \bigr)^{T}}G{\Phi ^{*}} ( x ) + {y_{3}} { \bigl( {{C^{*} }} \bigr)^{T}}K{\Phi ^{*}} ( x ) + f ( x ). \end{aligned}$$

By using the collocation method, the variables are discretized, the problem can be transferred to linear equations. Combining MATLAB software with least square method to solve the unknown coefficient, numerical solution of the problem can be obtained.

7 Numerical examples

In this section, two experiments prove that the proposed method is effective and feasible.

Example 1

Consider the following multi-order fractional differential equation:

$$\begin{aligned} {D^{\alpha}}u ( x ) ={}& {y_{0}} {{\mathrm{D}}^{{\beta _{0}}}}u ( x ) + {y_{1}} {{\mathrm{D}}^{{\beta _{1}}}}u ( x ) + {y_{2}} {{\mathrm{D}}^{{\beta _{2}}}}u ( x ) \\ &{}+ {y_{3}} {{\mathrm{D}}^{{\beta _{3}}}}u ( x ) + f ( x ),\quad x \in [ {0,1} ], \end{aligned}$$

with the initial conditions

$${u^{ ( 0 )}} ( 0 ) = {d_{0}},{u^{ ( 1 )}} ( 0 ) = {d_{1}}, $$

where \(\alpha = 2\), \({d_{0}} = {d_{1}} = 0\), the coefficient is \({y_{0}} = {y_{2}} = - 1\), \({y_{1}} = 2\), \({y_{3}} = 0\), and \({\beta _{0}} = 0\), \({\beta _{1}} = 1\), \({\beta _{2}} = \frac{1}{2} \in ( {0,1} )\), the known function is

$$f ( x ) = {x^{7}} + \frac{{2048}}{{429\sqrt {\pi}}}{x^{6.5}} - 14{x^{6}} + 42{x^{5}} - {x^{2}} - \frac{8}{{3\sqrt {\pi}}}{x^{1.5}} + 4x - 2 , $$

the exact solution is \(u ( x ) = {x^{7}} - {x^{2}}\).

When \(n = 4\), the discrete variable is \({x_{i}} = \frac{i}{5} - \frac{1}{{10}} ( {i = 1,2, \ldots ,5} )\), the numerical solution is \(u ( x ) = C_{1}^{T}\Phi ( x )\), the unknown coefficient can be obtained \({C_{1}}= [ 0.3602, 0.8710, 0.1714, 0.1750, 0.0924 ]^{T}\), the shifted Chebyshev polynomials of approximation function \(\Phi ( x )\) are

$$\Phi ( x ) = \left[ \begin{matrix} 1\\ { 2x - 1}\\ { 8{x^{2}} - 8x + 1}\\ {32{x^{3}} - 48{x^{2}} + 18x - 1 }\\ { 128{x^{4}} - 256{x^{3}} + 160{x^{2}} - 32x + 1} \end{matrix} \right]. $$

When \(n = 6\), the discrete variable is \({x_{i}} = \frac{i}{7} - \frac{1}{{14}} ( {i = 1,2, \ldots ,7} )\), the numerical solution is \(u ( x ) = C_{1}^{T}\Phi ( x )\), the unknown coefficient can be obtained \({C_{1}} = [ - 0.1528, - 0.1193, 0.1207, 0.1220, 0.0441, 0.0113, 0.0020 ]^{T}\), the shifted Chebyshev polynomials of approximation function \(\Phi ( x )\) are

$$\Phi ( x ) = \left[ \begin{matrix} 1\\ 2x - 1\\ {8{x^{2}} - 8x + 1}\\ {32{x^{3}} - 48{x^{2}} + 18x - 1}\\ {128{x^{4}} - 256{x^{3}} + 160{x^{2}} - 32x + 1}\\ {512{x^{5}} - 1280{x^{4}} + 1120{x^{3}} - 400{x^{2}} + 50x - 1}\\ { 2048{x^{6}} - 6144{x^{5}} + 6912{x^{4}} - 3584{x^{3}} + 840{x^{2}} - 72x + 1} \end{matrix} \right] . $$

When \(n = 7\), the discrete variable is \({x_{i}} = \frac{i}{8} - \frac{1}{{16}} ( {i = 1,2, \ldots ,8} )\), the numerical solution is \(u ( x ) = C_{1}^{T}\Phi ( x )\), the unknown coefficient can be obtained \({C_{1}} = [ - 0.1655, - 0.1334, 0.1194, 0.1222, 0.0444, 0.0111, 0.0017, 0.0001 ]^{T}\), the shifted Chebyshev polynomials of approximation function \(\Phi ( x )\) are

$$\Phi ( x ) = \left[ \begin{matrix} 1\\ {2x - 1}\\ { 8{x^{2}} - 8x + 1}\\ {32{x^{3}} - 48{x^{2}} + 18x - 1 }\\ {128{x^{4}} - 256{x^{3}} + 160{x^{2}} - 32x + 1}\\ { 512{x^{5}} - 1280{x^{4}} + 1120{x^{3}} - 400{x^{2}} + 50x - 1}\\ { 2048{x^{6}} - 6144{x^{5}} + 6912{x^{4}} - 3584{x^{3}} + 840{x^{2}} - 72x + 1}\\ {8192{x^{7}} - 28672{x^{6}} + 39424{x^{5}} - 26880{x^{4}} + 9408{x^{3}} - 1568{x^{2}} + 98x - 1} \end{matrix} \right] . $$

Compared with [30], Example 1 studies the approximation effect of numerical solution and exact solution, the absolute errors and the absolute error of correct solution. When \(n=4, 6, 7\), the absolute errors for equation in some match points between the numerical solution and the exact solution are shown in Fig. 1–Fig. 3 and Table 1. When \(n=6, 7, 8\), the numerical solution and exact solution are shown in Fig. 4–Fig. 6.

Figure 1
figure 1

The absolute error between the numerical solution and the exact solution with \(n=4\) for Example 1

Figure 2
figure 2

The absolute error between the numerical solution and the exact solution with \(n=6\) for Example 1

Figure 3
figure 3

The absolute error between the numerical solution and the exact solution with \(n=7\) for Example 1

Figure 4
figure 4

The numerical solution and the exact solution with \(n=6\) for Example 1

Figure 5
figure 5

The numerical solution and the exact solution with \(n=7\) for Example 1

Figure 6
figure 6

The numerical solution and the exact solution with \(n=8\) for Example 1

Table 1 The absolute errors with \(n=4, 6, 7\) for Example 1

When \(n=4\), the absolute error is bigger, we do correction for the numerical solution with \(n=4\) and obtain the correct solution with \(n=4\), \(m=8\), the correct solution and the absolute error of correct solution are shown in Fig. 7 and Fig. 8.

Figure 7
figure 7

The correct solution and the exact solution with \(n=4\), \(m=8\) for Example 1

Figure 8
figure 8

The error of correct solution and the absolute error of correct solution with \(n=4\), \(m=8\) for Example 1

From Fig. 1–Fig. 3 and Table 1, we see that, when \(n = 4,6\), the absolute error is bigger, when \(n=7\), the absolute error becomes smaller and the precision of numerical solution is higher, the absolute error achieves about 10−15. According to Fig. 4–Fig. 6, as the order of convergence n gets larger, the approximation between the numerical solution and the exact solution is better.

From Fig. 1, Fig. 7, Fig. 8, we see that the absolute error of correct solution is smaller than the absolute error of numerical solution.

Example 2

Consider the following multi-order fractional differential equation:

$$\begin{aligned} {D^{\alpha}}u ( x ) ={}& {y_{0}} {{\mathrm{D}}^{{\beta _{0}}}}u ( x ) + {y_{1}} {{\mathrm{D}}^{{\beta _{1}}}}u ( x ) + {y_{2}} {{\mathrm{D}}^{{\beta _{2}}}}u ( x ) \\ &{}+ {y_{3}} {{\mathrm{D}}^{{\beta _{3}}}}u ( x ) + f ( x ),\quad x \in [ {0,1} ], \end{aligned}$$

with the initial conditions

$${u^{ ( 0 )}} ( 0 ) = {d_{0}},\qquad {u^{ ( 1 )}} ( 0 ) = {d_{1}}, $$

where \(\alpha = 2\), \({d_{0}} = {d_{1}} = 0\), the coefficient is \({y_{0}} = {y_{2}} = - 1\), \({y_{1}} = 0\), \({y_{3}} = 2\), and \({\beta _{0}} = 0\), \({\beta _{2}} = \frac{2}{3} \in ( {0,1} )\), \({\beta _{3}} = \frac{5}{3} \in ( {1,2} )\). The known function is

$$f ( x ) = {x^{3}} + 6x - \frac{{12}}{{\Gamma (\frac{7}{3})}}{x^{{{4 \over 3}}}} + \frac{6}{{\Gamma (\frac{{10}}{3})}}{x^{{{7 \over 3}}}}, $$

the exact solution is \(u ( x ) = {x^{3}}\).

When \(n = 2\), the discrete variable is \({x_{i}} = \frac{i}{3} - \frac{1}{{6}} ( {i = 1,2,3} )\), the numerical solution is \(u ( x ) = C_{1}^{T}\Phi ( x )\), the unknown coefficient can be obtained \({C_{1}}={ [ - 0.0912, - 0.0695, 0.0139 ]^{T}}\), the shifted Chebyshev polynomials of approximation function \(\Phi ( x )\) are

$$\Phi ( x ) = \left[ \begin{matrix} 1\\ {2x - 1}\\ {8{x^{2}} - 2x - 1} \end{matrix} \right]. $$

When \(n = 3\), the discrete variable is \({x_{i}} = \frac{i}{4} - \frac{1}{{8}} ( {i = 1,2,3,4} )\), the numerical solution is \(u ( x ) = C_{1}^{T}\Phi ( x )\), the unknown coefficient can be obtained \({C_{1}}= [ 0.3125, 0.4688, 0.1875, 0.0313 ]^{T} \), the shifted Chebyshev polynomials of approximation function \(\Phi ( x )\) are

$$\Phi ( x ) = \left[ \begin{matrix} 1\\ {2x - 1}\\ {8{x^{2}} - 2x - 1}\\ {32{x^{3}} - 48{x^{2}} + 18x - 1} \end{matrix} \right]. $$

When \(n = 2,3\), the absolute errors for equation in some match points between the numerical solution and the exact solution are shown in Fig. 9, Fig. 10, and Table 2. When \(n=3, 4\), the numerical solution and the exact solution are shown in Fig. 11, Fig. 12.

Figure 9
figure 9

The absolute error between the numerical solution and the exact solution with \(n=2\) for Example 2

Figure 10
figure 10

The absolute error between the numerical solution and the exact solution with \(n=3\) for Example 2

Figure 11
figure 11

The numerical solution and the exact solution with \(n=3\) for Example 2

Figure 12
figure 12

The numerical solution and the exact solution with \(n=4\) for Example 2

Table 2 The absolute errors with \(n=2, 3\) for Example 2

When \(n=2\), the absolute error is bigger, we do the correction for the numerical solution with \(n=2\) and obtain the correct solution with \(n=2\), \(m=4\), the correct solution and the absolute error of correct solution are shown in Fig. 13, Fig. 14.

Figure 13
figure 13

The correct solution and the exact solution with \(n=2\), \(m=4\) for Example 2

Figure 14
figure 14

The error of correct solution and the absolute error of correct solution with \(n=2\), \(m=4\) for Example 2

The author of [32] researched the exact solution of Example 2 to obtain the absolute error of the correction solution, so that the accuracy of the numerical solution is improved. From Fig. 9, Fig. 10, and Table 2, we see that, when \(n = 2\), the absolute error is bigger, when \(n = 3\), the absolute error becomes smaller and the precision of numerical solution is higher, the absolute error achieves about 10−16. From Fig. 11, Fig. 12, we see that, as the order of convergence n gets larger, the convergence effect between the numerical solution and the exact solution is better.

From Fig. 9, Fig. 13, Fig. 14, it is seen that the absolute error of correct solution is clearly smaller.

8 Conclusion

In this paper, we conclude that the method based on shifted Chebyshev polynomials is a suitable technique for solving multi-order fractional differential equation. Not only fractional differential operator matrix is deduced, but also this approach reduces the problem to a set of algebraic equations. We investigate multi-order fractional differential equation of error correction and analyze the convergence of the shifted Chebyshev polynomials. From example, it is seen that, n is bigger, the absolute error is smaller, and the convergence effect between the numerical solution and the exact solution is better. We do the correction for the numerical solution, the absolute error of correct solution is smaller than the absolute error of numerical solution. Numerical experiments are given to demonstrate the applicability of the method and the validity of error correction.