mor.bode

Main interface for Bode plot.

Syntax

mor.bode(sys,W)
mor.bode(sys,color,W)
mor.bode(sys,color,W,tag)
H = mor.bode(sys,W)

Description

mor.bode(sys,W) plots the Bode diagram of sys over the frequencies defined by the vector W. The input sys can either be

mor.bode(sys,color,W) plots sys with color color.
H = mor.bode(sys,W) provides the frequency response ny outputs, nu inputs, N values vector.

Input arguments

sys Dynamical system or input-output data. More specifically sys can either be
  • a state-space ODE (DAE) realization described as sys = ss(A,B,C,D) (or sys = dss(A,B,C,D,E))
  • a matrix set describing an ODE (or DAE) described as sys = {A,B,C,D} (or sys = {A,B,C,D,E})
  • a set of N pulsations of an nu inputs, ny outputs responses described sys = {w_i,H_i}
  • a single variable function handle of an nu inputs, ny outputs responses described sys = @(s) myFun
color Color in a string tag or a RGB vector.
W Vector of frequencies, in rad/s, over which the system's frequency responses are evaluated (positive real vector).
tag Optional term being either: 'phase' to plot the phase diagram, 'abs' to plot the Bode response in absolute scale.

Output arguments

H Returns the frequency response of the dynamic system model sys (model, data, handle function) at frequencies W (complex ny x nu x N vector).

Examples

% Bode from state-space
sys = ss(zpk([],[-0.1+3*1i,-0.1-3*1i,-0.05+10*1i,-0.05-10*1i,-0.01+20*1i,-0.01-20*1i],1));
W   = logspace(-1,3,300);
figure
mor.bode(sys,W)

% Bode from matrices
load build
A = G.a;
B = G.b;
C = G.c;
D = G.d;
W = logspace(-1,3,300);
figure
mor.bode({A,B,C,D},W)

% Bode from freqresp function
load build
sys  = G;
W    = logspace(-1,3,300);
H    = freqresp(sys,W);
figure
mor.bode({H},W)

% Bode from handle function
sys = @(s) 1/(s^2+.1*s+1);
W   = logspace(-1,3,300);
figure
mor.bode(sys,W)