Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

SoftFRAC Matlab Library For Realization

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

SoftFRAC - Matlab Library

for Realization of Fractional Order


Dynamic Elements

Waldemar Bauer(B) , Jerzy Baranowski, Pawel Piatek,


֒
Katarzyna Grobler-Debska,
֒ and Edyta Kucharska

Department of Automatic Control and Robotics, AGH University of Science


and Technology, Al. Mickiewicza 30, 30-059 Kraków, Poland
{bauer,jb,ppi,grobler,edyta}@agh.edu.pl

Abstract. Nowadays, a realization of non-integer (fractional) order ele-


ments on a digital platform is a widely researched problem. The theory
of such dynamic components is relatively well grounded. However, many
problems of implementation on a digital platform are still open. Popu-
lar methods of implementation completely fail when used in real-time
control applications. A need for efficient, numerically robust and stable
implementation is obvious. These types of controllers and filters can be
used in areas like telemedicine, biomedical engineering, signal processing,
control, and many others. In this paper, the authors present the basic
level of preliminary implementation of Matlab library for a realization of
fractional order dynamic elements.

Keywords: Real time computation · Fractional systems ·


Approximation · Computation software · SoftFRAC

1 Introduction
The research of non-integer systems usage blooms. While it gravitates towards
modeling and design aspects, we shouldnt neglect their implementation. For
computer simulation, the popular FOMCON toolbox [20] covers most of the
needs. The real-time control applications need more care especially in the aspects
of numerical stability and errors accumulation. In this paper we present initial
results on a new library - SoftFRAC - which will offer real-time ready solutions.
Popular methods for implementing fractional systems are Oustaloup filter
method [14] and continuous fraction expansion (CFE, see eg. [15,17]). Discretiz-
ing them however causes instability, especially at high sampling frequencies or
approximation orders [16]. For Oustaloup method, thanks to its structural prop-
erties, it is possible to remedy that issue. We discussed its sensitivity and sta-
bility problems during discretization in [4,5] and developed a new method -
Time Domain Oustaloup approximation. Other avenues for warranting numeri-
cal stability require different methods. One approach focused on using Laguerre
c Springer Nature Switzerland AG 2020
A. Bartoszewicz et al. (Eds.): PCC 2020, AISC 1196, pp. 1189–1198, 2020.
https://doi.org/10.1007/978-3-030-50936-1_99
1190 W. Bauer et al.

functions to create an approximation of impulse response [2,19], which was used


among the others in [8–10,13,18]. Other structurally stable approaches include
diffusive realizations, that use quadratures, such works (see [6,12]) result in a
numerical stability, however require high orders for accuracy.
The main contribution of the paper is the introduction and announcement
of the new library - SoftFRAC - which will implement those numerically sta-
ble methods allowing future use in multiple environments and applications and
allow code generation. We describe briefly discussed algorithms and we present
objective implementation in Matlab, inheriting from Control Toolbox standard.
We organize the rest of the paper as follows. First, we present our algorithms
that constitute the core of the library. Then we present the implementation
concepts, especially their object oriented aspects. Finally we present conclusions
and future work.

2 Implementation of Non-integer System in Digital


Environment

In this section we present three efficient methods for approximating fractional


systems, that retain stability when discretized.

2.1 Time Domain Approximation

The non-integer transfer function sγ have to be approximated with an integer


order function. The Oustaloup continuous integer order approximation is given
by Eq. (1) (see [14]):
N
γ
 s + ωk′
s ≈K , γ > 0, (1)
s + ωk
k=1

where poles, zeros and gain can be evaluated as:

ωk′ = ωmin ωu(2k−1−γ)/N


ωk = ωmin ωu(2k−1+γ)/N
γ
K = ωmax

ωmax
ωu =
ωmin
(2)

Approximation is designed for frequencies range ω ∈ [ωmin , ωmax ] and N is


the order of the approximation. As one can observe choosing a wide band of
approximation results in large ωu and high order N result in spacing of poles
spacing from close to −ωh to those very close to −ωb . This spacing is not linear
(there is a grouping near −ωb ) and causes problems in discretisation process.
This approach is to realize every block of the transfer function (1) in form of
a state space system. Those first order systems will be then collected in a single
SoftFRAC 1191

triangular matrix resulting in full matrix realization. This continuous system of


differential equations will be then discretized.
For zero initial condition we can transform Oustaloup approximation to state
space system (see [7]):
⎡ ⎤ ⎡ ⎤
A1 0 0 . . . 0 KB1
⎢ B2 A2 0 . . . 0 ⎥ ⎢ KB2 ⎥
⎢ ⎥ ⎢ ⎥
⎢ B3 B3 A3 . . . 0 ⎥
ẋ = ⎢ ⎥ x + ⎢ KB3 ⎥ u
⎢ ⎥
⎢ .. .. .. . . .. ⎥ ⎢ .. ⎥ (3)
⎣ . . . . . ⎦ ⎣ . ⎦
BN BN . . . BN AN KBN
y = 1 1 . . . 1 1 x + Ku

where

Ak = − ωk
Bk = ωk′ − ωk
Ck = 1
Dk = 1

or in brief
ẋ = Ax + Bu
(4)
y = Cx + Du
What can be immediately observed is that the matrix A is triangular. This is
an extremely important in the case of this problem, as all its eigenvalues (poles
of transfer function (1) are on its diagonal, so there is no need for eigenvalue
products, which would lead to rounding errors. That is why discretization of (3)
should have a structure preserving property.

2.2 LIRA – Laguerre Impulse Response Approximation Method

Due to the need to obtain approximation of non-integer order systems preserving


numerical stability, a new method was developed, for the first time in [1].
Designed method can be applied for transfer functions in the form
qm sγm + qm−1 sγm−1 + . . . q0
ĝ(s) = (5)
sσn + pn−1 sσn−1 + . . . p0

for qk , γk , pl−1 , σl ∈ R, k = 1, 2, . . . , n, l = 1, 2, . . . , n and m > n.


Whose time domain response to a signal u is given by the convolution oper-
ator (for more details see [11])
t

y(t) = (u ∗ g)(t) = u(t − θ)g(θ)dθ (6)


0
1192 W. Bauer et al.

where g(t) is an inverse Laplace transform of ĝ(s). it was shown that for bounded
g(t) ∈ L1 (0, ∞) ∩ L2 (0, ∞) solution (6) can be approximated by a solution of a
system of linear ordinary differential equation.
Approximating system has a form (for approximation order n + 1, x =
T
ξ0 . . . ξn ):
ẋ(t) = Ax(t) + Bu(t)
(7)
y(t) = Cx(t)

⎨−µ, i = j


with matrices A = [aij ], aij = −2µ, i > j , B = [bi ], bi = 2µ, C = [cj ],

0, otherwise

cj = βj where βk is given
√  k  
2µ k k
βk = c (µ)ĝ (k−j) (µ) (8)
k! j=0 j j

where ckj are given recursively ckj (µ) = k−j+1 k k k


2μ cj−1 , c0 (µ) = (2µ) , j =
0, 1, . . . , k. The point of the method is to approximate an impulse response
of system (5) with a finite series of orthonormal Laguerre functions. In [2] it was
shown, that the approximation is convergent both in L1 and L2 function space
norms.
It was also shown, that parameter µ should be chosen as
n

µ = arg max βk2 (µ) (9)
k=0

2.3 Diffusive Realization of Non-integer Order Integrator


Diffusive realization of non-integer order integrator was researched it is based
on the relationship, see [21]:

1 sin γπ 1 1
= dx (10)
sγ 0 π xγ s + x
In this way it is possible to remove the non-integer power of a complex variable
s and use the approximation
∞ n
sin γπ 1 1  bi
γ
dx ≈ (11)
0 π x s+x i=0
s + xi

where the coefficients of the sum are calculated on the basis of numerical quadra-
tures. In the works [3,6] the convergence of such approximation was analyzed
using both quadrature for finite [6] and infinite [3] intervals.
Analysis of these results has concluded that since the approximation of (11)
is the sum of the first order lowpass filters, the approximation quality will depend
SoftFRAC 1193

on their time constants. Because we are interested in good frequency represen-


tation for different orders of magnitude, the following transformation has been
proposed

x = 10θ
For the interval x ∈ [10δ1 , 10δ2 ] (the unconstrained space can not be used because
of the large scattering of values) integration is reduced to
δ2
sin γπ 1
log(10)10θ(1−γ) dθ. (12)
π s + 10θ
δ1

This integral, although the integrand is more complex, allows the balance of all
frequencies (high and low) to be balanced.
The Gauss-Legendre quadrature and Clenshaw-Curtis quadrature were ana-
lyzed in this context. In both cases the formulas for approximation coefficients
have the same form, i.e.

xj = 10xj
sin γπ ∗ (13)
bj = log(10)10xj (1−γ) wj∗
π
where for ∗ appropriately GL or CC has to be inserted. The diference is in
determination of weights and nodes of quadratures. In case of Gaussa-Legendre
quadrature they are
xGL
j = λ(T )
GL 2
(14)
wj = 2v1j
where
0 √ 1 ... 0 0
⎡ ⎤
1−2−2
⎢√ 1 0 ... 0 0 ⎥
⎢ 1−2−2 ⎥
1⎢ .. .. .. .. .. ..⎥ −1
T = ⎢ . . . . . .⎥ = V diag(λ(T ))V

2⎢
⎣ 0 0 ... 0 √ 1
⎢ ⎥
1−n−2

0 0 ... √ 1 0
1−n−2

while V = [vij ]n×n . The disadvantage of this algorithm is the computational


complexity of the complexity of solving the eigenproblem of matrix T .
In case of Clenshaw-Curtis, nodes are
π
xCC
j = cos j , j = 0, 1, . . . , n (15)
n
and are Chebyshev nodes of second kind. Weights wCC = w0CC w1CC . . . wnCC
are computed using inverse fast fourier transform

w∗ = ifft(g + v) (16)
1194 W. Bauer et al.

where v = [vk ]1×n+1 , g = [gk ]1×n+1 , and


⎧ 2 n
⎪ vk = , k = 0, 1, . . . , − 1,
1 − 4k 2 2




n−3


v[n/2] = − 1, (17)

⎪ 2[n/2] −1
 
n−1



⎩ vn−k = vk , k = 1, 2, . . . ,
⎪ ,
2
⎧ n
CC
⎪ g k = − w 0 , k = 0, 1, . . . , − 1,


⎪ 2
v[n/2] = w0CC [(2 − mod(n, 2))n − 1],

(18)
 
n−1


⎩ vn−k = gk , k = 1, 2, . . . , ,


2

while w0CC = (n2 − 1 + mod(n, 2))−1 . The advantage of this quadrature is that
it significantly reduces the computational complexity of the coefficients, equal
to the complexity of the fast Fourier transform.

3 Implementation of Matlab Library to Realization


Fractional Order Dynamic Elements

Object-oriented programming (OOP) refers to a computer programming in


which programmers define not only the data type of data structure but also
the operations (functions) that can apply to the data structure. This approach
improves the ability to manage software complexity, particularly important when
developing and maintaining large applications and data structures. The concepts
and rules used in object-oriented programming provide these important benefits:

– The concept of a data class makes it possible to define subclasses of data


objects that share some or all of the main class characteristics is called inher-
itance. This property of OOP reduces development time and ensures more
accurate coding.
– Since a class defines only the data it needs to be concerned with, when an
instance of that class (an object) is run, the code will not be able to acciden-
tally access other program data.
– The concept of data classes allows a programmer to create any new data type
that is not already defined in the language itself.

OOP capabilities of the MATLAB language enable develop complex techni-


cal computing applications. In Matlab environment we can define classes and
apply standard object-oriented design patterns, inheritance, encapsulation, and
reference behavior without engaging in the low-level housekeeping tasks required
by other languages.
SoftFRAC 1195

3.1 SoftFRAC
Developed library SoftFRAC on this moment gives user functionality to cre-
ate state-space fractional model and transfer function fractional model of the
non-integer dynamic element sα based on approximations described in second
section. State-space fractional model class (ssf) inherit from standard state-
space model class (ss) and have all functionality of this class. While transfer
function fractional model class (ssf) inherit form transfer function model. In
both cases to standard properties added variables described approximation:

Fig. 1. Inherit and structure of class ssf.

– alpha - derivative order,


– omega min - approximation frequency lower band,
– omega max - approximation frequency upper band,
– approximation order - approximation order

In classes we implemented the method to convert between the approxima-


tion methods described in Sect. 2. Because we used inheritance mechanism in
1196 W. Bauer et al.

implementation, the user can use all functionalities of parent classes ss and tf.
In particular, user can use this realization to Simulink simulation, system behav-
ior analysis and easy plotting of dynamic characteristics. Additional to we have
added to the classes a construction method for easy conversion between those
types, from ssf to ssf and vice versa. UML diagram of the ssf class implemen-
tation is presented in the Fig. 1.
Interface implementation of ssf class presents Matlab code:
classdef ssf < ss
properties
alpha
omega min
omega max
approximation order
end

methods
f u n c t i o n o b j = s s f ( alpha , . . .
a p p r o x i m a t i o n o r d e r , omega min , . . .
omega max , Ts )
end

function obj = convert2Lira ( obj )


end

f u n c t i o n obj = convert2Oustaloup ( obj )


end

f u n c t i o n o b j = c o n v e r t 2Q u d r a t u r e ( o b j )
end
end
end

4 Conclusion
This paper present early stages of realization of the project SoftFRAC “Devel-
opment of efficient computing software for simulation and application of non-
integer order systems”. The aim of the project is to develop a commercialization
concept and carry out the development work to use the results of the already
completed project “Designing and applying subsystems of a fraction of order
in control systems”. The essence of the planned commercialization is software
that allows the implementation of non-integer order systems (regulators, filters)
in real automation and signal processing systems. Competing (and available
in open source form) software is characterized by either low accuracy or lack
of numerical stability. SoftFRAC relies on algorithms developed as part of the
SoftFRAC 1197

completed project, which are characterized by high numerical robustness and


scalable accuracy. The initial potential recipients were defined as academic units
(supporting research on fractional differential equations and methods of design-
ing control systems) and innovative industry (new methods of signal processing
and robust control).
Presented here are only initial results on object-based implementation in
Matlab. Our main goal however is to develop a fully multi-platform library,
using additionally Python and C allowing rapid prototyping, code generation
and real time control applications. Finished software will include graphical user
interfaces, for model exploration, analysis and conversion. Our intention is, that
the results of the project at least in some form will be freely available to the
academic community.

Acknowledgment. Work partially realized in the project “Development of efficient


computing software for simulation and application of non-integer order systems”,
financed by National Centre for Research and Development with TANGO programme.

References
1. Bania, P., Baranowski, J.: Laguerre polynomial approximation of fractional order
linear systems. In: Mitkowski, W., Kacprzyk, J., Baranowski, J. (eds.) Advances
in the Theory and Applications of Non-integer Order Systems: 5th Conference on
Non-integer Order Calculus and Its Applications, Cracow, Poland, pp. 171–182.
Springer (2013)
2. Bania, P., Baranowski, J., Zagórowska, M.: Convergence of Laguerre impulse
response approximation for non-integer order systems. Math. Prob. Eng. 2016,
13 (2016). https://doi.org/10.1155/2016/9258437. Article ID 9258437
3. Baranowski, J.: Quadrature based approximations of non-integer order integra-
tor on finite integration interval. In: Babiarz, A., Czornik, A., Klamka, J., Niez-
abitowski, M. (eds.) Theory and Applications of Non-integer Order Systems, Lec-
ture Notes in Electrical Engineering, vol. 407, pp. 11–20. Springer International
Publishing (2017). https://doi.org/10.1007/978-3-319-45474-0 2
4. Baranowski, J., Bauer, W., Zagórowska, M.: Stability properties of discrete time-
domain oustaloup approximation. In: Domek, S., Dworak, P. (eds.) Theoretical
Developments and Applications of Non-Integer Order Systems, Lecture Notes in
Electrical Engineering, vol. 357, pp. 93–103. Springer International Publishing
(2016). https://doi.org/10.1007/978-3-319-23039-9 8
5. Baranowski, J., Bauer, W., Zagórowska, M., Dziwiński, T., Piatek, ֒ P.: Time-
domain Oustaloup approximation. In: 2015 20th International Conference On
Methods and Models in Automation and Robotics (MMAR), pp. 116–120. IEEE
(2015)
6. Baranowski, J., Zagórowska, M.: Quadrature based approximations of non-integer
order integrator on infinite integration interval. In: 2016 21st International Con-
ference On Methods and Models in Automation and Robotics (MMAR) (2016)
7. Bauer, W., Baranowski, J., Dziwiński, T., Piatek,
֒ P., Zagórowska, M.: Stabilisa-
tion of magnetic levitation with a PIλ Dμ controller. In: 2015 20th International
Conference On Methods and Models in Automation and Robotics (MMAR), pp.
638–642. IEEE (2015)
1198 W. Bauer et al.

8. De Keyser, R., Muresan, C., Ionescu, C.: An efficient algorithm for low-order direct
discrete-time implementation of fractional order transfer functions. ISA Trans. 74,
229–238 (2018)
9. Kapoulea, S., Psychalinos, C., Elwakil, A.: Single active element implementation of
fractional-order differentiators and integrators. AEU - Int. J. Electron. Commun.
97, 6–15 (2018)
10. Kawala-Janik, A., Bauer, W., Al-Bakri, A., Haddix, C., Yuvaraj, R., Cichon, K.,
Podraza, W.: Implementation of low-pass fractional filtering for the purpose of
analysis of electroencephalographic signals. Lect. Notes Electr. Eng. 496, 63–73
(2019)
11. Monje, C.A., Chen, Y., Vinagre, B.M., Xue, D., Feliu, V.: Fractional-order sys-
tems and controls: Fundamentals and applications. Advances in Industrial Control.
Springer-Verlag, London (2010)
12. Monteghetti, F., Matignon, D., Piot, E.: Time-local discretization of fractional
and related diffusive operators using gaussian quadrature with applications. Appl.
Numer. Math. (2018)
13. Mozyrska, D., Wyrwas, M.: Stability of linear systems with Caputo fractional-,
variable-order difference operator of convolution type (2018)
14. Oustaloup, A., Levron, F., Mathieu, B., Nanot, F.M.: Frequency-band complex
noninteger differentiator: characterization and synthesis. IEEE Trans. Circuits
Syst. I Fundam. Theory Appl. 47(1), 25–39 (2000)
15. Petráš, I.: Fractional-Order Nonlinear Systems: Modeling, Analysis and Simulation.
Nonlinear Physical Science. Springer (2011)
16. Piatek,
֒ P., Zagórowska, M., Baranowski, J., Bauer, W., Dziwiński, T.: Discretisa-
tion of different non-integer order system approximations. In: 2014 19th Interna-
tional Conference on Methods and Models in Automation and Robotics (MMAR),
pp. 429–433. IEEE (2014)
17. Podlubny, I.: Fractional Differential Equations: An Introduction to Fractional
Derivatives, Fractional Differential Equations, to Methods of Their Solution and
Some of Their Applications. Mathematics in Science and Engineering. Elsevier
Science (1998)
18. Rydel, M., Stanislawski, R., Latawiec, K., Galek, M.: Model order reduction of
commensurate linear discrete-time fractional-order systems. IFAC-PapersOnLine
51(1), 536–541 (2018)
19. Stanislawski, R., Latawiec, K.J., Galek, M., L  ukaniszyn, M.: Modeling and identifi-
cation of fractional-order discrete-time laguerre-based feedback-nonlinear systems.
In: Latawiec, K.J., L  ukaniszyn, M., Stanislawski, R. (eds.) Advances in Modelling
and Control of Non-integer-Order Systems, Lecture Notes in Electrical Engineer-
ing, vol. 320, pp. 101–112. Springer International Publishing (2015)
20. Tepljakov, A., Petlenkov, E., Belikov, J.: FOMCON: a MATLAB toolbox for
fractional-order system identification and control. Int. J. Microelectron. Comput.
Sci. 2, 51–62 (2011)
21. Trigeassou, J., Maamri, N., Sabatier, J., Oustaloup, A.: State variables and-
transients of fractional order differential systems. Comput. Math. Appl. 64(10),
3117–3140 (2012). https://doi.org/10.1016/j.camwa.2012.03.099. http://www.
sciencedirect.com/science/article/pii/S0898122112003173. Advances in FDE, III

You might also like