UNIVERSIDADE TÉCNICA DE LISBOA
INSTITUTO SUPERIOR TÉCNICO
Ninteger v. 2.3
Fractional control toolbox
for MatLab
Duarte Pedro Mata de Oliveira Valério
User and programmer manual
Beta release — comments and bug reports are welcome
2005 / 08 / 17
NINTEGER V. 2.3 — FRACTIONAL CONTROL TOOLBOX FOR MATLAB
Abstract
Ninteger is a toolbox for MatLab intended to help to develop fractional order
controllers and assess their performance. This manual contains a thorough description of
all files in version 2.3 of this toolbox.
Keywords
Fractional order calculus, fractional order control, MatLab.
Table of contents
1. Introduction..........................................................................................................3
1.1. Requirements ................................................................................................3
1.2. Installation procedure....................................................................................3
1.3. How files are organised.................................................................................4
1.4. About this manual .........................................................................................4
2. Approximations of fractional order derivatives and integrals..............................6
2.1. Function nid ..................................................................................................6
2.2. Function nipid .............................................................................................15
2.3. Function crone1 ..........................................................................................17
2.4. Function newton..........................................................................................19
2.5. Function matsudaCFE ................................................................................22
2.6. Obsolescent functions .................................................................................24
3. Functions ensuring a real fractional order behaviour for the open-loop............25
3.1. Function crone2 ..........................................................................................25
3.2. Function crone2z.........................................................................................30
4. Functions ensuring a complex fractional order behaviour for the open-loop....35
4.1. Function crone3 ..........................................................................................35
5. Identification of fractional models.....................................................................46
5.1. Function hartley..........................................................................................46
5.2. Function levy...............................................................................................47
5.3. Function vinagre .........................................................................................49
5.4. Function sanko............................................................................................51
5.5. Function lawro............................................................................................52
6. Analysis and norms............................................................................................55
6.1. Function freqrespFr....................................................................................55
6.2. Function bodeFr..........................................................................................56
6.3. Function nyquistFr......................................................................................57
6.4. Function nicholsFr......................................................................................58
6.5. Function sigmaFr........................................................................................59
6.6. Function normh2Fr.....................................................................................60
6.7. Function normhinfFr...................................................................................64
7. Graphical interface.............................................................................................66
7.1. User manual ................................................................................................66
7.2. Programmer manual....................................................................................74
8. Simulink.............................................................................................................85
8.1. Block Fractional derivative........................................................................85
8.2. Block Fractional PID .................................................................................86
9. Functions for continued fractions ......................................................................88
1
NINTEGER V. 2.3 — FRACTIONAL CONTROL TOOLBOX FOR MATLAB
9.1. Function contfrac........................................................................................88
9.2. Function contfracf.......................................................................................89
9.3. Function contfraceval .................................................................................90
9.4. Function contfracfeval ................................................................................91
10. Final Remarks ..................................................................................................92
Bibliography...........................................................................................................93
Appendix................................................................................................................96
Table of figures
Figure 1. Nichols charts with curves of constant values of closed-loop gain and damping
coefficient................................................................................................................36
Figure 2. The main dialog of ninteger before being filled in. .........................................66
Figure 3. Example of an error message...........................................................................67
Figure 4. Dialogue nipidGui filled in. .............................................................................67
Figure 5. The main dialogue displaying a Bode diagram................................................68
Figure 6. Dialogue crone2Gui.........................................................................................70
Figure 7. Dialogue crone3Gui1.......................................................................................71
Figure 8. Dialogue crone3Gui1 filled in. ........................................................................72
Figure 9. Dialogue crone3Gui2 filled in. ........................................................................72
Figure 10. Two views of resulting dialogue ninteger......................................................73
Figure 11. Simulink library .............................................................................................85
Figure 12. Dialogue of block Fractional derivative........................................................86
Figure 13. Dialogue of block Fractional PID.................................................................87
2
NINTEGER V. 2.3 — FRACTIONAL CONTROL TOOLBOX FOR MATLAB
1. Introduction
Ninteger is a toolbox for MatLab intended to help developing fractional order
controllers and assess their performance. Its code may be freely distributed and altered
provided that the source of the code is acknowledged and this warning is kept in all
further copies and/or alterations. This manual contains a thorough description of all files
in version 2.3 of this toolbox
1
.
This version is, like its predecessors, a Beta release. Reports of eventual errors
(the absence of which the author cannot ensure) and suggestions of improvements will
be gladly accepted. Please the author’s e-mail given in the Internet site given below.
1.1. Requirements
The requirements for using this toolbox are:
MatLab version 7.0 (release 14) or above. Actually most functions run under
version 5, but the graphical interface and the Simulink library do not.
Control toolbox.
Optimisation toolbox.
Map toolbox. Actually this toolbox is only needed because of functions
rad2deg and deg2rad. If these are not available, see the next section.
1.2. Installation procedure
The several files of the toolbox are available through the Internet, compressed into
a file with the Zip format, in Matlab File Exchange site (Control Design category)
http://www.mathworks.com/matlabcentral/fileexchange
and in
2
http://www.gcar.dem.ist.utl.pt/pessoal/dvalerio/ninteger/ninteger.htm
To install the toolbox, decompress the file into the location you want, and add folder
ninteger to the MatLab path together with its subfolders
3
.
If functions rad2deg and deg2rad are not available
4
, download them from the
same address given above and put them in some folder found in MatLab’s path.
Alternatively, create them yourself and type their code as found in the Appendix.
1
A version history is available at the Internet site given below. See (Valério, 2001a, 2001b) about
version 1.0, (Valério et al., 2004b) about version 2.1.
2
This manual is available in this last site only, together with the version history and other data.
3
In versions 6.5 and 7.0 of MatLab this means choosing Set path… from the File menu, clicking in
button Add with subfolders…, selecting the path for folder ninteger and pressing OK.
4
You may check if they are by typing exist('rad2deg') and exist('deg2rad') at the command
prompt. The result should be 2 for both. If is it something else, they are not.
3
NINTEGER V. 2.3 — FRACTIONAL CONTROL TOOLBOX FOR MATLAB
1.3. How files are organised
The files of the toolbox were divided into three categories:
Those that are to be accessible to the user are placed in the ninteger folder.
However, a separate folder, cfractions, was provided for those functions that
deal with continued fractions, so that they may be easily distinguished from the other
functions. These functions may be useful for purposes other than this toolbox, and thus
ought to be accessible to the user.
Another separate folder, called gui, was provided for those files necessary to
the graphical user interface only.
A last separate folder, obsolescent, contains functions that are no longer
necessary, but are still included to ensure compatibility with older versions of the
toolbox.
1.4. About this manual
This document is organised as follows:
In chapter 2 functions are described that provide integer order transfer
functions approximating fractional order transfer functions.
In chapter 3 functions are described fit for implementing controllers that ensure
an open-loop dynamic given by
() ()
,
v
GsCs ks v= ∈
(1.1)
where G is the plant to control.
In chapter 4 functions are described that ensure the open-loop’s Nichols plot to
fall outside an area corresponding to the closed-loop behaviour to avoid. So as to ensure
a simple design methodology the transfer functions are normally restricted to
expressions like
(
)
Re ,
z
Cs k s z
⎡⎤
=
⎣⎦
∈
(1.2)
In chapter 5 functions for finding fractional models of plants from its
experimental data are found.
In chapter 6 function are described for analysing the frequency behaviour of
fractional plants and finding important norms.
In chapter 0 a graphical user interface is described that makes use of the
toolbox’s functions relieving the user from having to call them from the command
prompt.
In chapter 8 a Simulink library is described containing blocks to implement
approximations of fractional plants.
Chapter 9 describes functions for handling continued fractions, mathematical
entities useful when working with fractional controllers.
Chapter 0 concludes with some final remarks.
This manual no longer has separate chapters for user-oriented and programmer-
oriented information. Programmer-oriented material is now found in sections titled
4