A Simple Accurate Method for Solving Fractional Variational and ...

0 downloads 0 Views 238KB Size Report
Jan 24, 2016 - In view of its history, fractional (non-integer order) calculus is as old as the ... role: the fractional calculus of variations and the fractional theory of ...
This is a preprint of a paper whose final and definite form will be published in Journal of Optimization Theory and Applications, ISSN 0022-3239 (print), ISSN 1573-2878 (electronic).

A Simple Accurate Method for Solving Fractional Variational and Optimal Control Problems

arXiv:1601.06416v1 [math.OC] 24 Jan 2016

Salman Jahanshahi · Delfim F. M. Torres

Submitted: 31-Dec-2014 / Revised: 21-Oct-2015 and 17-Jan-2016 / Accepted: 24-Jan-2016.

Abstract We develop a simple and accurate method to solve fractional variational and fractional optimal control problems with dependence on Caputo and Riemann–Liouville operators. Using known formulas for computing fractional derivatives of polynomials, we rewrite the fractional functional dynamical optimization problem as a classical static optimization problem. The method for classical optimal control problems is called Ritz’s method. Examples show that the proposed approach is more accurate than recent methods available in the literature. Keywords fractional integrals · fractional derivatives · Ritz’s method · fractional variational problems · fractional optimal control Mathematics Subject Classification (2010) 26A33 · 49K05 · 49M30

1 Introduction In view of its history, fractional (non-integer order) calculus is as old as the classical calculus [1,2,3]. Roughly speaking, there is just one definition of fractional integral operator, which is the Riemann–Liouville fractional integral. There are, however, several definitions of fractional differentiation, e.g., Caputo, Riemann–Liouville, Hadamard, and Wily differentiation [4,5]. Each type of fractional derivative has its own properties, which make richer the area of fractional calculus and enlarge its range of applicability [6,7]. There are two recent research areas where fractional operators have a particularly important role: the fractional calculus of variations and the fractional theory of optimal control [8,9,10]. A fractional variational problem is a dynamic optimization problem, in which the objective functional, as well as its constraints, depends on derivatives or integrals of fractional order, e.g., Caputo, Riemann–Liouville or Hadamard fractional operators. This is a generalization of the classical theory, where derivatives and integrals can only appear in integer orders. If at least one non-integer (fractional) term exists in its formulation, then the problem is said to be a fractional variational problem or a fractional optimal control problem. The theory of the fractional calculus of variations was introduced by Riewe in 1996, to deal with nonconservative systems in mechanics [11,12]. This subject has many applications in physics and engineering, and provides more accurate models of S. Jahanshahi Department of Mathematics, Science and Research Branch, Islamic Azad University, Tehran, Iran E-mail: [email protected] D. F. M. Torres Center for Research and Development in Mathematics and Applications (CIDMA), Department of Mathematics, University of Aveiro, 3810-193 Aveiro, Portugal E-mail: [email protected]

2

S. Jahanshahi, D. F. M. Torres

physical phenomena. For this reason, it is now under strong development: see [13,14,15,16,17,18] and the references therein. For a survey, see [19]. There are two main approaches to solve problems of the fractional calculus of variations or optimal control. One involves solving fractional Euler–Lagrange equations or fractional Pontryagintype conditions, which is the indirect approach; the other involves addressing directly the problem, without involving necessary optimality conditions, which is the direct approach. The emphasis in the literature has been put on indirect methods [9,10,20,21]. For direct methods, see [8,14]. Furthermore, Almeida et al. developed direct numerical methods based on the idea of writing the fractional operators in power series, and then approximating the fractional problems with classical ones [22,23]. In this paper, we use a different approach to solve fractional variational problems and fractional optimal control problems, based on Ritz’s direct method. The idea is to restrict admissible functions to linear combinations of a set of known basis functions. We choose basis functions in such a way that the approximated function satisfies the given boundary conditions. Using the approximated function and its derivatives whenever needed, we transform the functional into a multivariate function of unknown coefficients. Recently, Dehghan et al. in [24] used the Rayleigh–Ritz method, based on Jacobi polynomials, to solve fractional optimal control problems. Several illustrative examples show that our results are more accurate and more useful than the ones introduced in [23,24]. The paper is organized as follows. In Section 2, we present some necessary preliminaries on fractional calculus. In Section 3, we investigate Ritz’s method for solving three kinds of fractional variational problems. In Section 4, we solve five examples of fractional variational problems and three examples of fractional optimal control problems, comparing our results with previous methods available in the literature. The main conclusions are given in Section 5. 2 Preliminaries and Notations About Fractional Calculus Riemann–Liouville fractional integrals are a generalization of the n fold integral, n ∈ N, to real value numbers. Using the usual notation in the theory of fractional calculus, we define the Riemann–Liouville fractional integrals as follows. Definition 2.1 (Fractional integrals) The left and right Riemann–Liouville fractional integrals of order α > 0 of a given function f are defined by Z x 1 α (x − t)α−1 f (t)dt a Ix f (x) := Γ (α) a and α x Ib f (x) :=

1 Γ (α)

Z

b

(t − x)α−1 f (t)dt,

x

respectively, where Γ is Euler’s gamma function, that is, Z ∞ Γ (x) := tx−1 e−t dt, 0

and a < x < b. The left Riemann–Liouville fractional operator has the following properties: α β a Ix a Ix α a Ix (x

= a Ix α+β ,

− a)n =

α β a Ix a Ix

= a Ixβ a Ixα ,

Γ (n + 1) (x − a)α+n , Γ (α + n + 1)

x > a,

(1)

where α, β ≥ 0 and n ∈ N0 = {0, 1, . . .}. Similar relations hold for the right Riemann–Liouville fractional operator. Now, using the definition of fractional integral, we define two kinds of fractional derivatives.

Solving Fractional Variational and Optimal Control Problems

3

Definition 2.2 (Riemann–Liouville derivatives) Let α > 0 with n − 1 < α ≤ n, n ∈ N. The left and right Riemann–Liouville fractional derivatives of order α > 0 of a given function f are defined by Z x dn 1 α n n−α (x − t)n−α−1 f (t)dt )f (x) = a Dx f (x) := D (a Ix Γ (n − α) dxn a and n−α α n n )f (x) = x Db f (x) := (−1) D (x Ib

(−1)n dn Γ (n − α) dxn

respectively.

Z

b

(t − x)n−α−1 f (t)dt,

x

The following relations hold for the left Riemann–Liouville fractional derivative: α β a Dx a Dx

= a Dx α+β , α a Dx k

α a Dx (x

− a)n =

=

α β a Dx a Dx

= a Dxβ a Dxα ,

k(x − a)α , Γ (1 − α)

Γ (n + 1) (x − a)n−α , Γ (n − α + 1)

(2)

x > a,

where α, β ≥ 0, k is a constant and n ∈ N0 . Similar relations hold for the right Riemann–Liouville fractional derivative. Another type of fractional derivative, which also uses the Riemann–Liouville fractional integral in its definition, was proposed by Caputo [25]. Definition 2.3 (Caputo derivatives) Let α > 0 with n − 1 < α ≤ n, n ∈ N. The left and right Caputo fractional derivatives of order α > 0 of a given function f are defined by Z x 1 C α n−α n (x − t)n−α−1 f (n) (t)dt D f (x) := ( I )D f (x) = a a x x Γ (n − α) a and C α x Db f (x)

:= (−1)n (x Ibn−α )Dn f (x) =

(−1)n Γ (n − α)

respectively.

Z

b

(t − x)n−α−1 f (n) (t)dt,

x

The following relations hold for the left Caputo fractional derivative: C αC β a Dx a Dx

α+β =C , a Dx

C αC β a Dx a Dx

C α a Dx k C α a Dx (x

− a)n =

(

= 0,

Γ (n+1) Γ (n−α+1) (x

0,

βC α =C a Dx a Dx ,

− a)n−α , n ≥ [α], n < [α],

(3)

where α, β ≥ 0, k is a constant, x > a, n ∈ N0 , and [·] is the ceiling function, that is, [α] is the smallest integer greater than or equal to α. Similar relations hold for the right Caputo fractional derivative. Moreover, the following relations between Caputo and Riemann–Liouville fractional derivatives hold: n−1 X f (k) (a) C α α (x − a)k−α D f (x) = D f (x) − a x a x Γ (k − α + 1) k=0

and

C α x Db f (x)

= x Dbα f (x) −

n−1 X k=0

n

(k)

f (k) (b) (b − x)k−α . Γ (k − α + 1)

Therefore, if f ∈ C [a, b] and f (a) = 0, k = 0, 1, . . . , n − 1, then α α k = 0, 1, . . . , n − 1, then C x Db f = x Db f .

C α a Dx f

= a Dxα f ; if f (k) (b) = 0,

4

S. Jahanshahi, D. F. M. Torres

3 Main Results Consider the following fractional variational problem: find y ∈ C n [a, b] in such a way to minimize or maximize the functional Z b J{y} = L(t, y(t), Dα y(t))dt, n − 1 ≤ α < n, (4) a

subject to boundary conditions y (k) (a) = uk,a ,

y (k) (b) = uk,b ,

k = 0, 1, . . . , n − 1,

(5)

where L is the Lagrangian, assumed to be continuous with respect to all its arguments, Dα is a fractional operator (left or right Riemann–Liouville fractional integral or derivative or left or right Caputo fractional derivative), and uk,a and uk,b , k = 0, 1, . . . , n − 1, are given constants. To solve problem (4)–(5) with our method, we need to recall the following classical theorems from approximation theory. Theorem 3.1 (Stone–Weierstrass theorem (1937)) Let K be a compact metric space and A ⊂ C(K, R) a unital sub-algebra, which separates points of K. Then, A is dense in C(K, R). Theorem 3.2 (Weierstrass approximation theorem (1885)) If f ∈ C([a, b], R), then there is a sequence of polynomials Pn (x) that converges uniformly to f (x) on [a, b]. PN Theorem 3.3 Let PN (x) := i=0 ci (x − a)i be a polynomial. Then, α a Ix PN (x)

=

N X

ci

Γ (i + 1) (x − a)α+i , Γ (α + i + 1)

(6)

ci

Γ (i + 1) (x − a)i−α , Γ (i − α + 1)

(7)

Γ (i + 1) (x − a)i−α , Γ (i − α + 1)

(8)

i=0

N X

α a Dx PN (x) =

i=0

C α a Dx PN (x)

=

N X

i=[α]

for x > a.

Proof Follows from relations (1), (2) and (3) and the linearity property of the fractional operators. ⊔ ⊓ For solving fractional variational problems involving right fractional operators, we use the following theorem. P i Theorem 3.4 Let PN (x) := N i=0 ci (b − x) be a polynomial. Then, α x Ib PN (x)

=

N X

ci

Γ (i + 1) (b − x)α+i , Γ (α + i + 1)

(9)

ci

Γ (i + 1) (b − x)i−α , Γ (i − α + 1)

(10)

Γ (i + 1) (b − x)i−α , Γ (i − α + 1)

(11)

i=0

α x Db PN (x)

=

N X i=0

C α x Db PN (x)

=

N X

i=[α]

for x < b.

Proof Similar to the proof of Theorem 3.3.

⊓ ⊔

Without any loss of generality, from now on we consider a = 0, b = 1 and t ∈ [0, 1] in the fractional variational problem (4)–(5).

Solving Fractional Variational and Optimal Control Problems

5

3.1 Fractional Variational Problems Involving Left Operators Consider the fractional variational functional (4) involving a left fractional operator, subject to boundary conditions (5). To find the function y(x) that solves problem (4)–(5), we put y(x) ≃ yN (x) =

N X

ci xi .

(12)

i=0

Then, by substituting (12) and relations (6)–(8) into (4), we obtain J[y] = J[c0 , c1 , . . . , cN ] =

Z

1

L(x, yN (x), Dα yN (x))dx

(13)

0

subject to boundary conditions (k)

yN (0) = uk,0 ,

(k)

yN (1) = uk,1 ,

k = 0, 1, . . . , n − 1,

(14)

which is an algebraic function of unknowns ci , i = 0, 1, . . . , N . To optimize the algebraic function J, we act as follows. We should find c0 , c1 , . . . , cN , such that yN satisfies boundary conditions (14). This means that the following relations must be satisfied: (k)

yN (0) = uk,0 ,

(k)

yN (1) = uk,1 ,

k = 0, 1, . . . , n − 1.

(15)

Using the well known Hermite interpolation and the relations (15), we calculate c0 , c1 , . . . , cn . For obtaining the values of cn+1 , cn+2 , . . . , cN , firstly we use the N + 1 point Gauss–Legendre quadrature rule, which is exact for every polynomial of degree up to 2N + 2. Secondly, we calculate the exact value of the integral in the right-hand side of (13). Then, according to differential calculus, we must solve the following system of equations: ∂J = 0, ∂cj

j = n + 1, n + 2, . . . , N,

(16)

which, depending on the form of L, is a linear or nonlinear system of equations. Furthermore, we choose the value of N such that |yN +1 (x) − yN (x)| ∼ = 0(x), where 0(x) is the null polynomial.

3.2 Fractional Variational Problems Involving Right Operators Now consider the fractional variational functional (4) involving a right fractional operator, subject to boundary conditions (5). To find function y(x) that solves problem (4)–(5), we put y(x) ≃ yN (x) =

N X

ci (1 − x)i .

(17)

i=0

Then, substituting (17) and relations (9)–(11) into (4), we obtain J[y] = J[c0 , c1 , . . . , cN ] =

Z

1

L(x, yN (x), Dα yN (x))dx

(18)

0

subject to boundary conditions (k)

yN (0) = uk,0 ,

(k)

yN (1) = uk,1 ,

k = 0, 1, . . . , n − 1,

which is an algebraic function of unknowns ci , i = 0, 1, . . . , N . To optimize the algebraic function (18), we act as explained in Section 3.1.

6

S. Jahanshahi, D. F. M. Torres

3.3 Fractional Optimal Control Problems A fractional optimal control problem requires finding a control function u(t) and the corresponding state trajectory x(t), that minimizes (or maximizes) a given functional J{x, u} =

Z

b

L (t, x(t), u(t)) dt

(19)

a

subject to a fractional dynamical control system Dα x(t) = f (t, x(t), u(t))

(20)

and boundary conditions x(k) (a) = uk,a ,

x(k) (b) = uk,b ,

k = 0, 1, . . . , n − 1,

(21)

where Dα is a fractional operator, α is a positive real number, and f and L are two known functions. For more details, see [22,26,27,28,29] and the references therein. Here we restrict our attention to those fractional optimal control problems (19)–(21), for which one can solve (20) with respect to u and write u(t) = g (t, x(t), Dα x(t)) .

(22)

Then, by substituting (22) into (19), we obtain the following fractional variational problem (FVP): find function x(t) that extremizes the functional J{x} =

Z

b

L (t, x(t), g(t, x(t), Dα x(t))) dt

(23)

x(k) (b) = uk,b ,

(24)

a

subject to boundary conditions x(k) (a) = uk,a ,

k = 0, 1, . . . , n − 1.

We solve the FVP (23)–(24) by using the method illustrated in previous sections, and then we find control function u(t) by using (22). Remark 3.1 Similarly to classical Ritz’s method, the trial functions are selected to meet boundary conditions (and any other constraints). The exact solutions are not known; and the trial functions are parametrized by adjustable coefficients, which are varied to find the best approximation for the basis functions used. The choice of the basis functions depends on the solution space. Since our problems involve finding C n solutions, we choose the basis functions to be polynomials. If the solution space is another one, like the Lp space or the space of harmonic functions, then we should choose some basis functions like Fourier or wavelet basis. Remark 3.2 For choosing the number N one needs to decide on the required accuracy. One can stop when the difference between two consecutive approximations yN and yN −1 or their respective functional values is smaller than a desired tolerance, that is, when kyN − yN −1 k ≤ ε or when |J[yN ] − J[yN −1 ]| ≤ ε for some given ε. Note that for a minimization (maximization) problem, the functional J is always a non-increasing (non-decreasing) function of N : J[yN ] ≤ J[yN −1 ] (J[yN ] ≥ J[yN −1 ]). Moreover, if y is the (unknown) exact solution of the fractional variational problem at hand, then yN converges uniformly to y (Theorems 3.1 and 3.2). Remark 3.3 Throughout the paper, N is greater than n. In the next section, we solve five fractional problems of the calculus of variations and three fractional optimal control problems. Six of the eight problems involve left fractional operators, while the other two involve right operators.

Solving Fractional Variational and Optimal Control Problems

7

4 Illustrative Examples We begin by solving two problems of the calculus of variations involving a left Riemann–Liouville fractional derivative. These problems were recently investigated by Almeida et al. in [8]. We also solve three examples involving left and right Caputo fractional derivatives, which were recently considered by Dehghan et al. in [24], and we compare the results. Finally, we solve three fractional optimal control problems that were investigated before in [22,29,30]. For all examples, the error between the exact solution y and the approximate solution yN , found using our method, is computed as follows: Z 1 Error{y, yN } = (y(x) − yN (x))2 dx. (25) 0

The results show that our method is very simple but very accurate, providing better results than those found in the literature. Example 4.1 [8,23] Let α ∈]0, 1[. Consider the following FVP: minimize

J{y} =

Z

1

0

α 0 Dx y(x)

 − (y ′ )2 (x) dx,

(26)

subject to y(0) = 0,

y(1) = 1.

(27)

The exact solution to problem (26)–(27) is y(x) = −

  1 1 1 x+ (1 − x)2−α + 1 − 2Γ (3 − α) 2Γ (3 − α) 2Γ (3 − α)

[8,23]. With the given boundary conditions (27), we consider yN (x) =

1−

N X

ci

i=2

!

x+

N X

ci xi .

i=2

Using our method, we calculate the ci ’s by solving the system of equations (16). For α = 0.5 and N = 2, we have y(x) = 0.376126 − 0.376126(1 − x)1.5 + 0.623874x, y2 (x) = 1.22568x − 0.225676x2. Figure 1 plots the result for α = 0.5 and N = 2. The errors computed with (25) for different values of α and N are presented in Table 1. Our approximate results are better than the ones presented Table 1:

Errors obtained for problem (26)–(27) of Example 4.1 when computed with (25) for α = 0.25, 0.5, 0.75 and N = 3, 4, 5, 6. α 0.25 0.5 0.75

in [8,23].

N =3 1.7 × 10−7 9.7 × 10−6 1.6 × 10−6

N =4 1.9 × 10−8 1.5 × 10−7 3.4 × 10−7

N =5 3.6 × 10−9 3.5 × 10−8 9.9 × 10−8

N=6 9.1 × 10−10 1.1 × 10−8 3.5 × 10−8

8

S. Jahanshahi, D. F. M. Torres 1.0

0.8

0.6

0.4

0.2

0.2

Fig. 1:

0.4

0.6

0.8

1.0

Exact solution to problem (26)–(27) of Example 4.1 with

α = 0.5 (the solid line) versus our approximate solution with N = 2 (the dashed line).

Example 4.2 [8] Let α = 0.5 and consider the minimization problem 4 Z 1 5 16Γ (6) 4.5 20Γ (4) 2.5 0.5 α x + x − x dx, minimize J{y} = 0 Dx y(x) − Γ (5.5) Γ (3.5) Γ (2.5) 0

(28)

subject to the boundary conditions y(0) = 0,

y(1) = 1.

(29)

The minimizer to the FVP (28)–(29) is given by y(x) = 16x5 − 20x3 + 5x. For N = 5, we obtain y5 (x) = 5x + (2.3995 × 10−10 )x2 −20x3 + (7.70126 × 10−10 )x4 + 16x5 . Figure 2 shows that our results are more accurate than the results presented in [8]. 1.0

1.0

0.5

0.5

0.2

0.4

0.6

0.2

1.0

0.4

0.6

0.8

1.0

-0.5

-0.5

-1.0

-1.0

(a) N = 4

Fig. 2:

0.8

(b) N = 5

Exact solution to problem (28)–(29) of Example 4.2 (the solid line) versus our approximate solutions

with N = 4, 5 (the dashed line).

Below we solve three problems of the calculus of variations, which were recently solved by Dehghan et al. in [24]. Our results show that our method is also more accurate than the method introduced in [24].

Solving Fractional Variational and Optimal Control Problems

9

Example 4.3 [24] Consider the following FVP: minimize

J{y} =

1 2

1

Z

α 2 (C 0 Dx y(x) − f (x)) dx,

0

0 < α < 1,

(30)

where f (x) is given by Γ (β + 1) xβ−α , Γ (1 + β − α)

f (x) = subject to the boundary conditions

y(0) = 0,

y(1) = 1.

(31)

The exact solution to this problem is y(x) = xβ [24]. In Figure 3, the exact solution for α = 0.5 and β = 2.5 versus our numerical solution for N = 3 is plotted. Note that for β = k, k ∈ N, the error is equal to zero when N ≥ k. 1.0

0.8

0.6

0.4

0.2

0.2

Fig. 3:

0.4

0.6

0.8

1.0

Exact solution to problem (30)–(31) of Example 4.3 with

α = 0.5 and β = 2.5 (the solid line) versus our approximate solution with N = 3 (the dashed line).

Example 4.4 [24] Consider the following FVP, depending on a right Caputo fractional derivative: minimize

J{y} =

1 2

Z

1

0

α 2 (C x D1 y(x) − 1) dx,

0 < α < 1,

(32)

subject to boundary conditions y(0) = 1 +

1 , Γ (1 + α)

y(1) = 1.

(33)

The exact solution to (32)–(33) is given by y(x) = 1 +

(1 − x)α . Γ (1 + α)

An approximate solution obtained with our method is shown in Figure 4. See Table 2 for the error of our approximations.

10

S. Jahanshahi, D. F. M. Torres

2.0

1.8

1.6

1.4

1.2

0.2

0.4

0.6

0.8

1.0

Fig. 4:

Exact solution to problem (32)–(33) of Example 4.4 with α = 0.75 (the solid line) versus our approximate solution with N = 6 (the dashed line).

Table 2: Errors obtained for problem (32)–(33) of Example 4.4, computed with (25) for α = 0.75 and N = 2, 3, 4, 5, 6. α 0.75

N =2 5.7 × 10−4

N=3 1.2 × 10−4

N=4 3.6 × 10−5

N =5 1.6 × 10−5

N =6 7.2 × 10−6

Example 4.5 [24] As a second example involving a fractional right operator, consider the following FVP with 0 < α < 1: 2 Z 1 Γ (β + 1)(1 − x)β−α C α β D y(x) + y(x) − (1 − x) − minimize J{y} = dx, (34) x 1 Γ (β − α + 1) 0 subject to boundary conditions y(0) = 1,

y(1) = 0.

(35)

β

In this case the exact solution is y(x) = (1−x) [24]. Figure 5 shows the exact solution for α = 0.39 and β = 3 versus our numerical solution with N = 3. The errors (25) of our approximations, for different values of (α, β), β 6= 3, are listed in Table 3. As with Example 4.3, the error for β = k, k ∈ N, is equal to zero when we consider N ≥ k. Table 3:

Errors for problem (34)–(35) of Example 4.5 when

computed with (25) for different values of (α, β) and N = 3, 4, 5. (α, β) (0.39, 1.5) (0.39, 2.5) (0.59, 1.5) (0.59, 2.5)

N =3 6.1 × 10−6 1.3 × 10−6 6.2 × 10−6 1.3 × 10−6

N =4 8.1 × 10−7 4.5 × 10−8 8.1 × 10−7 4.5 × 10−8

N =5 1.7 × 10−8 3.7 × 10−9 4.5 × 10−9 4.5 × 10−9

We finish by applying our method to three fractional optimal control problems. Example 4.6 [29,30] Consider the following fractional optimal control problem (FOCP): Z 1 minimize J{x, u} = (tu(t) − (α + 2)x(t))2 dt, 0

(36)

Solving Fractional Variational and Optimal Control Problems

11

1.0

0.8

0.6

0.4

0.2

0.2

Fig. 5:

0.4

0.6

0.8

1.0

Exact solution to problem (34)–(35) of Example 4.5 with

α = 0.39 and β = 3 (the solid line) versus our approximate solution with N = 3 (the dashed line).

subject to the dynamical fractional control system α 2 x′ (t) + C 0 Dt x(t) = u(t) + t

(37)

and the boundary conditions x(0) = 0,

x(1) =

2 . Γ (3 + α)

(38)

The exact solution is given by (x(t), u(t)) =



2tα+2 2tα+1 , Γ (α + 3) Γ (α + 2)



.

To solve this problem with our method, we take N

xN (t) =

X 2 ci − Γ (3 + α) i=1

!

t+

N X

c i ti .

i=1

The results for α = 0.5 and N = 3, 4 are plotted in Figure 6. Table 4 shows the errors for α = 0.5 and N = 2, 3, 4. Table 4:

Errors for problem (36)–(38) of Example 4.6

when computed with (25) for α = 0.5 and N = 2, 3, 4. Errors Error{x, xN } Error{u, uN }

N =2 1.2 × 10−4 7.1 × 10−3

N =3 7.1 × 10−7 9.6 × 10−5

N =4 2.8 × 10−8 7.9 × 10−6

Example 4.7 [30] Consider now the following FOCP: minimize

J{x, u} =

Z

0

1

(u(t) − x(t))2 dt,

(39)

12

S. Jahanshahi, D. F. M. Torres

0.6

1.5

0.5

0.4

1.0

0.3

0.2

0.5

0.1

0.2

0.4

0.6

0.8

0.2

1.0

0.4

(a) x(t), N = 3

0.6

0.8

1.0

0.8

1.0

(b) u(t), N = 3

0.6

1.4 0.5

1.2

0.4

1.0 0.8

0.3

0.6 0.2

0.4 0.1

0.2

0.2

0.4

0.6

0.8

0.2

1.0

0.4

(c) x(t), N = 4

0.6

(d) u(t), N = 4

Fig. 6:

Exact solution (x(t), u(t)) to the FOCP (36)–(38) of Example 4.6 with α = 0.5 (the solid line) versus our approximate solution with N = 3, 4 (the dashed line).

subject to the fractional dynamical control system α x′ (t) + C 0 Dt x(t) = u(t) − x(t) +

and the boundary conditions x(0) = 0,

x(1) =

6tα+2 + t3 Γ (α + 3)

6 . Γ (4 + α)

(40)

(41)

The exact solution to (39)–(41) is given by (x(t), u(t)) =



6tα+3 6tα+3 , Γ (α + 4) Γ (α + 4)



.

To solve problem (39)–(41) with our method, we take N

xN (t) =

X 6 ci − Γ (4 + α) i=1

!

t+

N X

c i ti .

i=1

The results for α = 0.5 and N = 3, 4 are plotted in Figure 7. The errors (25) for α = 0.5 and N = 2, 3, 4 are shown in Table 5. In [22] the authors propose a direct method for solving fractional optimal control problems, which involves approximating the initial fractional order problem by a new one with integer order derivatives only. The latter problem is then discretized, by application of finite differences, and solved numerically. Our method is simpler and does not involve the solution of a nonlinear programming problem through AMPL and IPOPT. Moreover, as we see next, it provides a much better result when compared with the example given in [22].

Solving Fractional Variational and Optimal Control Problems 0.5

13

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

0.2

0.4

0.6

0.8

1.0

0.2

(a) x(t), N = 3 0.5

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

0.2

0.4

0.4

0.6

0.8

1.0

0.8

1.0

(b) u(t), N = 3

0.6

0.8

1.0

0.2

(c) x(t), N = 4

0.4

0.6

(d) u(t), N = 4

Fig. 7:

Exact solution (x(t), u(t)) to the FOCP (39)–(41) of Example 4.7 with α = 0.5 (the solid line) versus our approximate solution with N = 3, 4 (the dashed line).

Table 5:

Errors for problem (39)–(41) of Example 4.7

when computed with (25) for α = 0.5 and N = 2, 3, 4. Errors Error{x, xN } Error{u, uN }

N =2 7.3 × 10−4 5.2 × 10−2

N =3 2.5 × 10−6 3.9 × 10−4

N =4 8.4 × 10−9 2.2 × 10−6

Example 4.8 [22] Consider the FOCP of [22]: minimize

J{x, u} =

Z

1

(u2 (t) − 4x(t))2 dt,

(42)

0

subject to the control system 0.5 x′ (t) + C 0 Dt x(t) = u(t) +

2 t1.5 , Γ (2.5)

t ∈ [0, 1],

(43)

and the boundary conditions x(0) = 0,

and x(1) = 1.

The exact solution to (42)–(44) is given by (x(t), u(t)) = (t2 , 2t) (see [22]). To solve problem (42)–(44) with the method of this paper, we take ! N N X X c i ti . ci t + xN (t) = 1 − i=1

i=1

(44)

14

S. Jahanshahi, D. F. M. Torres

In this case our method gives the exact solution x(t) = t2 for N = 2. This is in contrast with the results in [22], for which the exact solution is not found. In fact, our method provides here better results with just 2 steps (c1 = 0 and c2 = 1) than the method introduced in [22] with 100 steps. Remark 4.1 According to relations (12) and (17), accuracy depends on N . When the order α of the derivative changes, then the problem under consideration also changes. We were not able to find any general relation between α and the accuracy, that is, a general pattern on how N changes with α, for a fixed precision. This seems to depend on the particular situation at hand. 5 Conclusions We introduced a numerical method, based on Ritz’s direct method, to solve problems of the fractional calculus of variations and fractional optimal control. The idea of this approach is simple: by using some known basis functions, we construct an approximate solution, which is a linear combination of the basis functions, carrying out a finite-dimensional minimization among such linear combinations and approximating the exact solution of the fractional optimal control problem. From the simulation results, the proposed approach is surprisingly accurate, and the approximate solution is nearly a perfect match with the exact solution, which is superior to the results from previous numerical methods available in the literature. Acknowledgements This work is part of first author’s PhD project. It was partially supported by Islamic Azad University, Tehran, Iran; and CIDMA-FCT, Portugal, within project UID/MAT/04106/2013. Jahanshahi was also supported by a scholarship from the Ministry of Science, Research and Technology of the Islamic Republic of Iran, to visit the University of Aveiro, Portugal, and work with Professor Torres. The hospitality and the excellent working conditions at the University of Aveiro are here gratefully acknowledged. The authors are indebted to an anonymous referee for a careful reading of the original manuscript and for providing several suggestions, questions, and remarks. They are also grateful to the Editor-in-Chief, Professor Giannessi, and Ryan Loxton, for English improvements.

References 1. Kilbas, A.A., Srivastava, H.M., Trujillo, J.J.: Theory and applications of fractional differential equations. NorthHolland Mathematics Studies, 204, Elsevier, Amsterdam (2006) 2. Samko, S.G., Kilbas, A.A., Marichev, O.I.: Fractional integrals and derivatives. Translated from the 1987 Russian original. Gordon and Breach, Yverdon (1993) 3. Val´ erio, D., Tenreiro Machado, J., Kiryakova, V.: Some pioneers of the applications of fractional calculus. Fract. Calc. Appl. Anal. 17:2, 552–578 (2014) 4. de Oliveira, E.C., Tenreiro Machado, J.A.: A review of definitions for fractional derivatives and integral. Math. Probl. Eng. 2014:238459, 6 pp (2014) 5. Ortigueira, M.D., Trujillo, J.J.: A unified approach to fractional derivatives. Commun. Nonlinear Sci. Numer. Simul. 17:12, 5151–5157 (2012) 6. Ortigueira, M.D.: Fractional calculus for scientists and engineers. Lecture Notes in Electrical Engineering, 84, Springer, Dordrecht (2011) 7. Tenreiro Machado, J.A., Baleanu, D., Chen, W., Sabatier, J.: New trends in fractional dynamics. J. Vib. Control 20:7, 963 (2014) 8. Almeida, R., Pooseh, S., Torres, D.F.M.: Computational methods in the fractional calculus of variations. Imp. Coll. Press, London (2015) 9. Malinowska, A.B., Odzijewicz, T., Torres, D.F.M.: Advanced methods in the fractional calculus of variations. Springer Briefs in Applied Sciences and Technology, Springer, Cham (2015) 10. Malinowska, A.B., Torres, D.F.M.: Introduction to the fractional calculus of variations. Imp. Coll. Press, London (2012) 11. Riewe, F.: Nonconservative Lagrangian and Hamiltonian mechanics. Phys. Rev. E (3) 53:2, 1890–1899 (1996) 12. Riewe, F.: Mechanics with fractional derivatives. Phys. Rev. E (3) 55:3, part B, 3581–3592 (1997) 13. Agrawal, O.P.: Fractional variational calculus in terms of Riesz fractional derivatives. J. Phys. A 40:24, 6287– 6303 (2007) 14. Almeida, R., Torres, D.F.M.: Leitmann’s direct method for fractional optimization problems. Appl. Math. Comput. 217:3, 956–962 (2010) arXiv:1003.3088 15. Almeida, R., Torres, D.F.M.: Necessary and sufficient conditions for the fractional calculus of variations with Caputo derivatives. Commun. Nonlinear Sci. Numer. Simul. 16:3, 1490–1500 (2011) arXiv:1007.2937 16. Atanackovi´ c, T.M., Janev, M., Konjik, S., Pilipovi´ c, S., Zorica, D.: Expansion formula for fractional derivatives in variational problems. J. Math. Anal. Appl. 409:2, 911–924 (2014)

Solving Fractional Variational and Optimal Control Problems

15

17. Baleanu, D., Garra, R., Petras, I.: A fractional variational approach to the fractional Basset-type equation. Rep. Math. Phys. 72:1, 57–64 (2013) 18. Bourdin, L., Odzijewicz, T., Torres, D.F.M.: Existence of minimizers for generalized Lagrangian functionals and a necessary optimality condition—application to fractional variational problems. Differential Integral Equations 27:7-8, 743–766 (2014) arXiv:1403.3937 19. Odzijewicz, T., Torres, D.F.M.: The generalized fractional calculus of variations. Southeast Asian Bull. Math. 38:1, 93–117 (2014) arXiv:1401.7291 20. Almeida, R., Khosravian-Arab, H., Shamsi, M.: A generalized fractional variational problem depending on indefinite integrals: Euler-Lagrange equation and numerical solution. J. Vib. Control 19:14, 2177–2186 (2013) 21. Blaszczyk, T., Ciesielski, M.: Numerical solution of fractional Sturm-Liouville equation in integral form. Fract. Calc. Appl. Anal. 17:2, 307–320 (2014) 22. Almeida, R., Torres, D.F.M.: A discrete method to solve fractional optimal control problems. Nonlinear Dynam. 80:4, 1811–1816 (2015) arXiv:1403.5060 23. Pooseh, S., Almeida, R., Torres, D.F.M.: Numerical approximations of fractional derivatives with applications. Asian J. Control 15:3, 698–712 (2013) arXiv:1208.2588 24. Dehghan, M., Hamedi, E.-A., Khosravian-Arab, H.: A numerical scheme for the solution of a class of fractional variational and optimal control problems using the modified Jacobi polynomials. J. Vib. Control, in press. DOI:10.1177/1077546314543727 25. Caputo, M.: Linear models of dissipation whose Q is almost frequency independent. II, Fract. Calc. Appl. Anal. 11:1, 4–14 (2008) 26. Agrawal, O.P.: A general formulation and solution scheme for fractional optimal control problems. Nonlinear Dynam. 38:1-4, 323–337 (2004) 27. Frederico, G.S.F., Torres, D.F.M.: Fractional conservation laws in optimal control theory. Nonlinear Dynam. 53:3, 215–222 (2008) arXiv:0711.0609 28. Frederico, G.S.F., Torres, D.F.M.: Fractional optimal control in the sense of Caputo and the fractional Noether’s theorem. Int. Math. Forum 3:9-12, 479–493 (2008) arXiv:0712.1844 29. Pooseh, S., Almeida, R., Torres, D.F.M.: Fractional order optimal control problems with free terminal time. J. Ind. Manag. Optim. 10:2, 363–381 (2014) arXiv:1302.1717 30. Sweilam, N.H., Al-Ajami, T.M., Hoppe, R.H.W.: Numerical solution of some types of fractional optimal control problems. The Scientific World Journal 2013:306237, 9 pp (2013)