AC - Review
AC - Review
sys = ss(A,B,C,D);
1
System in ZPK form
A system is in Zero Pole Gain Form if H(s) = K∞ (s−z1 )(s−z2 )...(s−zm )
(s−p1 )(s−p1 )...(s−pn )
s=tf(’s’);
H=4*(2*s+6)/(s^2+3*s+2);
zpk(H)
ans =
8 (s+3)
-----------
(s+2) (s+1)
% No MATLAB Statement :(
H = C*inv(s*eye(length(A))-A)*B+D;
sys = ss(A,B,C,D);
H = tf(sys);
H=(s^2+3*s+1)/(s^3+s^2+s+1);
sys=ss(H);
2
• Considering the i-th distinct eigenvalue λi (i = 1, . . . , r) with minimal polynomial multiplicity
′
′ µ −1
t i
µi the functions mi,1 (t) = eλi t , mi,2 (t) = teλi t , . . . , mi,µ′ (t) = ′
(µi −1)!
eλi t are the natural
i
modes associated with the eigenvalue λi
• For each couple of complex conjugate eigenvalues λ = σ0 ± jω0 with minimal polynomial
′
multiplicity µi the natural modes are: m1 (t) = eσ0 t cos(ω0 t + ϕ), m2 (t) = teσ0 t cos(ω0 t +
′
µ −1
t i
ϕ), . . . , mµ′ (t) = ′
(µi −1)!
eσ0 t cos(ω0 t + ϕ)
i
s=tf(’s’);
H=1/((s+2)*(s+10));
K = dcgain(H);
% It can also be used for transfer functions with poles in zero (we have to
% remember to multiply the transfer function by $s^r$
H=1/(s*(s+2)^2);
K = dcgain(s*H);
3
s=tf(’s’);
H=1/((s+2)*(s+10));
w0=0.5;
[m,f]=bode(H,w0); % m is in linear scale, f is in DEGREES
f_rad = f/180*pi; % [Radiants]
Time Delay
An LTI system whose dynamic behavior is described by a transfer function H(s) in the presence of a
time delay can be represented as Hdelay (s) = H(s)e−θs . Since the time delay introduces a non-real
rational component in the transfer function, we cannot compute the anti-transform as is. We must
approximate the exponential function using the Padè Approximation:
1− θ2 s
• First Order: e−θs ≈ 1+ θ2 s
2 2
1− θ2 s+ θ 12s
• Second Order: e−θs ≈ 2 2
1+ θ2 s+ θ 12s
s=tf(’s’);
H=1/(s^2+s+1);
H.inputdelay=2;
pade_order = 1;
SYSX = zpk(pade(H,pade_order));
Bode Diagram
s=tf(’s’);
H=1/(s^2+3*s+2);
figure, bode(H);
title("Bode Plot");
grid on;
Polar Diagram
s=tf(’s’);
H=1/(s^2+3*s+2);
4
[re,im]=nyquist(H);
figure, plot(squeeze(re), squeeze(im));
title("Polar Diagram");
xlabel("Im[H(j\omega)]");
ylabel("Re[H(j\omega)]");
grid on;
Nyquist Diagram
Keep in mind that Matalb does not plot the images of the semicircles ρ → 0
s=tf(’s’);
H=1/(s^2+3*s+2);
figure,nyquist(H);
grid on;
5
Nichols Diagram
s=tf(’s’);
H=1/(s^2+3*s+2);
figure,nichols(H);
grid on;
C=(s-1)/(s+1);
G=1/((s-1)*(s+2));
L=G*C; % Loop Transfer Function before semplification
L=minreal(L); % Loop Transfer Function after zero-pole cancellations
6
• N the number of encirclements of the Nyquist diagram of L(s) around the critical point (−1, j0)
(N > 0 → clockwise, N < 0 → counter-clockwise). N should be well-defined meaning that
if the Nyquist diagram crosses the critical point (−1, j0) the system is unstable
• Z the number of poles of T (s) with strictly positive real part
• P the number of poles of L(s) with strictly positive real part
Then we have N = Z − P . Since we know that a feedback control system is stable if and only if
all the poles of T (s) have strictly negative real-part → Z = 0 → N = −P . So the steps to
determine if a feedback control system is stable are:
1. Determine the number P of the poles of L(s) with strictly positive real part
2. Draw the Nyquist diagram of L(s) and compute the number N of encirclements of the plot
around the critical point (−1, j0)
3. Compute the number Z of poles of T (s) with strictly positive real part as Z = N + P
4. Then the system is stable if and only if Z = 0 → N = −P
s=tf(’s’);
L=1/(s*(s+2)*(s+4));
figure, nichols(L), hold on;
T_grid(0.4);
S_grid(2.6);
ngrid;