## 1. Introduction

Fractional calculus is a generalization of traditional differential calculus for cases in which orders of the differentiation and integration are real or even complex numbers. The theoretical background for this calculus can be found in [

1,

2,

3,

4].

Fractional calculus was found to be extremely useful when modeling the dynamics of diffusive systems. Especially interesting cases are the anomalous diffusion ones and are described by power law

${\sigma}_{r}^{2}\sim \lambda {t}^{\alpha}$, where

${\sigma}_{r}$ stands for mean squared displacement,

$\lambda $ is the diffusion coefficient, and

t is the elapsed time. Whenever

$\alpha =1$ the process is a normal diffusion, if

$\alpha <1$ or

$\alpha >1$, we get a sub or super-diffusion process. The heat transfer is a typical diffusion problem and its modeling based on fractional calculus for a solid beam was presented in [

5]. Other authors dealt with the idea of the heat diffusion process in non-homogeneous fractal media (e.g., [

6,

7]) or even a diffusion of information in social networks [

8].

Other good examples of successful modeling are ultracapacitors—electrical devices with outstanding capacity in relation to their dimensions and that are widely used as storage devices in power-electronics. The energy storage process in these devices is based on diffusion of ions; that is why fractional-order models are more accurate than the integer-order ones [

9]. As it was presented in [

10], both in low and high frequencies, ultracapacitors can be modeled by fractional-order integrators but with different values of the order; i.e., for high frequencies the order is close to 0.5 and for low frequencies it is close to 1. More results on modeling ultracapacitors can be found in [

11]. Using fractional-order models on ultracapacitors allows us to examine some interesting phenomena, such as different values of resonance frequency (equality of imaginary parts of impedance) and maximum value of current, as was presented in [

12]. Dependency between fractional-order of the model and operating temperature was presented in [

13] and the dependency between charging and discharging processes was presented in [

14]. Aforementioned cases motivate the usage of variable-order calculus that would describe such phenomena of changing the properties of the model in time. In [

15] a variable fractional order operator was used to model nano-silver paste by characterizing both tensile and shear behaviors and demonstrating the evolution of mechanical properties. In [

16] a fractional variable-order equivalent circuit was used to model Li-ion batteries from an electric vehicle. The paper [

17] presents the determination of the relationship between the fractional order and electrode aging, and uses the variable fractional order as an indicator for electrode aging.

The variable-order case is more complicated and less intuitive than the integer-order one. There exist at least six different main types of variable-order derivative definition [

18,

19,

20], but only four of them have corresponding switching schemes, which are input-reductive, input-additive, output-reductive, and output-additive ([

21,

22,

23]). The corresponding switching schemes allow one to better understand the behavior of order the changing process for each of the definitions. It also allows us to build analog models that can be useful for validation of simulation results due to a limited number of analytical solutions.

Non-intuitive behavior of variable-order operators is that the order composition generally does not occur; e.g., the composition of two variable-order operators with additive inverse orders does not result with an order 0, and in the consequence, is an original function. However, the iterative and recursive variable-order definitions are connected together by duality property. As it was presented in [

24], only for the compositions of particular type definitions and opposite signs of orders, it is possible to obtain the expected result—an original function. This occurs when two corresponding iterative and recursive (dual) definitions are taken into consideration.

It is also possible to define a case where the way that the order changes in time (type of variable-order definition) also changes in time. In such a case we have to consider the fractional variable-type and order differences that can also have different manners of changing (different definitions). Preliminary results, introducing the so-called iterative

$\mathfrak{A}$-,

$\mathfrak{B}$-, and recursive

$\mathfrak{D}$ and

$\mathfrak{E}$-type operators, have been considered in [

25,

26,

27]. Corresponding switching schemes, based on the duality property, were given also and proven. In [

28] analog realization for iterative

$\mathfrak{B}$-type definition has been presented and validated. However, in order to obtain analog realization, a parallel switching scheme had to be introduced and investigated, because a typical switching scheme in the form of an integrator chain was unable to realize in practice. In this paper, a practical realization of a particular case of

$\mathfrak{D}$-type definition is proposed and validated.

The paper is organized as follows. In

Section 2, both fractional variable-order and fractional variable-type difference definitions are recalled.

Section 3 presents the

$\mathfrak{D}$-type variable-order difference definition, and in

Section 3.1 the main results—the practical realization method for switching between

$\mathcal{B}$- and

$\mathcal{D}$-type definitions is proposed. In

Section 4, experimental validation of proposed scheme is presented. Finally, conclusions of the results and possibilities for future work are given.

Appendix A contains short discussion about extension of this method for other order changing strategies.

## 2. Fractional Constant-Type Variable-Order Differences

In this section, we present some already known fractional constant and variable-order difference definitions of constant-type, which will be used for further considerations.

where

and

The Grünwald–Letnikov difference presented in iterative form (

1) can be rewritten in the following equivalent recursive form [

22]

where

Definitions for variable-order case presented below exhibit different behavior; however, for constant order all of them are equivalent to Definition 1. The first one is obtained by replacing a constant order

$\alpha $ by variable order

${\alpha}_{k}$. The

$\mathcal{A}$-type of fractional variable-order difference is given by

where

The second definition assumes that coefficients for past samples were obtained for an order that was present for these samples. The

$\mathcal{B}$-type of fractional variable-order difference is given by

where

Besides the above iterative definitions, we use also the following recursive type of variable-order difference definitions.

The

$\mathcal{D}$-type of fractional variable-order difference is given by

where

The

$\mathcal{E}$-type of fractional variable-order difference is given by

where

Using matrix representation of (

8), which is presented and described in detail in [

23], the

$\mathcal{E}$-type difference in recursive form given in (

8) can be rewritten in the following iterative form [

29]:

where

and for

$r=1,\dots ,k$
where for

$s=1,\dots ,r$## 4. Analog Model of $\mathfrak{D}$-Type Variable-Type and Order Operator

The realization of

$\mathfrak{D}$ fractional variable-type and order operator directly based on conceptual scheme is depicted in

Figure 3. In this case, the duality property requirement can be omitted. Thus, the main parts of the analog model are

Data acquisition card dSPACE 1104;

Half-order impedances deeply described in [

22], denoted as

${Z}_{1}$ and

${Z}_{2}$;

Operational amplifiers TL071 denoted as ${A}_{1},{A}_{2},{A}_{3}$ and ${A}_{4}$;

Analog switches DG303 denoted as ${S}_{1}$ and ${S}_{2}$;

Resistors $R=100$ k$\Omega $.

As can be seen, the fractional orders depend on impedances

${Z}_{1}$,

${Z}_{2}$ and positions of switches

${S}_{1}$,

${S}_{2}$. Due to the use of the operational amplifiers

${A}_{1}$,

${A}_{3}$ in inverted input configuration, it was necessary to add the supplementary ones denoted as

${A}_{3}$ and

${A}_{4}$ with gain

$-1$. Obviously, such analog model corresponds to the system in continuous-time domain. However, considering the digital nature of A/D and D/A converters of dSPACE card and constant time step

h, which was used to collect all experimental data, it can be considered as a discrete model given by Equation (

13). Moreover, to fulfill the simplified switching definition concept presented in

Figure 1, the switches

${S}_{1}$ and

${S}_{2}$ change their terminals in the following scenario

It gives the varying order

${\alpha}_{k}$ and system parameter

${\lambda}_{k}$ equal to

#### Experimental Results

It is worth noting that an origin of the investigated analog model was analytically proved. Based on it, the behavior of said system corresponds to $\mathfrak{D}$ fractional variable-type and order operator, regardless of input signal. The entire experiment was carried out with time-varying parameters, and to emphasize the equivalence of experimental and numerical data, the Heaviside step function form of input signal was chosen.

Moreover, the sampling time plays a major role during discretization process. Decreasing of sampling time leads the data to be more accurate and it negatively affects the computation process. On the other hand, increasing of sampling time cause the inaccuracies in data but it makes the computation process less time-consuming. Thus, the sampling time should be carefully chosen to keep balance between data accuracy and computational time. Since the electrical circuit is a continuous-time system, the sampling time exerts an impact only on the data acquisition process.

The experimental data were collected with time sampling of

$h=0.001$ s and input signal equal to

${V}_{in}\left(t\right)=0.5H\left(t\right)$, where

$H\left(t\right)$ is a Heaviside step function. It yields the following equation

where

and system parameters, such as

${\alpha}_{k}$ and

${\lambda}_{k}$ are forced by the switch configuration given by (

14) and are described by (

15), for

${\alpha}_{1}=-0.5$,

${\alpha}_{2}=-1$,

${\lambda}_{1}=1.33$,

${\lambda}_{2}=1.76$,

${t}_{1}=0.3$, and

${t}_{2}=0.6$.

A comparison between experimental data and their numerical implementation based on duality property (see

Figure 1a) is presented in

Figure 4. Moreover, in the same figure, the error between two sets of data is shown as well. By analyzing the step responses in

Figure 4, it can be seen that until first switching time

${t}_{1}=0.3$ s, we can observe the step response of half-order integrator. Furthermore, until time

${t}_{2}=0.6$ s, the system response corresponds to the

$\mathcal{B}$-type of fractional variable-order definition, where order

$\alpha $ has been switched from

$0.5$ to 1. Additionally, starting with time

${t}_{2}$, the switching method is equivalent to

$\mathcal{D}$-type of fractional variable-order definition, where order

$\alpha $ has been switched from 1 to

$0.5$. Such combined switching process composes the

$\mathfrak{D}$ fractional variable-type and order definition with high accuracy.