Frequency response of SISO systems
This example shows how to plot a frequency response graph and obtain frequency response data for a dynamic system model with one input and one output (SISO).
Before you start, connect the package ControlSystems.jl
.
import Pkg
Pkg.add("ControlSystems")
using ControlSystems
s = tf('s');
Create a model of the transfer function and plot its frequency response.
H = tf([10,21],[1,1,4,26]);
bode(H)
If you do not specify the frequency range to display, the function bode
automatically selects the frequency range based on the dynamics of the system.
Calculate the frequency response in the range from 1 to 13 rad/s.
ω = collect(1:0.001:13);
mag, phase, w = bode(H, ω);
display([mag, phase])
When you call bode
, the command returns vectors mag
and phase
, containing the magnitude and phase of the frequency response. The input signal of the array indicates bode
calculate the response in the frequency range from 1 to 13 rad/s. bode
returns the frequency points in the vector w.
The received data can be displayed on a graph using the function bodeplot
.
bodeplot(H, ω, label = "H(s)")
Conclusion
Thus, we learned how to build frequency characteristics for a SISO system.