You are on page 1of 13

Evaluation of a Julia Control Toolbox

Martin Karlsson

Dept. of Automatic Control


Lund University

Martin Karlsson Evaluation of a Julia Control Toolbox


Introduction

Control.jl (first hit on google; julia control toolbox)


Julia 0.4 is required
No documentation yet, but exported functions have docstrings
Appears similar to other control systems design toolboxes, e.g.
Control Systems Toolbox in Matlab.
Systems stored as transfer functions or state-space
representations
Evaluation in both time and frequency domain
Stability and performance properties
My approach: Evaluation of functionality, rather than stress test

Martin Karlsson Evaluation of a Julia Control Toolbox


Contents

1 Systems: Transfer functions and state-space representations


2 Basic analysis: poles, zeros, gain etc.
3 Frequency domain: Bode and Nyquist diagrams
4 Time domain: step response etc.
5 Controller synthesis
6 Comparison with toolbox in Matlab

Martin Karlsson Evaluation of a Julia Control Toolbox


Transfer functions
G = tf ([1] ,[1 , 2 , 1])

TransferFunction :
1.0
----------------
s 2 + 2.0 s + 1.0

pole ( G )
-1
-1

tzero ( G )
0 - element Array { Float64 ,1}

gain ( G )
1.0

Martin Karlsson Evaluation of a Julia Control Toolbox


State-space
Gss = convert ( StateSpace , G )
StateSpace :
A =
x1 x2
x1 -2.0 -1.0
x2 1.0 0.0
B =
u1
x1 1.0
x2 0.0
C =
x1 x2
y1 0.0 1.0
D =
u1
y1 0.0
Continuous - time state - space model
Martin Karlsson Evaluation of a Julia Control Toolbox
Bode diagram
bodeplot ( G )

Bode Plot
0
5
10
Magnitude (dB)

15
20
25
30
35
40
45
0
20
40
Phase (deg)

60
80
100
120
140
160
180 -1
10 100 101
Frequenc (rad/s)
Martin Karlsson Evaluation of a Julia Control Toolbox
Nyquist diagram
nyquistplot ( G )

Nyquist Plot
0.8

0.6

0.4

0.2
Imaginary Axis

0.0

0.2

0.4

0.6

0.8
0.2 0.0 0.2 0.4 0.6 0.8 1.0
Real Axis
Martin Karlsson Evaluation of a Julia Control Toolbox
Step response
stepplot ( G )

Step Response
1.0

0.8

0.6
Amplitude

0.4

0.2

0.0
0 1 2 3 4 5 6 7 8
Time (s)
Martin Karlsson Evaluation of a Julia Control Toolbox
Impulse response
impulseplot ( G )

Impulse Response
0.40

0.35

0.30

0.25
Amplitude

0.20

0.15

0.10

0.05

0.00
0 1 2 3 4 5 6 7 8
Time (s)
Martin Karlsson Evaluation of a Julia Control Toolbox
Comparison with the Matlab toolbox

The code does not look similar, i.e. not just a quick conversion
Currently, the Matlab toolbox wins on w.o.

Martin Karlsson Evaluation of a Julia Control Toolbox


Conclusion

Looks promising, but runs on an unstable version of Julia


Only the basics worked without modification
Difficult to evaluate the more advanced functionality

Martin Karlsson Evaluation of a Julia Control Toolbox


Assignment for next seminar- very optional

Get the control toolbox


Define a system of particular interest, either as a tf or ss
Analyse your system. Generate Bode and Nyquist plots, evaluate
the stability etc.
And the final grade is...

Martin Karlsson Evaluation of a Julia Control Toolbox


Final grade

Martin Karlsson Evaluation of a Julia Control Toolbox

You might also like