Fractional calculus involves among the others application of fractional order derivatives (FOD) and fractional order integrals (FOI), which order can assume a real or a complex value. Thus derivatives and integrals of integer order can be considered as one of special cases of fractional calculus.
Fractional derivatives can be calculated using numerous approaches which include Riemann-Liouville fractional derivative (RL) and Caputo fractional derivative (C) [1]. The latter definition is often preferred for simulations of real world processes and systems in a form of fractional differential equations (FDE) [2, 3] due to its ability to accept initial conditions in terms of integer order values. Riemann-Liouville fractional derivative definition does not have this practical application advantage and thus is mostly applied for theoretical considerations. However, regarding the subject of the paper, the substantial difference between RL and C definitions lies in the method of their computation: RL method involves repeated integration of a function and then differentiation of the resulting function with an integer order; C method attempts to arrive at the same result using the same operations, but in the reverse order. Thus using direction terms we can call RL and C left-hand and right-hand definitions, respectively.
The aim of the paper is to compare computational accuracy of fractional derivatives by applying the left-hand and the right hand definitions.
To fulfill this goal we have divided the paper in the following subsections: first there are presented formulas for fractional derivatives computation. The second subsection explains the terms left-hand and right-hand. The next one contains brief description of problems associated with FOD/FOI computation and presents numerous numerical methods which are applied for fractional derivatives computation. Difficulties associated with FOD/FOI application include computation of reference values required for accuracy assessment. Thus, the next section presents formulas and methods for their computation. The section after that one is devoted to computational accuracy comparison of the right- and left-hand definitions. It includes detailed results for computation of FOD for some functions in various ranges and short comment about it. The paper ends with conclusion which summarize the reasons for applying a particular definition for FOD computation.
The following formulas are applied for FOD/FOI computations. To differentiate between fractional and integer orders, fractional orders are commonly denoted by the Greek letters
Riemann-Liouville fractional integral for
Riemann-Liouville fractional derivative for
and
Caputo fractional derivative
with conditions
formulas (2) or (3) and (4) are related by
Placing C formula (4) in the right side of equation (5) enables obtaining an equivalent Riemann-Liouville fractional derivative formula [4].
In formulas (1)-(6)
As it was stated in introduction, the reason for selecting such a naming schema for RL and C formulas is due to the method of their computation: first we select order
Having selected both numbers, we can calculate fractional derivative using left-hand definition presented in figure 1 and formulas (2) and (3). Here we first integrate a function with order
By applying right-hand definition presented in figure 2 and formula (4) and (6) we attempt to arrive at the same results in the reverse order: first we calculate
Riemann-Liouville fractional order derivative and integral and Caputo fractional order derivative formulas (1)-(6) consist of an ordinary integral. However, the integral is difficult to compute due to presence of a singularity at the end of integration interval that is preceded by rapid values increase. Similarly to the term used for such occurrence in the world of differential equations, it will be called
The stiffness can increase or decrease correspondingly to the values of the exponent in the integrand in formulas (1)-(6) and characteristics of a function. However, it is the stiffness and the singularity presence that determine the accuracy of integral computation.
To compute fractional order derivatives and integrals by applying formulas (1)-(6) there can be applied commonly used methods of numerical integration, e.g. midpoint rule, trapezoidal rule, gauss quadratures of a general use, etc. However, their accuracy and effectiveness are heavily decreased by the presence of the singularity and the stiffness. Additionally, computation of FOD/FOI of the fractional orders near integer orders (e.g. 0 and 1) of any function is usually burdened with several hundred percent relative error. Thus we can say that none of commonly applied methods of integration can be considered as methods of general use for the purpose of computing FOD/FOI with high accuracy independently of order and interval.
To increase computational accuracy of FOD/FOI, either an applied method of numerical integration must be adapted to handle a difficult integrand properly or an integrand must be transformed to fit into the requirements of an applied numerical method of integration. Furthermore replacing standard double precision computer arithmetic with arbitrary precision for numerical integration enables increasing many times the overall accuracy of computation.
In our papers [5, 6] we presented two-way approach for computation accuracy increase of FOD/FOI, which included integrand transformation and adaptation of Gauss-Jacobi quadrature weight function with significant additional accuracy increase obtained by applying the GNU GMP [7] and the GNU MPFR [8] arbitrary precision mathematical libraries with C++ MPFR C++ interface [9] for programming.
For the reason of its high-accuracy abilities, efficiency and versatility, Gauss-Jacobi quadrature with adapted weight function is applied for the purpose of accuracy comparison of the FOD/FOI right- and left-hand definitions.
Application of Gauss quadratures enables solving efficiently problems associated with singularities and infinite limits by approximating an integrand and its difficult features by using polynomials. Wherein, particular polynomial is selected according to its properties to address a specific problem encountered in an integrand. If that is the case, the application of one of the Gauss quadratures assures high accuracy integration with a few sampling points.
Application of a Gauss quadrature (except for Gauss-Legendre quadrature) enables removing a problematic area or feature of an integrand from the integration and computing it by applying the formulas for the weights of a quadrature. However, Gauss quadratures can only be applied to a specific types of integrands, which is conditioned by the linkage to their weight functions.
By applying Gauss-Jacobi quadrature with the weight function
general formula of an approximate calculation of definite integral
can be expressed as
in which
We can use this property for FOD/FOI computation.
Removing kernel from an integrand
substituting
where
Transforming the interval [0,
where
we obtain a formula (10) for Gauss-Jacobi quadrature (8) that is perfectly suited for FOD/FOI computation by applying formulas (1)-(6), i.e. kernel in integrand is not integrated but computed by applying the formula for the weights
From now on Riemann-Liouville fractional derivative formula (6) assumes the following computational form
in which
The ordinarily sufficient method of Gauss quadrature application is reduced to the use of tabulated values of nodes and weights. They are freely available and easy to incorporate into a computer program [10]. However, its application becomes difficult if nodes and weights must be customized and computed, e.g. if the integrand does not meet fully or at all the requirements of a quadrature or required integration interval is different than foreseen for a quadrature. In all of the cases nodes and weights must be computed prior the integration.
Customized variants of the Gauss-Jacobi quadrature (9) for computation of FOD/FOI by applying formulas (1)-(6) require computation of polynomial of order
Existing approaches for computing the nodes and the weights, some of which have been widely used for many years, suffer from
Fractional order derivative calculation by applying formulas (1)-(6) requires computation of
First derivative 3-points stencil Central Difference
where
Second derivative 3-points stencil Central Difference
Third derivative 3-points stencil Central Difference
The limiting factor to the accuracy of computation by applying the formulas (1)-(6) is a precision which uses the computer to store data that are being supplied to it.
The selection of uniform C++ equipped with the standard mathematical library as a main programming tool is not enough nowadays to take full advantage of available hardware. The application of arbitrary precision computing for increasing accuracy and correctness of numerical calculations and Nvidia CUDA parallelization technology for their effectiveness, are the best examples in this context [14].
Application of arbitrary precision makes it possible for the user to choose precision for calculation and for each variable storing a value. It is not machine-depended or IEEE standard types. With its help we can - among the others - increase general accuracy of mathematical computations. However, its application purpose is above all to increase accuracy of numerical calculations, e.g. by eliminating under- and overflows, increasing accuracy of a polynomial zeros finding and derivative and integral calculating.
The importance of elimination of limited precision in computer calculations was aptly presented by Toshio Fukushima in
Double precision computer arithmetic is optimized for speed and has many flaws which negatively influence the accuracy of computations, e.g. limitations of number values which double precision variables can hold or no programmer influence on mathematical operations rounding.
However, it is the lack of clarity in handling of intermediate results which troubles the most, i.e. the floating-point standard [16] only defines that the results must be rounded correctly to the destination’s precision and fails to define the precision of destination variable. This choice is commonly made by a system or a programming language. The user can not influence it in any way. Therefore, the same program can return significantly different results depending on the implementation of the IEEE standard.
Arbitrary precision is applied in conjunction with special libraries which include their own data structures and mathematical functions.
Accuracy and the efficiency assessment are crucial components in the process of programming because it enables examining a program for its proper operation and accuracy.
Common approach to the accuracy assessment requires an exact value.
In case of FOD/FOI computation, an effective accuracy assessment is difficult, sometimes not possible due to general lack of formulas for exact values.
Despite the availability of a handful of analytical formulas for fractional order
The following formulas for FOD/FOI are used further in the paper for calculations of their exact values:
Trigonometric functions:
Power functions
Exponential function
In practice ∞ is replaced by large number
In our work we have to be able to assess the accuracy of FOD/FOI computation of any function. Thus we have developed a method of accuracy assessment by applying operators concatenation [17] of fractional order differentiation and integration.
The main idea behind this versatile criteria presented in Figure 3 is the ability to compare computed values of FOD/FOI with values of classical - integer order derivatives and integrals, which can be calculated by applying well known (and accurate) formulas.
To compare computational accuracy of FOD we apply right- and left-hand definitions schemas presented in Figures 1 and 2 to obtain FOD of order
To compare computational accuracy of FOD we use relative error and infinity norm ||
Tables 1-4 contain maximum relative error between vectors
Function (18) Function (19) Function (20) Function (21) N 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 ←d 4 2.92e-11 3.05e-19 8.04e-06 8.04e-06 1.22e-03 1.22e-03 1.60e-08 1.06e-08 8 2.92e-11 6.89e-43 1.64e-13 2.66e-15 1.07e-04 1.07e-04 2.01e-13 3.60e-21 16 2.92e-11 5.21e-66 1.66e-13 3.91e-39 2.26e-05 2.26e-05 2.01e-13 2.19e-51 32 2.92e-11 5.21e-66 1.66e-13 1.39e-65 2.91e-06 2.91e-06 2.01e-13 1.03e-64 64 2.92e-11 1.16e-66 1.66e-13 1.96e-64 3.07e-07 3.07e-07 2.01e-13 1.54e-64
Function (18) Function (19) Function (20) Function (21) N 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 ←d 4 1.24e-14 1.76e-21 2.33e-06 2.33e-06 1.22e-02 7.99e-02 2.81e-09 2.81e-09 8 1.24e-14 2.07e-45 1.62e-13 4.28e-11 4.16e-02 4.16e-02 1.67e-13 3.52e-22 16 1.24e-14 5.52e-67 1.62e-13 3.43e-40 2.13e-02 2.13e-02 1.67e-13 1.13e-52 32 1.24e-14 8.05e-68 1.62e-13 4.29e-65 1.07e-02 1.07e-02 1.67e-13 4.45e-67 64 1.24e-14 1.38e-67 1.62e-13 3.65e-65 5.43e-03 5.43e-03 1.67e-13 4.37e-66
Function (18) Function (19) Function (20) Function (21) N 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 ←d 4 7.38e-10 3.56e-17 2.13e-09 6.78e-19 1.22e-03 1.22e-03 5.41e-05 5.41e-05 8 7.38e-10 7.38e-30 2.13e-09 2.13e-29 1.07e-04 1.07e-04 1.62e-11 1.59e-11 16 7.38e-10 7.38e-30 2.13e-09 2.13e-29 2.26e-05 2.26e-05 2.51e-13 4.60e-32 32 7.38e-10 7.38e-30 2.13e-09 2.13e-29 2.91e-06 2.91e-06 2.51e-13 2.51e-33 64 7.38e-10 7.38e-30 2.13e-09 2.13e-29 3.07e-07 3.07e-07 2.51e-13 2.51e-33
Function (18) Function (19) Function (20) Function (21) N 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 ←d 4 6.54e-15 6.14e-15 3.90e-15 3.93e-15 nan nan 1.08e-04 1.08e-04 8 6.54e-15 6.14e-15 3.90e-15 3.93e-15 nan nan 6.16e-13 3.57e-13 16 6.54e-15 6.14e-15 3.90e-15 3.93e-15 nan nan 2.53e-13 5.86e-15 32 6.54e-15 6.14e-15 3.90e-15 3.93e-15 nan nan 2.53e-13 5.86e-15 64 6.54e-15 6.14e-15 3.90e-15 3.93e-15 nan nan 2.53e-13 5.86e-15
Results presented in tables 1-4 confirm shape of integrand as the main factor which determines accuracy of FOD computation. The term ”shape of integrand” describes the behavior of a function in a given interval. In this scope: if we say ”dramatical shape changes of integrand”, we mean certain behavior of a function, in which the values of its derivatives (1
The integrand included in RL and C formulas can be divided into a kernel and a function, i.e.
The kernel, which includes singularity determines difficulty of FOD/FOI computation. By applying Gauss-Jacobi quadrature for computation, it is possible to exclude the kernel from numerical integration and compute it by applying formulas for the weights of the quadrature (9) which assures significantly higher accuracy. However, results presented in tables 1-4 show that the accuracy can also be decreased by the shape of the function. For this reason an amount of sampling points (N) required for highest accuracy of FOD for a particular function varies from 4 to 64.
Accuracy of integer order numerical differentiation depends mainly on the width of sampling step of a function. As it is easy to see, the width required for the highest accuracy is beyond the capabilities of the standard double precision computer arithmetic. In this scope, an application of high precision libraries for programming is required. How many points are included is of secondary importance. However, 3-points stencil central difference is an optimum for the most cases. More points does not increase the accuracy.
FOD can be computed by using numerous approaches. It includes application of integer order differentiation of fractional order integral (Riemann-Liouville formula) or fractional order integration of integer order derivative (Caputo formula).
The goal of numerical experiment described in the paper was to compare accuracy of FOD computation by applying both approaches.
During the experiment we calculated FOD of selected orders for exponential, power and periodic functions in various ranges.
As it was mentioned in the problem description, computation of FOD with high accuracy is a real challenge for the computer and it can not be succeed by applying standard numerical methods. For this purpose it is required application of Gauss-Jacobi quadrature with adapted weight function for integration part and central differences method of higher order for integer order differentiation. Additionally, the standard double precision C++ programming language limitations were eliminated by applying for programming arbitrary precision with a help of mathematical libraries (GNU MPFR/GNU GMP and MPFR C++).
The resulting conclusion is that high accuracy computation of FOD can be achieved by applying both approaches (RL and C), provided the appropriate numerical method of integration and differentiation is used. However, due to the fact that accuracy of numerical integration and differentiation generally depends on a shape of a function, by applying an appropriate sequence of numerical calculations (RL or C formula) selected according to a shape of a particular function, can result with significantly higher accuracy.
An important advantage of RL formula over C formula is its capability of computing FOD of function which
Remark: To be able to apply C formula for computation of FOD for any function, it is required to apply equivalent Riemann-Liouville formula (6).