Professional Documents
Culture Documents
SSC-session2 - Lola y Laura PDF
SSC-session2 - Lola y Laura PDF
SSC-session2 - Lola y Laura PDF
Team
Full Name 1 Lola Aguilera Villegas
Full Name 2 Laura Navarro González
1 Introduction
The target of this session is to learn the tools to describe and model LTI systems in Matlab.
Firstly, we will learn the description of transfer functions, and the computation of impulse, step
and frequency response. Secondly, we will learn how to perform transient behavioral
simulations.
Hs1 =
s + 2
-------------
s^2 + 2 s + 1
Hz1 =
1
-------------
z^2 + 2 z + 1
Compute the .zpk representation of Hs1 and Hz1, and report zeros, poles and gain. Is the gain
reported the static gain?
2021/22 Course 2
SSC/GIF/SS2/21_22
>> Hs1_zpk=zpk(Hs1)
Hs1_zpk =
(s+2)
-------
(s+1)^2
>> Hz1_zpk=zpk(Hz1)
Hz1_zpk =
1
-------
(z+1)^2
- Zeros:
ans =
-2
ans =
- Poles:
ans =
-1
-1
ans =
-1
-1
2021/22 Course 3
SSC/GIF/SS2/21_22
- Gain:
ans =
ans =
The static gains of both transfer functions are calculated as H(s=0) for CT and H(z=1)
for DT; leading to the values:
1
𝐻𝑠1(0) = 2 ≠ 1 𝐻𝑧1(1) = ≠ 1
4
Therefore, as we can see, the values obtained with MATLAB do not match with the
theoretical ones.
>> Hs1_zpk=zpk(Hs1)
Hs1_zpk =
1
---------------
(s^2 + 2s + 10)
2021/22 Course 4
SSC/GIF/SS2/21_22
>> Hs2_zpk=zpk(Hs2)
Hs2_zpk =
2 (s+0.5)
---------------
(s^2 + 2s + 10)
- Zeros:
ans =
ans =
-0.5000
- Poles:
ans =
-1.0000 + 3.0000i
-1.0000 - 3.0000i
ans =
-1.0000 + 3.0000i
-1.0000 - 3.0000i
Use ‘step’ to compute the step response. Report peak time and overshoot for each system. What
is the effect of adding a zero to the system?
2021/22 Course 5
SSC/GIF/SS2/21_22
Step Response
𝑃𝑒𝑎𝑘 = 0.135
𝑂𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡 = 𝑃𝑒𝑎𝑘 − 𝑘 = 0.135 − 0.1 = 0.035
𝑃𝑒𝑎𝑘 = 0.481
𝑂𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡 = 𝑃𝑒𝑎𝑘 − 𝑘 = 0.481 − 0.1 = 0.381
As it can be seen, adding a zero to the system means that the step response is faster
(decreases the rise time and the peak time) and that the overshoot increases.
2021/22 Course 6
SSC/GIF/SS2/21_22
Plot the frequency response of both systems with ‘bode’ command and comment the impact of
having complex poles. What is the influence of adding a real zero in this case?
2021/22 Course 7
SSC/GIF/SS2/21_22
The impact (in the bode plots) of having complex poles are the slopes obtained, which
differ from the ones that we obtain when we have real poles and zeros (first order CT
systems).
The addition of a zero in this case change the bode plot slightly by having a “peak” or
“distortion” when comparing with the one with no zeros.
If we want to predict the transient response of the system to an arbitrary input, we need to
numerically solve the differential equations of the external representation. Although there are
commands in Matlab to perform this task, we prefer to use a graphical tool called Simulink.
Type ‘Simulink’ in the command window and create a new blank model. Create the following
block diagram, and set the following Model Settings:
2021/22 Course 8
SSC/GIF/SS2/21_22
Run the simulation and open the scope to check the result. Can you check if the obtained value
corresponds to the predicted value in the bode plot? Please comment here.
2021/22 Course 9
SSC/GIF/SS2/21_22
Looking at the Bode plot of Hs1, we can see that the frequency of 𝜋 is around –15.7.
Change the input to a square wave. Check ‘Sources’ library. Set the square wave to have an
amplitude of 1 (between 0 and 1) and a period of 2 seconds. Run the system and check the
output. Copy the output waveform here. What is the amplitude? And the frequency? Can you
explain the waveform using the frequency response and the spectrum of the square wave?
Add your comments here.
2021/22 Course 10
SSC/GIF/SS2/21_22
Now try to run the following system and check BIBO stability. Can you explain the results?
2021/22 Course 11
SSC/GIF/SS2/21_22
1 1 1
𝑠 + 2 ·𝑠+4·𝑠+6
𝐻(𝑠) =
1 1 1
1 + 500 · 𝑠 + 2 · 𝑠 + 4 · 𝑠 + 6
1
(𝑠 + 2)(𝑠 + 4)(𝑠 + 6) 1
𝐻(𝑠) = =
(𝑠 + 2)(𝑠 + 4)(𝑠 + 6) + 500 (𝑠 + 2)(𝑠 + 4)(𝑠 + 6) + 500
(𝑠 + 2)(𝑠 + 4)(𝑠 + 6)
1
= 3
𝑠 + 12𝑠 2 + 44𝑠 + 548
There is BIBO stability if the output is bounded as well as the input is. That happens if
the real part of the poles obtained is negative.
𝐵𝐼𝐵𝑂 𝑆𝑡𝑎𝑏𝑖𝑙𝑖𝑡𝑦 → 𝑅𝑒(𝑝𝑗 ) ≤ 0
2021/22 Course 12