Keywords

1 Introduction

Many application of the fractional calculus is in basic sciences and engineering. Many realistic model of physical [8] phenomenon which has dependence at both the time instance and on the previous time history, can be utter with fractional calculus. For example it can be applied in nonlinear oscillations of earthquakes, fluid-dynamic traffic [9], frequency dependent damping behavior of various viscoelastic materials [2], solid mechanics [18], economics [3], signal processing [17], and control theory [4].

One of the main difficulties is how to solve the fractional differential equations. The most commonly techniques proposed to solve them are Adomian decomposition method (ADM) [22], Variational Iteration Method (VIM) [20], Operational Matrix Method [19], Homotopy Analysis Method [6, 7], Fractional Difference Method (FDM) [15] and Power Series Method [16].

A fractional optimal control problem is an optimal control problem in which the performance index or the differential equations governing the dynamic of the system or both contains at least one fractional order derivative term [25]. Integer order optimal controls have already been well established and a significant amount of works have been done in the field of optimal control of integer order systems. Agrawal formulated and developed a numerical scheme for the solution of FOCP [1] in the Caputo sense. Biswas proposed a pseudo-state space representation of a fractional dynamical system, which is exploited to solve a fractional optimal control problem using a direct numerical method [21]. Sweilam et al. solved some types of fractional optimal control problem with a Hamiltonian formula using a spectral method based on Chebyshev polynomials [24]. Bernstein polynomials have been used for finding the numerical solution of FOCP by using Lagrange multipliers [10].

Approximation by orthogonal families of basis functions is widely used in science and engineering. The main idea behind applying an orthogonal basis is reduction of the problem under consideration into a system of algebraic equations. This is possible by truncating series of orthogonal basis functions for the solution of the problem and applying operational matrices. The orthogonal functions are classified into three main category [23]: the first one is sets of piecewise constant orthogonal functions such as the Walsh functions and block pulse functions. The second one is orthogonal polynomials such as the Laguerre, Legendre and Chebyshev functions, and the last one is sine-cosine functions. In one hand approximating a continuous function with piecewise constant basis functions results in a piecewise constant approximation, on the other hand, if a discontinuous function is approximated with continuous basis functions, the resulting approximation is continuous which cannot properly model the discontinuities. So, neither continuous basis functions nor piecewise constant basis functions, if used alone, can efficiently model both continuity and discontinuity of phenomena at the same time. In the case that the function under approximation is not analytic, wavelet functions will be more effective.

In this paper, we propose a computational method based on Sine-Cosine wavelet with their fractional integration and derivative operational matrix to solve the FOCP. The main idea is reduction the problem under consideration into a system of algebraic equations. To this end, we expand the fractional derivative of the state variable and the control variable using the Sine-Cosine wavelet with unknown coefficients.

The paper is organized as follows. In first section we will give the definitions of fractional calculus, then express a brief review of block pulse function and the related fractional operational matrices. In Sect. 4, we describe Sine-Cosine wavelets and its application in function approximation. In Sect. 5, operational matrices of fractional integration and derivative for considered wavelet is given. In Sect. 6, the proposed method is described for solving the underlying FOCP. In the last section the proposed method is applied for solving numerical example.

2 Preliminaries of Fractional Calculus

The Riemann-Liouville fractional integration and Caputo differential operator of a function f of order \( \alpha \ge 0\) is defined in [13] as:

$$\begin{aligned}&(I ^\alpha f)(t)=\left\{ \begin{array}{ll} \frac{1}{\varGamma (\alpha )} \int _0^t (t-\tau )^{\alpha -1} f(\tau )d\tau &{}\alpha >0 \\ f(t) &{} \alpha =0 , \end{array}\right. \end{aligned}$$
(1)
$$\begin{aligned}&\begin{array}{ll}D^\alpha f(t)&{}=\dfrac{1}{\varGamma (n-\alpha )} \int _0^t (t-\tau )^{n-\alpha -1} f^{(n)} (\tau )d\tau \\ &{}=I^{n-\alpha } f^n (t)~~ n-1<\alpha \le n. \end{array} \end{aligned}$$
(2)

3 Review of Block Pulse Functions and the Related Fractional Operational Matrix

In this section first we introduce block pulse function (BPF), then it’s operational matrix of fractional integration.

3.1 Definition of BPF

A set of BPFs \(B_{m'} (t)\) containing \(m'\) component functions in the interval [0, T) is given by

$$\begin{aligned} B_{m'} (t)\triangleq [b_0 (t) b_1 (t)\cdots b_i (t)\cdots b_{m'-1} ]^T .\end{aligned}$$
(3)

The ith component of the BPF vector \(B_{m'} (t)\) is defined as

$$\begin{aligned} b_i (t)=\left\{ \begin{array}{ll} 1~~ ~~~~&{} \frac{iT }{m'} \le t<\frac{(i+1)T}{m'}\\ 0~~~~~~ &{}O.W.\\ \end{array}\right. i=0,1,2,\cdots ,m'-1. \end{aligned}$$
(4)

A square integrable function f can be expanded into a BPF series as

$$\begin{aligned}&f(t)=[c_0 c_1\cdots c_i\cdots c_{m'-1} ] B_{m'} (t)=C^T B_{m'} (t) , \end{aligned}$$
(5)
$$\begin{aligned}&c_i=\frac{1}{h}\int _{ih}^{(i+1)h} f(t)dt~~~ h=\frac{T}{m'} .\end{aligned}$$
(6)

3.2 Operational Matrix for Fractional Integration of BPF

Suppose that \(F^\alpha \) be the block pulse operational matrix of fractional integration [12]. It is defined as follows,

$$\begin{aligned}&F_\alpha =h^\alpha \frac{1}{\varGamma (\alpha +2)} \left[ \begin{array}{lllll}1 &{}\xi _1 &{} \xi _2 &{}\cdots &{} \xi _{m'-1}\\ 0&{} 1 &{}\xi _1 &{}\cdots &{} \xi _{m'-2}\\ 0&{} 0 &{} 1 &{}\cdots &{} \xi _{m'-3}\\ \vdots &{} \vdots &{}\vdots &{}\ddots &{} \vdots \\ 0 &{} 0 &{} 0 &{} 0 &{} \xi _1\\ 0 &{} 0 &{} 0 &{} 0 &{} 1\\ \end{array}\right] ,\end{aligned}$$
(7)
$$\begin{aligned}&\xi _k= (k+1) ^{\alpha +1}-2k^{\alpha +1}+ (k-1) ^{\alpha +1} ~~~k=1,2,\cdots ,m'-1 .\end{aligned}$$
(8)

4 Description of Sine-Cosine Wavelets and Its Application in Function Approximation

4.1 The Sine-Cosine Wavelet

Sine-cosine wavelets \(\psi _{n,m} (t)\) are defined as follows [11],

$$\begin{aligned} \psi _{n,m} (t)=\left\{ \begin{array}{ll} 2^\frac{k+1}{2} f(2^k t-n) &{} \frac{n}{2^k} \le t\le \frac{n+1}{2^k}\\ 0 &{} o.w \end{array}\right. \end{aligned}$$
(9)

with

$$\begin{aligned} f_m (t)=\left\{ \begin{array}{ll} \frac{1}{\sqrt{2}} &{} m=0\\ \cos (2m\pi t) &{}m=1,2,\cdots ,l\\ \sin (2(m-l)\pi t) &{}m=l+1,\cdots ,2l\end{array} \right. \end{aligned}$$
(10)

\(n=0,1,\cdots ,2^k-1 ,k=0,1,\cdots \), where l is any positive integer.

4.2 Function Approximation

A function \(f(t)\in L^2 [0,1)\) can be approximated as:

$$\begin{aligned} f(t)=\sum \limits _{n=0}^{2^k-1}\sum _{m=0}^{2l} c_{n,m} \psi _{n,m} =C^T \varPsi (t)=\varPsi ^T (t)C , \end{aligned}$$
(11)

where \(c_{n,m}=\langle f(t),\psi _{n,m}\rangle \) and \(\langle .,.\rangle \) denotes the inner product as:

$$\begin{aligned} c_{n,m}=\int _{-\infty }^{+\infty } f(t) \psi _{n,m} (t)dt .\end{aligned}$$
(12)

where \( \varPsi (t)\) represent considered wavelet. C and \(\varPsi (t)\) are \(2^k (2l+1)\times 1\) matrices which are given by:

$$\begin{aligned}&C^T=[c_{00} c_{01} \cdots c_{0,2l},c_{10},\cdots ,c_{1,2l},\cdots ,c_{2^k-1,0},\cdots ,c_{2^k-1,2l} ] ,\end{aligned}$$
(13)
$$\begin{aligned}&\varPsi ^T=[\psi _{00} \psi _{01} \cdots \psi _{0,2l},\psi _{10},\cdots ,\psi _{1,2l},\cdots ,\psi _{2^k-1,0},\cdots ,\psi _{2^k-1,2l} ]. \end{aligned}$$
(14)

5 Operational Matrix of Fractional Calculus for Sine-Cosine Wavelet

In this section we find the operational matrix of fractional derivative for the considered wavelet using the operational matrix of fractional integration for BPF.

5.1 Express \(\varPsi (t)\) in Terms of BPF

\(\psi _{n,m} (t)\) as a function can be express in terms of blockpulse function

$$\begin{aligned}&\psi _{n,m} \simeq \sum _{i=0}^{m'-1} f_i b_i ~~~ m'=2^k (2l+1) ,\end{aligned}$$
(15)
$$\begin{aligned}&f_i=m' \int _{\frac{i}{m'}}^{\frac{i+1}{m'}} \psi _{n,m} (x)dx= m' \int _{\frac{i}{m'}}^{\frac{i+1}{m'}} 2^{\frac{k+1}{2}} f_m (2^k x-n)dx . \end{aligned}$$
(16)

Now we calculate \(f_i\) for different value of \(i=0,1,\cdots ,m'-1\)

$$\begin{aligned} {\begin{matrix} &{}m=0, ~~f_i=m' \int _{\frac{i}{m'}}^{\frac{i+1}{m'}}~~ 2^{\frac{k+1}{2}}\times \frac{1}{\sqrt{2}}dx=2^\frac{k}{2}\\ &{}~~~~~~~~~~~~~~~~~~~~~i=n(2l+1),\cdots ,(n+1)(2l+1)-1,\end{matrix}} \end{aligned}$$
(17)
$$\begin{aligned} {\begin{matrix} &{}m=1,2,\cdots ,l,~~ f_i=m' \int _{\frac{i}{m'}}^{\frac{i+1}{m'}} 2^{\frac{k+1}{2}} \cos (2m\pi (2^k x-n) )dx\\ &{}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=\frac{m'}{2^{\frac{k+1}{2}} m\pi } \left[ \psi _{n,m+l} \left( \frac{i+1}{m'}\right) -\psi _{n,m+l} \left( \frac{i}{m'} \right) \right] , \end{matrix}} \end{aligned}$$
(18)
$$\begin{aligned} {\begin{matrix} &{}m=l+1,\cdots ,2l,~~ f_i=m' \int _{\frac{i}{m'}}^{\frac{i+1}{m'}} 2^{\frac{k+1}{2}} \sin (2(m-l)\pi (2^k x-n) )dx\\ &{}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=\frac{-m'}{2^{\frac{k+1}{2}} (m-l)\pi } \left[ \psi _{n,m-l} \left( \frac{i+1}{m'}\right) -\psi _{n,m-l} (\frac{i}{m'} ) \right] . \end{matrix}}\end{aligned}$$
(19)

For \(m=0\) we have

$$\begin{aligned} \psi _{n,m}=[\underbrace{0,\cdots ,0}_{n(2l+1)} ,\underbrace{2^{k/2},2^{k/2},\cdots ,2^{k/2}}_{2l+1} ,0,\cdots ,0]\times B_{m'}. \end{aligned}$$
(20)

For \(m=1, 2, \cdots , l\)

$$\begin{aligned} \psi _{n,m}=&\frac{m'}{2^{\frac{k+1}{2}} m\pi } \!\left[ \! \underbrace{0,0,\cdots ,0}_{n(2l+1)} ,\psi _{n,m+l} \!\left( \! \frac{n(2l+1)+1}{m'}\! \right) \!-\!\psi _{n,m+l} \!\left( \!\frac{n(2l+1)}{m'}\!\right) ,\right. \\&\!\!\left. \cdots ,\psi _{n,m+l} \left( \frac{(n+1)(2l+1)}{m'} \right) -\psi _{n,m+l} \left( \frac{n(2l+1)+2l}{m'} \right) ,0 ,0,\cdots ,0 \right] \times B_{m'}.\nonumber \end{aligned}$$
(21)

And for \(m=l+1, \cdots , 2l\) we get

$$\begin{aligned} \psi _{n,m}=&\frac{-m'}{2^{\frac{k+1}{2}} (m\!-\!l)\pi } \!\left[ \!\underbrace{0,0,\cdots ,0}_{n(2l+1)},\psi _{n,m-l} \!\left( \!\frac{n(2l+1)+1}{m'}\!\right) \!-\psi _{n,m-l} \!\left( \!\frac{n(2l+1)}{m'} \!\right) \!,\right. \\&\!\!\!\!\!\left. \cdots ,\psi _{n,m-l} \left( \frac{(n+1)(2l+1)}{m'}\right) -\psi _{n,m-l} \left( \frac{n(2l+1)+2l}{m'}\right) ,0 ,0,\cdots ,0 \right] \times B_{m'}.\nonumber \end{aligned}$$
(22)

Therefore we have \(\varPsi (x)=\varPhi _{m'\times m'} B_{m'} (x)\) where \(\varPhi _{m'\times m'}=\text {diag}(\varPhi _0,\varPhi _1,\cdots ,\) \(\varPhi _{2^k-1}) \), \(\varPhi _n\) is defined as follows, in the following matrix, \(i=n(2l+1)\)

$$\begin{aligned} \varPhi _n=\left[ \begin{array}{lll} 2^{\frac{k}{2}}&{} \cdots &{}2^{\frac{k}{2}}\\ \frac{m'}{2^{\frac{k+1}{2}}1\pi } (\psi _{n,1+l} \left( \frac{i+1}{m'}\right) -\psi _{n,1+l} (\frac{i}{m'} )&{} \cdots &{}\psi _{n,1+l} (\frac{i+2l+1}{m'})-\psi _{n,1+l} (\frac{i+2l}{m'}))\\ \vdots &{} \ddots &{}\vdots \\ \frac{m'}{2^{\frac{k+1}{2}}l\pi }(\psi _{n,2l} \left( \frac{i+1}{m'}\right) -\psi _{n,21} \left( \frac{i}{m'}\right) &{} \cdots &{}\psi _{n,2l} (\frac{i+2l+1}{m'})-\psi _{n,21} (\frac{i+2l}{m'})))\\ \frac{-m'}{2^{\frac{k+1}{2}}1\pi }(\psi _{n,1} \left( \frac{i+1}{m'}\right) -\psi _{n,1} (\frac{i}{m'} )&{}\cdots &{}\psi _{n,1} (\frac{i+2l+1}{m'})-\psi _{n,1} (\frac{i+2l}{m'}))\\ \vdots &{}\ddots &{}\vdots \\ \frac{-m'}{2^{\frac{k+1}{2}}l\pi }(\psi _{n,l} \left( \frac{i+1}{m'}\right) -\psi _{n,l} (\frac{i}{m'} )&{}\cdots &{}\psi _{n,l} (\frac{i+2l+1}{m'})-\psi _{n,l} (\frac{i+2l}{m'}))\end{array}\right] . \end{aligned}$$
(23)

5.2 Operational Matrix of Fractional Integration and Derivative for Sine-Cosine Wavelet

For finding operational matrix of fractional derivative of vector \(\varPsi (t)\), first of all we try to find the operational matrix of fractional integration.

$$\begin{aligned} (I ^\alpha \varPsi )(x)\simeq P^\alpha \varPsi (x),\end{aligned}$$
(24)

where \(P^\alpha \) is the operational matrix of fractional integration, which calculate as follows

$$\begin{aligned} I^\alpha \varPsi (x)&=I^\alpha \varPhi _{m'\times m'}.B_{m'} (x)=\varPhi _{m'\times m'} I^\alpha B_{m'} (t)=\varPhi _{m'\times m'} F^\alpha B_{m'} (x)\\&\Rightarrow P^\alpha \varPsi (x)=P^\alpha \varPhi _{m'\times m'} B_{m'} (x)=\varPhi _{m'\times m'} F^\alpha B_{m'} (x)\nonumber \\&\Rightarrow P^\alpha =\varPhi _{m'\times m'} F^\alpha \varPhi _{m'\times m'} ^{-1}\nonumber \end{aligned}$$
(25)
$$\begin{aligned}&\Rightarrow I^\alpha \varPsi (x)\simeq \varPhi _{m'\times m'} F^\alpha \varPhi _{m'\times m'} ^{-1} \varPsi (x). \end{aligned}$$
(26)

Now we calculate operational matrix of derivative using \(P^\alpha \)

$$\begin{aligned}&D^\alpha f(x)=I^{n-\alpha } f^n (x) n-1<\alpha \le n n\in N,\end{aligned}$$
(27)
$$\begin{aligned}&D^\alpha x(t)=D^\alpha X^T \varPsi (t)=X^T D^\alpha \varPsi (t)=X^T I^{n-\alpha } \varPsi ^{(n)} (t) .\end{aligned}$$
(28)

For \(\alpha \in \)(0,1) we have \(n=1\) thus

$$\begin{aligned} {\begin{matrix}D^\alpha x(t)&{}\simeq X ^T I^{1-\alpha } D\varPsi (t)=X^T DI^{1-\alpha } \varPsi (t)\\ &{}=X^T D\varPhi _{m'\times m'} F^{1-\alpha } \varPhi _{m'\times m'} ^{-1} \varPsi (t), \end{matrix}}\end{aligned}$$
(29)

where D is operational matrix of derivative for \(\varPsi (t)\) which defined as \(D= \text {diag}(w, w,\) \(\cdots , w)\), which is \(2^k (2l+1)\times 2^k (2l+1)\) matrix and w is of size \((2l+1)\times (2l+1)\)

$$\begin{aligned} w= 2^{k+1} \pi \left[ \begin{array}{lllllllll} 0&{}0&{}0&{}\cdots &{}0&{}0&{}0 &{}\cdots &{}0\\ 0&{}0&{}0&{}\cdots &{}0&{}-1&{}0 &{}\cdots &{}0\\ 0&{}0&{}0&{}\cdots &{}0&{}0&{}-2 &{}\cdots &{}0\\ \vdots &{}\vdots &{}\vdots &{}\ddots &{}\vdots &{}\vdots &{}\vdots &{}\ddots &{}\vdots \\ 0&{}0&{}0&{}\cdots &{}0&{}0&{}0 &{}\cdots &{}-l\\ 0&{}1&{}0&{}\cdots &{}0&{}0&{}0 &{}\cdots &{}0\\ 0&{}0&{}2&{}\cdots &{}0&{}0&{}0 &{}\cdots &{}0\\ \vdots &{}\vdots &{}\vdots &{}\ddots &{}\vdots &{}\vdots &{}\vdots &{}\ddots &{}\vdots \\ 0&{}0&{}0&{}\cdots &{}l&{}0&{}0 &{}\cdots &{}0\\ \end{array}\right] _{(2l+1)\times (2l+1)}. \end{aligned}$$
(30)

6 Solution of the Fractional Optimal Control Problem by Sine-Cosine Operational Matrix

Consider the fractional optimal control problem with quadratic performance index

$$\begin{aligned} \min J=&\frac{1}{2} X^T (1)SX(1)+\frac{1}{2} \int _0^1 (X^T (t)QX(t)+U^T (t)RU(t))dt \end{aligned}$$
(31)
$$\begin{aligned} \text {s. t.}~~&D ^\alpha X(t)=AX(t)+BU(t) \end{aligned}$$
(32)
$$\begin{aligned}&X(0)=X_0 ~~ 0<\alpha \le 1, \end{aligned}$$
(33)

where A and B are constant matrices with the appropriate dimensions, also in cost functional S and Q are symmetric positive semi-definite matrices and R is a symmetric positive definite matrix. In this section, the Sine-Cosine wavelet is used for solving the above problem. We approximate each \(x_i (t)\) and \(u_i (t)\), in terms of Sine-Cosine wavelets as

$$\begin{aligned}&X(t)=[x_1 (t),x_2 (t),\cdots ,x_s (t)]^T~~ x_i (t)=\varPsi ^T (t) X_i~\text {or}~ X_i^T \varPsi (t) ,\end{aligned}$$
(34)
$$\begin{aligned}&X(t)=\hat{\varPsi }_s^T (t)X ~~X=[X_1^T,X_2^T,\cdots ,X_s^T ]~~~~ \hat{\varPsi }_s (t)=I_s \otimes \varPsi (t), \end{aligned}$$
(35)
$$\begin{aligned}&U(t)=[u_1 (t),u_2 (t),\cdots ,u_q (t)]^T ~~~~u_i (t)=\varPsi ^T (t) U_i~\text {or}~U_i^T \varPsi (t), \end{aligned}$$
(36)
$$\begin{aligned}&U(t)=\hat{\varPsi } _q^T (t)U~~~ U=[U_1^T,U_2^T,\cdots ,U_q^T ]~~ \hat{\varPsi } _s (t)=I_s \otimes \varPsi (t), \end{aligned}$$
(37)

where \(X_i\), \(U_i\) are vectors of order \(2^k (2l+1)\times 1\), X and U are vectors of order \(s2^k (2l+1)\times 1\) and \(q2^k (2l+1)\times 1\) respectively. \(\otimes \) denotes the kronecker product. By substituting the above mentioned relation into objective function

$$\begin{aligned} J=\frac{1}{2} X^T \hat{\varPsi } _s (1)S\hat{\varPsi } _s^T (1)X+\frac{1}{2} \int _0^1 [X^T \hat{\varPsi } _s Q\hat{\varPsi } _s^T X+U^T \hat{\varPsi } _q R\hat{\varPsi } _q^T U]dt .\end{aligned}$$
(38)

Since considered wavelet is orthonormal, it means \(\int _0^1 \varPsi ^T (t)\varPsi (t)dt=I\), we can rewrite Eq. (38) as follows

$$\begin{aligned} J(X,U)=\frac{1}{2} X^T [S\otimes \hat{\varPsi } (1) \hat{\varPsi } ^T (1)]X+\frac{1}{2} [X^T (Q \otimes I)X+U^T (R \otimes I)U]. \end{aligned}$$
(39)

Similarly, we do the same method for Eq. (32)

$$\begin{aligned}&X(t)=X^T I_s \otimes \varPsi (t)~\text {or}~ ( I_s \otimes \varPsi ^T (t) )X , \end{aligned}$$
(40)
$$\begin{aligned} {\begin{matrix} &{} D^\alpha X(t)=I^{1-\alpha } X' (t)=I^{1-\alpha } ( X^T (I _s\otimes \varPsi (t))) '=X^T I^{1-\alpha } (I_s \otimes (D\varPsi (t)))' \\ &{}\!\!\!\!\!\!\!\!\!\!\!\!\!\!=X^T I_s \otimes (I^{1-\alpha } D\varPsi (t))= X^T I_s \otimes [DI^{1-\alpha } (\varPsi (t))]\\ &{}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!=X^T I_s \otimes (D\varPhi _{m'\times m'} F^\alpha \varPhi _{m'\times m'} ^{-1} \varPsi (x) ) \end{matrix}} \end{aligned}$$
(41)
$$\begin{aligned}&R(t)\!=\!X^T I_s \!\otimes \!(D\varPhi _{m'\times m'} F^\alpha \varPhi _{m'\times m'} ^{-1} )\varPsi (t)\!-\!AX^T I_s \!\otimes \!\varPsi (t)\!-\!BU^T I_q \otimes \varPsi (t) R(t)\nonumber \\&~~~~~~~=[X^T I_s \otimes ( D\varPhi _{m'\times m'} F^\alpha \varPhi _{m'\times m'} ^{-1} )-AX^T I_s\otimes I_{2^k (2l+1)}\\&~~~~~~~~~~~~-BU^T I_q \otimes I_{2^k (2l+1)} ]\otimes \varPsi (t).\nonumber \end{aligned}$$
(42)

As in a typical tau method [5] we generate \(2^k(2l+1)-1\) linear equations by applying

$$\begin{aligned} \langle R(t),\psi _{n,m} (t)\rangle =\int _0^1R(t).\psi _{n,m} (t)dt =0 .\end{aligned}$$
(43)

Also, by substituting Eq. (35) in (33) we get

$$\begin{aligned} X(0)=X^T \hat{\varPsi }(0)=X_0 . \end{aligned}$$
(44)

Equations (43) and (44) generate \(2^k(2l+1)\) set of linear equations. These linear equations can be solved for unknown coefficients of the vectors \(X^T\) and \(U^T\). Consequently, X(t) and U(t) can be calculated.

7 Illustrative Example

We applied the method presented in this paper and solved the undergoing example.

Example 1

Consider the following time invariant FOCP [14],

$$\begin{aligned} \min J=&\frac{1}{2} \int _0^1 (x ^2 (t)+u^2 (t))dt \\ \text {s. t.}~~&D^\alpha x(t)=-x(t)+u(t)\\&x(0)=1.\end{aligned}$$

We want to find a control variable u(t) which minimizes the quadratic performance index J. This problem is solved by proposed method with \(\alpha =1, m=5\) and \(n=7\), the numerical value obtained for J is 0.1979, which is close to the exact solutions in the case \(\alpha = 1 (0.1929)\).

8 Conclusion

In this paper, we derive a numerical method for fractional optimal control based on the operational matrix for the fractional integration and differentiation. The procedure of constructing these matrices is summarized. An example is given to show the efficiency of method. The obtained matrices can also be used to solve problems such as fractional optimal control with delay. Moreover we could find these matrices using another set of orthogonal functions instead of BPFs, it seems if we use a set of continuous orthogonal function the numerical result will improve.