Frequency response of MIMO systems
This example shows how the frequency response of a multi-channel system with multiple inputs and outputs (MIMO) can be investigated in two ways: by calculating the frequency response and by calculating singular values.
Before you start, connect the package ControlSystems.jl
.
import Pkg
Pkg.add("ControlSystems")
using ControlSystems
s = tf('s');
Calculate the frequency response of the MIMO model and analyze the size of the output signal.
H = ssrand(2,2,3)
mag, phase, w = bode(H)
size_mag = size(mag)
The first and second dimensions of the data array mag
— this is the number of outputs and inputs . The third dimension is the number of points in the frequency vector w (the bode command determines this number automatically if you do not specify a frequency vector). Thus, mag(i,j,:)
— this is the frequency response from the jth input to the ith exit. Array of phase data phase
has the same shape as mag
.
Plot the frequency response of each input/output pair in .
bodeplot(H, title = ["Input 1" "Input 2" "" "" "" "" "" ""], leg = false)
bodeplot
reflects the amplitude and phase of the frequency response of each input-output pair in H (Because ssrand
generates a random model of the state space, you can see other characteristics other than those shown in the figure). The first column contains graphs of the frequency characteristics of the circuits running from the first input signal to the first and second outputs. The second column is similar, but from the second input signal to the two outputs of the system.
Plot the singular values depending on the frequency.
sigmaplot(H)
Chart sigmaplot
shows the dependence of the singular values of the MIMO system depends on the frequency. The maximum singular value at a certain frequency is the maximum gain of the system over all linear combinations of input signals at that frequency. Singular values can give a better idea of the overall response, stability, and tuning of a MIMO system than a channel-by-channel Bode graph.
Calculate the singular values in the range from 0.1 to 10 rad/s.
ω = collect(1:0.001:10);
sv,w = sigma(H,ω)
display([sv,w])
When you call sigma
the command returns singular values in the data array sv
. Array input data indicate sigma
the need to calculate singular values in the frequency range from 0.1 to 10 rad/s. Function sigma
returns these frequencies in the vector w. Each line sv
contains singular values at frequencies of W.
Conclusion
Using this example, we learned how to study the frequency response of a MIMO system.