A Convergent Legendre Spectral Collocation Method for the Variable-Order Fractional-Functional Optimal Control Problems

. In this paper, a numerical method is applied to approximate the solution of variable-order fractional-functional optimal control problems. Te variable-order fractional derivative is described in the type III Caputo sense. Te technique of approximating the optimal solution of the problem using Lagrange interpolating polynomials is employed by utilizing the shifted Legendre–Gauss–Lobatto collocation points. To obtain the coefcients of these interpolating polynomials, the problem is transformed into a nonlinear programming problem. Te proposed method ofers a signifcant advantage in that it does not require the approximation of singular integral. In addition, the matrix diferentiation is calculated accurately and efciently, overcoming the difculties posed by variable-order fractional derivatives. Te convergence of the proposed method is investigated, and to validate the efectiveness of our proposed method, some examples are presented. We achieved an excellent agreement between numerical and exact solutions for diferent variable orders, indicating our method’s good performance.


Introduction
Nowadays, fractional calculus, a branch of mathematics that studies the properties of derivatives and integrals of noninteger order, is essential due to its increasing applications in the sciences and engineering.Particularly, mathematical modeling of phenomena based on fractional calculus has proven to exhibit more realistic behavior [1][2][3][4].
A mild solution for a control problem governed by fractional stochastic evolution inclusion using the Caputo derivative with nonlocal conditions was proved by Abuasbeh et al. [5] via the fxed-point theorem of convex multiplevalued maps.
In [6], Khan et al. address the issue of resilient base containment control for fractional-order multiagent systems (FOMASs) that have mixed time delays.Niazi and his colleagues [7] prove the existence of a solution for an initial value problem involving a hybrid fractional diferential equation with delay.
In recent years, solving optimal control problems governed by a fractional dynamical system has become one of the most popular topics in control theory, and it has encouraged many researchers to come up with an efcient numerical approach to solving them.A new method for fnding the approximate solution of fractional optimal control problems with the Caputo-Fabrizio (CF) fractional integro-diferential equation is presented in [8].Tis method is based on the Gegenbauer polynomials defnition and utilizes the modifed operational matrix of the CF-fractional derivative.In [9], Heidari and Razzaghi attempted to solve two classes of fractional optimal control problems (OCPs) with delay.Teir approach involves using the Legendre-Gauss collocation method and extended Chebyshev cardinal wavelets to solve the Hamilton-Jacobi-Bellman equation numerically.Ghanbari and Razzaghi [10] have proposed a new numerical method to solve fractional optimal control problems (FOCPs).Teir method is based on generalized fractional-order Chebyshev wavelets (GFOCW) and the incomplete beta function.A Fibonacci wavelet operational matrix and the Galerkin method were used by Sabermahani and Ordokhani [11] to solve fractional optimal control problems with equal and unequal constraints.In [12], authors use modifed hat functions as basic functions to approximate control and state variables.Te properties of these basis functions, the Caputo derivative and the Riemann-Liouville integral simplify the FOCP to nonlinear algebraic equations.For more study, see also the related works [13][14][15].
Recently, the variable-order fractional optimal control problems have attracted the attention of many researchers.Tis is because variable-order fractional calculus ofers greater fexibility in selecting the most appropriate order for accurately describing real-world problems.Heydari et al. [16] used a method based on the Chebyshev cardinal functions and Lagrange multipliers to reduce the problem to a system of algebraic equations.An efcient method was presented by Heydari and Avazzadeh [17] through the Legendre wavelets and their operational matrix of variableorder fractional integration in the Riemann-Liouville sense.Hassani et al. [18] examined two-dimensional variable-order fractional optimal control problems.Using the transcendental Bernstein series and extending problem variables based on these series, they transformed the optimal control problem into a simple optimization problem.Bhrawy and Zaky in [19] proposed a method using shifted Chebyshev polynomials and an operational matrix to approximate the solution of a variable-order fractional functional Dirichlet boundary value problem.
Te novelty of our work lies in the fact that there is no study on the numerical solution of variable-order fractionalfunctional optimal control (VOFFOC) problems, and we look at this issue for the frst time.Te purpose of this paper is to present a numerical scheme that will be able to approximate the VOFFOC problem efciently.Our scheme is based on the Legendre spectral collocation methods and reduces the problem into a nonlinear programming (NLP) problem.
Te structure of the paper is as follows.In Section 2, some necessary preliminaries are given.In Section 3, a new direct method is described to solve the VOFFOC problems.Section 4 discusses the convergence of the proposed method.In Section 5, some numerical examples are given to show the method's efciency.Finally, the conclusions and suggestions are presented in Section 6.

Some Preliminaries
In this section, we present some basic defnitions and mathematical preliminaries related to the fxed-order and variable-order fractional integrals and derivatives [20].Defnition 1.Consider the function χ(.) defned on the fnite interval [0, T].For fxed-order ε > 0, the left and right RL fractional integrals are 0 I ϵ t χ(t) and t I ε T χ(t) and are defned by ( ( ( We now present the basic concepts of variable-order fractional calculus and consider the fractional order in the derivative and integral to be a continuous function on (0, T).First, we introduce the generalization of a fxed-order fractional integral called the variable-order Riemann-Liouville integral.Defnition 4. Assuming that the continuously diferentiable function χ is defned on (0, T).Te left and right Riemann-Liouville fractional integrals of order ε(.) are defned as follows: Defnition 5. Assume that χ: [0, T] ⟶ R is a continuously diferentiable function and ε: [0, T] ⟶ [0,1] is a given function.

Implementation of the Method for VOFFOC Problem
In this paper, we consider the following VOFFOC problem where and V(t) are the state and control variables, respectively, ε: is the type III Caputo VOFD operator.We assume that there exists a smooth optimal solution (Y * (.), V * (.)) for the above VOFFOC problem.We are going to propose a convergent and efcient method to approximate the optimal solution.In implementing the method, we use the following Lagrange interpolating polynomials where t i for i � 0, 1 . . ., N are the shifted Legendre-Gauss-Lobatto (SLGL) points.Tese points can be given by t i � T/2(τ i + 1), where τ i are the roots of polynomials where J N (t) is the Legendre polynomial of degree N defned by the following recurrence formula on interval [−1, 1] Te Lagrange polynomials have the useful delta Kronecker property, i.e., Now, we approximate the variables of the problem ( 9) and (10) in terms of the Lagrange interpolating polynomials as follows: where � y � (� y 0 , � y 1 , . . ., � y N ) and � v � (� v 0 , � v 1 , . . ., � v N ) are unknown coefcients.With the interpolation property of the Lagrange interpolating polynomials, we obtain Also, to approximate the VOFD of state variable Y(.), we gain So, at the collocation points, we have where for k � 1, 2, . . ., N and j � 0, 1, . . ., N Here, we defne the type III Caputo VOF diferentiation matrix as Note that the elements of matrix diferentiation F ε can not be directly and exactly calculated by relation (11).Some Jacobi-Gauss quadrature formulas can be used for approximating the singular integral in (19) and for obtaining the matrix diferentiation.But, here, we are going to present an exact and efcient method to gain this matrix.In the presented method, we use Lemma 6 and the properties of interpolating polynomials, and we do not need to approximately calculate a singular integral.
We will use the following theorem to approximate the objective functional (9).Lemma 7. Consider a polynomial p(.) of degree at most (2N − 1), on the interval [0, T].We have where t k   N k�0 are the SLGL points on [0, T] and Proof.It can be gained by employing the transformation x � 2t/T − 1 in Teorem 3.29 of [21].

Convergence Analysis of the Method
In this section, we analyze the convergence of the method.We frst rewrite the problem (29) and (30) as the following equivalent form: where Y N (t .) and V N (t .) satisfy (15).We assume the problem (31) and (32) (or equivalently (29) and (30)) is feasible.
Assumption 8. We assume that the optimal solution of VOFFOC problem (1) and ( 2) has a Lagrange interpolating polynomial (based on the SLGL points), which uniformly converges to it.

Numerical Examples
To show the feasibility and validity of the presented scheme, we implement the numerical method mentioned above in three examples and utilize the FMINCON command in MATLAB software and SQP algorithm to solve the corresponding NLP problem (29) and (30).Also, we defne the absolute error based on the following relations: where (Y, V) and (Y N , V N ) are the exact and approximate solutions, respectively.
Example 1.Consider the following VOFFOC problem Journal of Mathematics where ϵ: [0, 1] ⟶ [0, 1] is an arbitrary continuous function.Te functions t 2 and −t 4 are the optimal state and optimal control, respectively.Te corresponding problem (29) and (30) can be given as Figure 1 displays the exact solution and the approximate solutions of our proposed method for various values of N. According to this fgure, we can see that the numerical solutions for diferent values of N correspond to the exact solution.Also, the logarithms of absolute errors for state and control variables for diferent values of ϵ(.) at N � 8 are shown in Figure 2. Results represent that our method has a relatively good performance.
Example 2. As a second example, we consider the following VOFFOC problem where ϵ: [0, 1] ⟶ [0, 1] is an arbitrary continuous function.Te exact optimal solution of this problem is (Y * , V * ) � (t 1.5 , sin(πϵ(t))).We employ our approach to approximate the solutions.Te obtained results are shown in Figure 3 for ϵ(t) � 1 − 0.5(t − t 2 ) and N � 4, 6, 8.In Figure 4, the gained approximate control is given for diferent fractional orders ϵ(.) and N � 8.Moreover, the logarithm of absolute errors is provided in Figures 5 and 6.Te results confrm the accuracy and efciency of the presented approach.
Example 3. Consider the following VOFFOC problem Te exact solution for this system is (Y * , V * ) � (t 2 + 1, t).To solve this problem, we use the proposed method with N � 5, 7, 9 for ϵ(t) � 1 − 0.8 tanh(t) in Figure 7.In Figure 8, the absolute error functions of the state (control) variable with N � 8 and diferent functions of ϵ(t) are plotted.Based on these fgures, we can see that our numerical solutions are excellently in agreement with the exact solution.

Journal of Mathematics
Te exact solution for this system is (Y * , V * ) � (t 2.5 , −t 6 + 15 � � π √ t 2.5− ϵ(t) /8Γ(3.5 − ϵ(t))) and L * � 0. Figure 9 illustrates the approximate solutions of our proposed method for ϵ(t) � 1 − 0.8 tanh(t) with N � 4, 6, 8.In Figure 10, the absolute error functions of the state (control) variable with N � 8 and diferent functions of ϵ(t) are plotted.We can understand from Figure 11 that by increasing the number of collocation points, the error of approximate variables decreases, which indicates the efciency of the presented method.Based on these fgures, we observed an excellent agreement between our numerical solutions and the exact solution.

Conclusions and Suggestions
In this paper, we considered a class of optimal control problems under variable-order fractional functional differential equations.We obtained an approximate solution based on the shifted Legendre pseudospectral collection method.Tis is the frst time that the shifted Legendre pseudospectral collection method has been applied to variable-order fractional-functional problems.Te proposed method accurately and efciently calculates matrix diferentiation, avoiding singular integral approximation and overcoming challenges of variable-order functional fractional derivatives.By implementing this method, the original optimal control problem was transformed into an optimization problem which is easier to solve.Several numerical examples have been examined.We obtained a high level of agreement between the numerical and exact solutions, indicating that our method has good performance.In future studies, the applicability of the mentioned method on other OC problems, such as OC problems under variable-order fractional-functional diferential with delay and variable-order fractional integro-diferential equations, will be investigated.

Figure 2 :
Figure 2: Te logarithm of absolute errors for Example 1 with N � 8.