{'fraction_non_alphanumeric': 0.06845193320294869, 'fraction_numerical': 0.016849706634571988, 'mean_word_length': 4.393509127789047, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Combined Fractional Variational Problems of Variable Order and Some Computational Aspects

We study two generalizations of fractional variational problems by considering higher-order derivatives and a state time delay. We prove a higher-order integration by parts formula involving a Caputo fractional derivative of variable order and we establish several necessary optimality conditions for functionals containing a combined Caputo derivative of variable fractional order. Because the endpoint is considered to be free, we also deduce associated transversality conditions. In the end, we consider functionals with a time delay and deduce corresponding optimality conditions. Some examples are given to illustrate the new results. Computational aspects are discussed using the open source software package Chebfun.


Introduction
Fractional Calculus (FC) is an extension of the integer-order calculus that considers derivatives of any real or complex order [15,30]. FC was born in 1695 with a letter that L'Hôpital wrote to Leibniz, where the derivative of order 1/2 is suggested [26]. Since then, many mathematicians, like Laplace, Riemann, Liouville, Abel, among others, contributed to the development of this subject. One of the first applications of fractional calculus was due to Abel in his solution to the tautochrone problem [2]. Different forms of fractional operators have been introduced along time, like the Riemann-Liouville, the Riesz or the Caputo fractional derivatives. For new kinds of fractional derivatives with nonsingular kernels, see [1]. In this paper, we are interested on the combined Caputo derivative C D α,β γ [21], which is a convex combination of the left Caputo fractional derivative of order α and the right Caputo fractional derivative of order β.
In recent times, FC had an increasing of importance due to its applications in various fields, not only in mathematics, but also in physics, engineering, chemistry, biology, finance and other areas of science [18,23,27,32,33]. In some of these applications, if we compare with the usual integer-order calculus, FC is better to describe the hereditary and memory properties of materials and processes. More interesting possibilities arise when one considers the order α of the fractional integrals and derivatives not constant during the process but depending on time. One such fractional calculus of variable order was introduced in 1993 by Samko and Ross [31]. Afterwards, several mathematicians obtained important results about variable order fractional calculus, see, for instance, [7,24,29]. Here, we consider the combined Caputo fractional derivative of a function x with variable order, defined by C D α(·,·),β(·,·) γ x(t) = γ1 C a D α(·,·) t x(t) + γ2 C t D β(·,·) b x(t) with γ = (γ1, γ2) ∈ [0, 1] 2 . Some numerical approximate formulas for such fractional calculus have been proposed, see, for example, [17,35].
The Fractional Calculus of Variations (FCV) deals with the optimization of functionals that depend on some fractional operator [4,20,22]. The fundamental problem is to find functions that extremize (minimize or maximize) such a functional. Although FCV was born only twenty years ago, with the 1996-1997 works of Riewe in mechanics [28], in ours days, this is a strong field of mathematics: see, e.g., [5,6,21,22,36]. The main goal of our work is to generalize the results obtained in [34] by considering higher-order and time delay variational problems with a Lagrangian depending on a combined Caputo derivative of variable fractional order, subject to boundary conditions at the initial time t = a.
The outline of the paper is as follows. In Section 2, we review the necessary notions on fractional calculus and prove an integration by parts formula, involving a higher-order Caputo fractional derivative of variable order (see Theorem 2.7). In Section 3, we obtain higher-order Euler-Lagrange equations and transversality conditions for the generalized variational problems with a Lagrangian depending on a combined Caputo derivative of variable fractional order (Theorem 3.1). Then, in Section 4, we deduce necessary optimality conditions when the Lagrangian depends on a time delay. Some illustrate examples are presented in Section 5. We end with Section 6 of conclusion and an appendix with our MATLAB code.

Fractional calculus of variable order
In this section, we review some concepts about the operators that are used in the sequel. For more information about the theory of fractional calculus, see, for example, [15,30].
The Gamma function Γ is an extension of the factorial to real numbers, while the Beta function B is For numerical computations, we have used MATLAB [19] and Chebfun [38]. Both functions Γ(t) and B(t, u) are available in Matlab through the commands gamma(t) and beta(t,u), respectively. This second function satisfies the property B(t, u) = Γ(t)Γ(u) Γ(t + u) .
Motivated by Definitions 2.3 and 2.5 of [20], we present here the concepts of higher-order fractional derivatives of Riemann-Liouville and Caputo. Let n ∈ N and x : [a, b] → R be a function of class C n . The fractional order is a continuous function of two variables, αn : [a, b] 2 → (n − 1, n).
In our work, we use both Riemann-Liouville and Caputo definitions. The emphasis is, however, in Caputo fractional derivatives.
Definition 2 (Higher-order Caputo fractional derivatives). The left and right Caputo fractional derivatives of order αn(·, ·) are defined by respectively.
Remark 1. Definitions 1 and 2, for the particular case of order between 0 and 1, can be found in [20]. They seem to be new for the higher-order case.
Chebfun is a MATLAB software system that overloads MATLAB's discrete operations for matrices to analogous continuous operations for functions and operators [38]. Using Definition 2, we implemented in Chebfun two functions leftCaputo(x,alpha,a,n) and rightCaputo(x,alpha,b,n) that approximate, respectively, the higher-order Caputo fractional derivatives C a D αn(·,·) t x(t) and  x(t). x(t) with "•−" style, and right derivative C t D α(·,·) b x(t) with "×−" style. x(t) and C t D α(·,·) b x(t).
Now, we define the generalized fractional integrals for variable order.
Our Chebfun definitions of the Riemann-Liouville fractional integrals are given in Appendix A.2. Here we illustrate their use. x(t) with "×−" style.

Remark 2. From Definition 3, it follows that
d n dt n x(t). Next, we obtain higher-order Caputo fractional derivatives of a power function. This allows us to show the effectiveness of our computational approach, that is, the usefulness of polynomial interpolation in Chebyshev points in fractional calculus of variable order. In Lemma 2.4, we assume that the fractional order depends only on the first variable: αn(t, τ ) := αn(t), where αn : [a, b] → (n−1, n) is a given function.

t E A error] end
For our next result, we assume that the fractional order depends only on the second variable: Computational experiments similar to those of Example 2.5, obtained by substituting Lemma 2.4 by Lemma 2.6 and our leftCaputo routine by the rightCaputo one, reinforce the validity of our computational methods.
When dealing with variational problems, one key property is integration by parts. In the following theorem, such formulas are proved for integrals involving higher-order Caputo fractional derivatives of variable order.
Proof. Considering the definition of left Caputo fractional derivative of order αn(·, ·), we obtain b a y(t) C a D αn(·,·) t Using the (usual) integrating by parts formula, we get that (3) is equal to Integrating by parts again, we obtain If we repeat this process n − 2 times more, we get b a x(t)(−1) n d n dt n tI n−αn(·,·) b The second relation of the theorem for the right Caputo fractional derivative of order αn(·, ·) follows directly, from the first, by Caputo-Torres duality [9].
Remark 3. If we consider in Theorem 2.7 the particular case when n = 1, then the fractional integration by parts formulas take the following well-known forms The next step is to consider a linear combination of the previous fractional derivatives. x(t).
Analogously, the higher-order combined Caputo fractional derivative of x at t is defined by C D αn(·,·),βn(·,·) γ n See our Chebfun computational code for the higher-order combined fractional Caputo derivative in Appendix A.3. Here we illustrate how to use it in MATLAB.
Consider the following problem of the calculus of variations: minimize functional J : D → R, x(t), . . . , C D αn(·,·),βn(·,·) γ n x(t) . We assume that the Lagrangian L : [a, b] × R n+1 → R is a function of class C 1 . Along the work, we denote by ∂iL, i ∈ {1, . . . , n + 2}, the partial derivative of the Lagrangian L with respect to its ith argument. Now, we can rewrite functional (4) as In the sequel, we need the auxiliary notation of the dual fractional derivative: In [34], we obtained fractional necessary optimality conditions that every local minimizer of functional J , with n = 1, must fulfill. Here, we generalize [34] to arbitrary values of n, n ∈ N.  (4)). Suppose that (x, T ) gives a minimum to functional (5) on D. Then, (x, T ) satisfies the following fractional Euler-Lagrange equations: on the interval [a, T ], and on the interval [T, b]. Moreover, (x, T ) satisfies the following transversality conditions: Proof. The proof is an extension of the one found in [34]. Let h ∈ C n ([a, b]) be a perturbing curve and △T ∈ R an arbitrarily chosen small change in T . For a small number ǫ ∈ R (ǫ → 0), if (x, T ) is a solution to the problem, we consider an admissible variation of (x, T ) of the form (x + ǫh, T + ǫ∆T ), and then, by the minimum condition, we have that J (x, T ) ≤ J (x + ǫh, T + ǫ∆T ). The constraints a imply that all admissible variations must fulfill the conditions h (i) (a) = 0, for all i = 0, . . . , n − 1. We define function j(·) on a neighborhood of zero by The derivative j ′ (ǫ) is Hence, a necessary condition for (x, T ) to be a local minimizer of j is given by j ′ (0) = 0, that is, Considering the second addend of the integral function (9), for i = 1, we get Integrating by parts (see Theorem 2.7), and since h(a) = 0, we obtain that Unfolding these integrals, and considering the fractional operator D β 1 ,α 1 γ 1 with γ 1 = (γ 1 2 , γ 1 1 ), then the previous term is equal to T a h(t)D β 1 (·,·),α 1 (·,·)

Now, consider the general case
. . , n. Then, Unfolding these integrals, we obtain Substituting all the relations into equation (9), we obtain that The fractional Euler-Lagrange equations (6)-(7) and the transversality conditions (8) follow by application of the fundamental lemma of the calculus of variations (see, e.g., [39]), for appropriate choices of variations.

Variational problems with time delay
In this section, we consider fractional variational problems with time delay. As mentioned in [37], "We verify that a fractional derivative requires an infinite number of samples capturing, therefore, all the signal history, contrary to what happens with integer order derivatives that are merely local operators. This fact motivates the evaluation of calculation strategies based on delayed signal samples". This subject has already been studied for constant fractional order [3,8,13,14]. However, for a variable fractional order, it is, to the authors' best knowledge, an open question. We also refer to the works [10,11,16,40], where fractional differential equations are considered with a time delay. For simplicity of presentation, we consider fractional orders α, β : [a, b] 2 → (0, 1). Using similar arguments, the problem can be easily generalized for higher-order derivatives. Let σ > 0 and define the vector σ [x] α,β γ (t) = t, x(t), C D α(·,·),β(·,·) γ x(t), x(t − σ) . For the domain of the functional, we consider the set x(t) exists and is continuous on [a, b] .
Let J : D → R be the functional defined by subject to the boundary condition x(t) = ϕ(t) for all t ∈ [a − σ, a], where ϕ is a given (fixed) function. Again, we assume that the Lagrangian L and the payoff term φ are differentiable functions and we denote, Theorem 4.1 (Necessary optimality conditions for (11)). Suppose that (x, T ) gives a local minimum to functional (11) on Dσ. If σ ≥ T − a, then (x, T ) satisfies for t ∈ [a, T ], and γ2 aD If σ < T − a, then Eq. (12) is replaced by the two following ones: Proof. Consider variations of the solution (x + ǫh, T + ǫ∆T ), where h ∈ C 1 ([a−σ, b]) is such that h(t) = 0 for all t ∈ [a − σ, a], and ǫ, △T are two reals. If we define j(ǫ) = J (x + ǫh, T + ǫ∆T ), then j ′ (0) = 0, that is, First, suppose that σ ≥ T − a. In this case, since and h ≡ 0 on [a − σ, a], this term vanishes in (17) and we obtain Eq. (5) of [34]. The rest of the proof is similar to the one presented in [34, Theorem 3.1], and we obtain (12)- (14). Suppose now that σ < T − a.
In this case, we have that Next, we evaluate the integral For the first integral, integrating by parts, we have Chebfun is an open source software package that "aims to provide numerical computing with functions" in MATLAB [19]. For the mathematical underpinnings of Chebfun, we refer the reader to [38]. For the algorithmic backstory of Chebfun, we refer to [12]. In this appendix, we provide our own Chebfun code for the variable order fractional calculus.