{'fraction_non_alphanumeric': 0.056736711990111245, 'fraction_numerical': 0.030222496909765143, 'mean_word_length': 4.011148962527098, 'pattern_counts': {'":': 2, '<': 1, '<?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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Shifted ultraspherical pseudo-Galerkin method for approximating the solutions of some types of ordinary fractional problems

In this work, a technique for finding approximate solutions for ordinary fraction differential equations (OFDEs) of any order has been proposed. The method is a hybrid between Galerkin and collocation methods. Also, this method can be extended to approximate fractional integro-differential equations (FIDEs) and fractional optimal control problems (FOCPs). The spatial approximations with their derivatives are based on shifted ultraspherical polynomials (SUPs). Modified Galerkin spectral method has been used to create direct approximate solutions of linear/nonlinear ordinary fractional differential equations, a system of ordinary fraction differential equations, fractional integro-differential equations, or fractional optimal control problems. The aim is to transform those problems into a system of algebraic equations. That system will be efficiently solved by any solver. Three spaces of collocation nodes have been used through that transformation. Finally, numerical examples show the accuracy and efficiency of the investigated method.

Most of these problems and models have no exact solutions. Consequently, the researchers focus on investigating and developing new numerical methods. For OFDEs, in [12] the authors presented a spectral method using shifted Chebyshev polynomials (SCHPs) of the second kind. While in [13], the same authors used the same technique but with the sixth kind of SCHPs. A different technique by using a nonpolynomial spline function was employed in [14,15]. The second kind Wright function with Erdélyi-Kober fractional derivatives was used in [16]. Similar techniques were used for approximating FIDEs. Alternative Legendre functions in [17] were used to set up an operational matrix by the collocation method. In [9], the authors used smoothed pseudo-splines refinable functions to construct Riesz wavelets. And as a direct development of the mentioned methods and algorithms, several methods have been formulated to approximate FOCPs. For details about those methods, refer to [10,18,19].
The spirit in using the spectral method is the choice of the basis function [20,21]. The smoothness properties of the basis functions control the decay rate of the coefficients of expansion. The boundary conditions have no effect on the rate. Unlike the other orthogonal polynomials, ultraspherical polynomials (UPs) are not nearly as popular in use as basis functions [22][23][24]. However, UPs motivate our interest because they include Chebyshev and Legendre polynomials and some other polynomials as subclasses of them [25].
The importance of the Galerkin method (GM) is that, for the presented technique, it can be used for the solution of a wide class of ordinary fractional problems (OFPs). Throughout this work, OFPs are OFDEs, FIDEs, or OCFPs. One of the advantages of GM is that it is not a difficult method. On the other hand, every equation has its own algorithm. The presented technique is a mix of two well-known spectral methods: collocation method [26][27][28] and Galerkin method [29][30][31]. We call that method pseudo-Galerkin method (pseudo-GM).
The work is coordinated as follows: in Sect. 2, we introduce Caputo's fractional derivative. Then, UPs (SUPs) and some of their properties are presented. Finally, the notion of integration matrix (B-matrix) is presented. In Sect. 3, the main results of the paper are stated and proved. Those results give formulae that assert the derivatives of SUPs and the spectral expansion. In Sect. 4, the approximate of OFPs is stated by employing shifted ultraspherical pseudo-GM (SU-pseudo-GM). Then, the error analysis and upper bound for the expansion are estimated in Sect. 5. The correctness and effectiveness of SU-pseudo-GM are proved by different types of OFPs in Sect. 6. The last section "7" contains the conclusion and remarks.

Preliminaries and notations
This section presents some core definitions and concepts needed throughout this paper. We shall begin with the well-known Caputo fractional derivative for the function φ(x) of order δ denoted by D δ (φ(x)): where r -1 ≤ δ < r, r ∈ N.
As a direct result of Eq. (1), we have Besides, one of the advantages of Caputo's fractional derivative is the linearity property. For any two arbitrary constants C 1 and C 2 , For more details about fraction derivatives, refer to the review [32].
Proceeding with the fundamental concepts, some properties of UPs (U ν j (x)) and SUPs (U * ν j (x)), of degree j and real parameter ν > -1 2 , will be presented. UPs are the special case of Jacobi polynomials with analytic form [25]: As special cases: and T j (x) are Legendre and Chebyshev polynomials, respectively.
The set {U * ν j (x)} j forms an orthogonal set w.r.t. the weight function w ν (x) = (xx 2 ) ν-1 2 : where ψ r = π 2 1-4ν (r+2ν) (r+ν) (r+1)( (ν)) 2 . Finally, the expression B-matrix will be presented. This matrix will be used for solving FIDEs and FOCPs. According to the spectral method, let φ(x) be a differential function over the interval [0, 1]. Then φ(x) can be approximated using M + 1 points as follows [36]: where such that: T * m (x) is the SCHP of degree m, c 0 = c M = 0.5 and c m = 1 for m = 1, 2, . . . , M -1, x r = 0.5 * (1 -cos rπ M ) are the shifted Chebyshev points (SCH-points). From Eq. (7) and Eq. (8), we get According to El-Gendi [37], from Eq. (9), where are the elements of the B-matrix. Equation (10) and Eq. (11) can be written in the matrix form: In the next section, some important theorems and lemmas are investigated. These theorems are needed in the process of SU-pseudo-GM. As mentioned before, this method is used to solve several types of fractional problems.

Shifted ultraspherical pseudo-Galerkin method (SU-pseudo-GM)
The first step, some rules and forms of UPs need to be shifted. Rodrigueś (Eq. (4)) formula is generalized in the shifted form Thus, SUPs can be obtained from Eq. (5) or Eq. (12). The next lemma will be used to introduce a general form for the fractional derivative and the integer order integration of SUPs.
Proof Straightforward using Eq. (3) and the binomial theorem.
The following corollary proves the fractional derivatives of SUPs in the Caputo sense.

Corollary 2
The fractional derivatives of SUPs in the Caputo sense of order δ are as follows: Proof Using Lemma 1 and the results from Eq. (2).
The next theorem will establish the general form of the SUPs approximation of a function φ(x). This form is used in SU-pseudo-GM.
where {A m } are unknown constants to be determined later and Proof Let φ(x) be approximated as follows: So, by the assumption in the theorem, and Substituting by U * ν 0 (x) and U * ν 1 (x) and using Eq. (6), we obtain Both of the equations (16) and (17) represent the s+1 derivative of φ(x). Thus the following equation must be satisfied: and choose a set of constants {θ m } as defended in (14).

SU-pseudo-GM for solving OFPs
This section is divided into three subsections. Each section concerns solving a different type of OFP. Also, an algorithm for each problem has been added "Algorithm 1, Algorithm 2, and Algorithm 3". Before proceeding to the techniques of the solution, the "M+1" collection points must be chosen. Throughout this paper three spaces of points are used. The set of equally spaced points "S 1 ": while the second is Gauss quadrate points "S 2 ", i.e., the zeros of SUPs: The last set is the SCH-points "S 3 ": "S 3 " is used specially for solving FIDEs.

Solving OFDEs by SU-pseudo-GM
Consider OFDEs as follows:
Step 7 : Use the above steps to substitute into Eq. (21).
Step 8 : Collocating the result of step 7 according the choice of step 3.
Step 9 : As done in step 5, expand the boundary conditions (22).
Step 10: Solve the obtained system from step 8 and step 9 to calculate {A m } M 0 .
Step 11: Substitute into Eq. (23) to get the approximate solution.
such that where Using the straightforward differentiation in the sense of Corollary 2 leads to Also, the initial and boundary conditions (22) have series expansion of the form Substitute from Eqs. (23) and (24)
Step 7 : Use the above steps to substitute into Eq. (26).
Step 9 : Collocating the result of step 7 together with the integration matrix in step 8.
Step 10: As done in step 5, expand the boundary conditions.
Step 11: Solve the obtained system from step 9 and step 10 to calculate {A m } M 0 .
Step 12: Substitute into Eq. (23) to get the approximate solution.

Solving FIDEs by SU-pseudo-GM
Herein, the SU-pseudo-GM for solving OFDEs is extended to some types of FIDEs. Consider the following FIDE: under a sufficient number of initial conditions according to δ. By applying the expansion described at Eq. (23), we obtain where s = 0, 1, . . . , M. Replacing the integration in Eq. (27) by the B-matrix (10) gives As in the previous section, the obtained Eq. (28) is an algebraic system. The linearity of that system depends on the linearity of the function F.

Solving FOCPs by SU-pseudo-GM
Finally, we proceed to approximating the FOCP that takes the form under the conditions
Step 9 : Collocating the result of step 7 together with the integration matrix in step 8.
Step 11: Solve the obtained optimization problem from step 9 and step 10 to calculate {A m } M 0 and the optimal value J .

Step 12: Substitute into Eq. (23) to get the approximate solutions of φ(x) and u(x).
where c 1 , c 2 ∈ R. By taking both techniques that are included in the last two subsections, the FOCP is transformed into a regular optimization problem.

Error analysis
The convergence and the error analysis for using SUPs are inevitable. Theorems and concepts for these aspects are investigated in [34,35].
Proof For the proof, see [38].
The next section proves the effectiveness and correctness of SU-pseudo-GM by solving different types of OFPs.

Numerical examples
In this section, numerical examples of SU-pseudo-GM are presented. The results to those obtained are compared with other methods and the exact solution.  1.6e-05 64 [40] 4.0e-14 16 6 SU-pseudo-GM 5.5e-12 20 [39] 6.5e-05 64 [40] 1.0e-08 16 Example 1 Consider the linear OFDE According to Sect. 4.1, the maximum absolute error (MAE) for SU-pseudo-GM and MAE for others are presented in Table 1 and Table 2. These tables show the demonstration of SU-pseudo-GM over the methods in [39] and [40] for all values of c and the parameter ν for the two spaces S 1 and S 2 at different values of M, while Fig. 1 represents the convergence at an exponential rate using S 3 .

Example 2 Consider the nonlinear OFDE
Applying the technique discussed in Sect. 4.1, we obtained the pointwise absolute error (PW-AE) shown in Table 3 for δ = 0.5 and Table 4 for δ = 0.7. Comparisons between SU-pseudo-GM "at different values of ν", the neural network method (NNM) in [41], the differentiated radial basis function method (DRBF) in [42], and the integrated radial basis function method (IRBF) in [42] have been done. From both tables we recognize that: • SU-pseudo-GM is more accurate and efficient than NNM in [41] for the presented values of the parameter ν, δ = 0.5, 0.7 and both spaces S 1 and S 2 .  • Using the equidistance space S 1 , SU-pseudo-GM is of almost the same accuracy as DRBF and IRBF methods in [42] for the presented values of the parameter ν and δ = 0.5, 0.7. • For δ = 0.5, SU-pseudo-GM got the same accuracy as DRBF and IRBF methods in [42] at ν = 0.49 using the S 2 space. • For δ = 0.5, SU-pseudo-GM is more accurate than DRBF and IRBF methods in [42] for ν = 1 and ν = -0.49 using the S 2 space. • For δ = 0.7, SU-pseudo-GM is more accurate and efficient than DRBF and IRBF methods in [42] for the presented values of the parameter ν using the S 2 space. • The values of the parameter ν do not affect the results while using S 1 . During the process of approximation, we recognized that the results were not affected by changing the values of parameters ν at the small values of M.
SU-pseudo-GM reaches the double-precision (e-16) as MAE only at M = 3 using any space. While in [43], MAE varies from e-04 to e-05 by increasing M from 10 to 40.
On the other hand, the authors in [44] investigated four methods. They treated the same problem with the first and fourth methods. The authors had to increase M to 256. But they only reached e-08 for the first method and e-05 for the fourth method.
In this example, we have to use the space S 3 to meet the conditions of the B-matrix. The method in [45] solved Eq. (32) and got 9.5e-04 as MAE at M = 5. Also, [46] solved it at the same number of points but by three methods. MAE were 1.9e-02, 9.8e-0.3, and 9.8e-0.3 for the three methods. While the MAE of SU-pseudo-GM is 7.0e-04 using M = 5 too. The authors in [46] increased M to increase the accuracy. Their best MAE was 10 -4 at   Table 5. The stability and convergence rate are shown in Fig. 2.
Example 5 Consider the nonlinear FIDE (Volterra-Fredholm type) subject to the boundary conditions of mixed type φ(0) + φ (0) = 0 and φ(1) The boundary conditions of mixed type do not affect the steps. They are just two extra equations added to the algebraic system. The PW-AE of this example using SU-pseudo-GM and two other methods in [47] is written in Table 6. The first method in [47] is "Nystrom", while the second method depends on the wavelet. This method used the two parameters m and k for the approximation. So, 2 k-1 m is the equivalent number of iterations. The following observations have been noted from Table 6. This first method in [47] approximates the solution to 10 -5 as PW-AE at M = 16. But SU-pseudo-GM got the same PW-AE at M = 5 only. On the other hand, PW-AE decreases from 10 -6 to 10 -2 as x changes from 0.1 to 0.9 by using "Nystrom" at M = 16. The double-precision "10 -16 " was reached

Figure 3
The LogError for Example 5 using S 3 using SU-pseudo-GM at M = 16 for all the domain points. Figure 3 ensures the accuracy, stability, and convergence rate for SU-pseudo-GM.
According to the integration "from 0 to 1", all spaces"S 1 , S 2 , S 3 " may be used. The same technique is applied. In the past examples we got algebraic systems to solve. But in the case of FOCP, the problem is transformed into an optimization problem.
The best result is J = 4.1280e -17 at "M = 2" when "ν = -0.49" using "S 2 " with run time 0.019. The results of SU-pseudo-GM have been compared with the results from [18,19,48]. In [18], the authors used wavelet expansion. They got J = 4.7187e -06 using six Table 7 Optimality value "J ", MAE of the state function "φ(x)" and the control function "v(x)" for Example 6 using S 1 when ν = 0.49   iterations with run time 0.046. While in [19], J = 6.16e -16 but at M = 4 with run time 0.030 and in [48], J = 5.44e -08 at M = 9 as best results. Table 7 compares the results obtained by SU-pseudo-GM when ν = 0.49 using S 1 with results from [48]. These comparisons show the accuracy and the efficiency of SU-pseudo-GM for solving FCOPs.
By applying the same steps, Table 8 summarizes the best results of J , MAE of the state function φ(x), and MAE of the control function v(x). All those results are compared with the methods in [18,19,49,50]. The obtained results prove the high correctness and effectiveness of SU-pseudo-GM. Figure 4 shows the stability of the optimality value.

Figure 4
The optimal value J (x) for Example 7 using S 3 at ν = -0.49

Conclusion
A general method developed from GM has been introduced in this work. This method uses SUPs as trails functions. We call this method SU-pseudo-GM. New formulae for the spectral expansion and fractional derivatives of SUPs have been proved. This method can handle several types of OFPs. Finally, SU-pseudo-GM was used to solve several examples. As shown in those examples, the method was easy to apply in FODEs, IFDEs, and FOCPs. To show and prove the high correctness of that method, several graphs have been constructed. Also, comparisons with other methods have been done. Three spaces have been used in the examples. The results show that the quadrature points (S 2 ) are slightly more accurate than the equidistant Riemann points (S 1 ).