Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 2 min read

Support

Prerequisite

It is necessary to install Julia and afterwards the ControlSystems.jl package. It is recommended to follow the official Julia Documentation. Julia can be executed in a terminal but it is quite practical to use an IDE like Juno/Atom or Visual Studio Code.

The ControlSystems.jl package has to be loaded with

using ControlSystems

before the function can be evaluated.

Throughout this course it is assumed that the source code is typed in the Julia REPL to print the results instantaneously. Otherwise, results can be printed with

print()

Classical Control

Transfer Function

Consider the transfer function

G ( s ) = \frac{s + 2}{3 {s}^{2} + 4 s + 5}

The transfer function is created similar to other numerical toolboxes with numerator and denominator as

num = [1, 2] # Numerator
den = [3, 4, 5] # Denominator
G = tf(num, den) # Transfer function

The REPL responses an overview of the created transfer function object

TransferFunction{ControlSystems.SisoRational{Int64}}
s + 2


3s^2 + 4s + 5
Continuous-time transfer function model

Poles and Zeros

The poles of transfer function G ( s ) are computed with

pole(G)

and the REPL responses

2-element Array{Complex{Float64},1}:
-0.6666666666666665 + 1.1055415967851332im
-0.6666666666666665 - 1.1055415967851332im

The zeros of transfer function G ( s ) are computed with

tzero(G)

and resulting in

1-element Array{Float64,1}:
-2.0

The function

zpkdata(G)

will response the zeros, poles and the gain.

The Pole-Zero Plot is created with

pzmap(G)

Impulse and Step Response

It is handy to define the simulation time and a label for both plots with

Tf = 20 # Final simulation time in seconds
impulse_lbl = "y(t) = g(t)" # Label for impulse response g(t)
step_lbl = "y(t) = h(t)" # Label for step response h(t)

The impulse response is created with

impulseplot(G, Tf, label=impulse_lbl) # Impulse response

and the step response is built with

stepplot(G, Tf, label=impulse_lbl) # Step response

(Image: StephanSp3, CC BY-SA 4.0)

Bode and Nyquist Plot

The Bode plot is printed with

bodeplot(G) # Bode plot

and the Nyquist plot (without gain circles) is printed with

nyquistplot(G, gaincircles=false) # Nyquist plot

The gain circles can be toggled with the boolean flag.

Note:

If only the numerical results of the Bode/Nyquist plot are of interest and not their visualization, then one can use

bode(G)

and

nyquist(G)

Modern Control

Further reading

Julia Homepage

Julia Documentation

ControlSystems.jl Manual

Where this page came from

This page was imported from Wikibooks. From “Control Systems” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Comments

Spinner Logo

Next in Control Systems

CC BY-SA 4.0
**Scilab** is an open source, cross-platform numerical computational package and a high-level, numerically oriented programming language. It is similar in its capabilities to **MATLAB**. Scilab has a good implementation of many of the required control systems functions and has a dynamic model simula
CC BY-SA 4.0
The following is a list of the important equations from the text, arranged by subject. For more information about these equations, including the meaning of each variable and symbol, the uses of these functions, or the derivations of these equations, see the relevant pages in the main text. ## Fundam
CC BY-SA 4.0
It is the goal of the authors of this book to create such materials for use in conjunction with this book. As such materials are added to wikiversity, they will be referenced here. ## Wikipedia There are a number of Wikipedia articles on the topics covered in this book, and those articles will be li
CC BY-SA 4.0
Some contributions have been released into the public domain. ## Images The individual images used in this wikibook are released under a variety of different licenses, including the GFDL, and Creative-Commons licenses. Some images have been released into the public domain. The following table will l
CC BY-SA 4.0
This page is going to be used to maintain a list of all the different versions available for the [Control Systems]( book. Each different version will contain different amounts of material presented in different orders. Each version will target a different audience. Instructors can pick and choose wh
CC BY-SA 4.0
All images added to this book should be properly documented in the [Licensing Page]( ## Advertising This book has a good book template located at [Template:Goodbook/Control Systems]( As a featured book, this template may be rotated onto the main page. That template should be formatted in a similar m