Lab Assignment
Lab Assignment
Roll no 916
B.E 6
Objective:
To evalute the effect of pole and zero location upon the time response of first and second
order system.
Pre lab:
1.Given the transfer function G(s)= a/ (s+a). Evalute settling time and rise time for the
following values of a=1,2,3,4.plot the poles
Solution:
For a=1
>>a=1
a=
>> numf=[a]
numf =
>> denf=[1 a]
denf =
1 1
>> t=tf([numf],[denf])
Transfer function:
1
-----
s+1
-1
>>z=zero(t)
z=
>>y=pzmap(t)
y=
-1
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time and settling time.
For a =2
>>a=2
a=
>> num=[a]
num =
2
>> den=[1 a]
den =
1 2
>> t=tf([num],[den])
Transfer function:
2
-----
s+2
>> p=pole(t)
p=
-2
>> z=zero(t)
z=
>> y=pzmap(t)
y=
-2
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time and settling time
For a=3
>>a=3
a=
>> num=[a]
numf =
3
>> den=[1 a]
den =
1 3
>> t=tf([num],[den])
Transfer function:
3
-----
s+3
p =pole(t)
p=
-3
>> z=zero(t)
z=
>> y=pzmap(t)
y=
-3
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time and settling time
For a=4
>>a=4
a=
>> num=[a]
num=
4
>> den=[1 a]
den =
1 4
>> t=tf([num],[den])
Transfer function:
4
-----
s+4
>> p=pole(t)
p=
-4
>> z=zero(t)
z=
>> y=pzmap(t)
y=
-4
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time and settling time
For 2nd order system
Solution:
>>a=4
a=
>> b=25
b=
25
>> num=[b]
num=
25
>> den=[1 a b]
den =
1 4 25
>> t1=tf([num],[den])
Transfer function:
25
--------------
s^2 + 4 s + 25
then draw the diagram in the simulink.
Write simulink in the command window. then draw the block diagram of the transfer
function. It will be like this
By clicking on scope we get
>> p=pole(t1)
p=
-2.0000 + 4.5826i
-2.0000 - 4.5826i
>> z=zero(t1)
z=
-2.0000 + 4.5826i
-2.0000 - 4.5826i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, peak time rise time and settling time,peak time and
overshoot
b) Calculate the values of a and b so that imaginary part of the poles remains the
same but the real part is increased 2 times over that of (a) and repeat prelab(2a).
Solution:
>>a=8
a=
8
>> b=37
b=
37
>> num=[b]
numf=
37
>> den=[1 a b]
den =
1 8 37
>> t1=tf([num],[den])
Transfer function:
37
--------------
s^2 + 8s + 37
>> p=pole(t1)
p=
-4.0000 + 4.5826i
-4.0000 - 4.5826i
>> z=zero(t1)
z=
>> y=pzmap(t1)
y=
-4.0000 + 4.5826i
-4.0000 - 4.5826i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole,peak time,overshoot, rise time and settling time
c) Calculate the values of a and b so that the imaginary part of the poles are remain
the same but the real part is decreased1/2 time over of (a) and repeat prelab(2a).
Solution:
>>a=2
a=
2
>> b=22
b=
22
>> num=[b]
num ==
22
>> den=[1 a b]
den =
1 2
>> t1=tf([num],[den])
Transfer function:
22
--------------
s^2 + 2s + 22
>> p=pole(t1)
p=
-1.0000 + 4.5826i
-1.0000 - 4.5826i
>> z=zero(t1)
z=
>> y=pzmap(t1)
y=
-1.0000 + 4.5826i
-1.0000 - 4.5826i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, peak time,overshoot, rise time and settling time
3.
a) For the system of prelab 2(a) calculate the values of a and b so that the real
part of the poles remains the same but the imaginary part is increased 2
times ove that of prelab 2(a) and repeat prelab 2(a)
b)
Solution :
>>a=4
a=
>> b=88
b=
88
>> num=[b]
num =
88
>> den=[1 a b]
den =
1 4 88
>> t1=tf([num],[den])
Transfer function:
88
--------------
s^2 + 4s + 88
p=
-2.0000 + 9.1652i
-2.0000 - 9.1652i
z=zero(t1)
z=
y=
-2.0000 + 9.1652i
-2.0000 - 9.1652i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, peak time,overshoot ,rise time and settling time
b) For the system of prelab 2(a) calculate the values of a and b so that the real
part of the poles remains the same but the imaginary part is increased 4
times over that of prelab 2(a) and repeat prelab 2(a).
Solution :
A= 4, b=340
>>a=4
a=
>> b=340
b=
340
>> num=[b]
num=
340
>> den=[1 a b]
den =
1 4 340
>> t1=tf([num],[den])
Transfer function:
340
--------------
s^2 + 4s + 340
>> p=pole(t1)
p=
-2.0000 +18.3303i
-2.0000 -18.3303i
>> z=zero(t1)
z=
>> y=pzmap(t1)
y=
-2.0000 +18.3303i
-2.0000 -18.3303i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time peak time,overshoot and settling time
4
a) For the system of prelab 2(A) calculate the values of a and b so that tha
damping ratio remains the same but the natural frequency is increased 2
times over of prelab 2(a) and repeat prelab 2(a).
Solution :
A= 4,b=25
In the command window
>> a=4
a=
>> b=25
b=
25
>> omega=sqrt(b)
omega =
>> eeta=(a/(2*omega))
eeta =
0.4000
>> omega=10
omega =
10
>> eeta=0.4
eeta =
0.4000
>> b=omega*omega
b=
100
>> a=2*eeta*omega
a=
>> num=[b]
num =
100
>> den=[1 a b]
denf=
1 8 100
>> t=tf([num],[den])
Transfer function:
100
---------------
s^2 + 8 s + 100
p=pole(t)
p=
-4.0000 + 9.1652i
-4.0000 - 9.1652i
>> z=zero(t)
z=
>> y=pzmap(t)
y=
-4.0000 + 9.1652i
-4.0000 - 9.1652i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time, peak time,overshoot and settling time
b) For the system pf prelab 2 (a) calculate the values of a and b so that the
damping ratio remains the same but the natural frequency is increases 4
times over that of prelab 2(a) and repeat prelab 2(a).
Solution :
>> eeta=0.4
eeta =
0.4000
>> omega=20
omega=
20
>> b=omega*omega
b=
400
>> a=2*eeta*omega
a=
16
>> num=[b]
num=
400
>> den=[ 1 a b]
den =
1 16 400
>> t=tf([num],[den])
Transfer function:
400
----------------
s^2 + 16 s + 400
>> p=pole(t)
p=
-8.0000 +18.3303i
-8.0000 -18.3303i
>> z=zero(t)
z=
y=
-8.0000 +18.3303i
-8.0000 -18.3303i
Write ltiview in command window then import the above transfer function (G) the graph
will be like this with its pole, rise time and settling time,peak time and overshoot.
LAB
1) Using simulink set up the system of prelab 1 and plot the step response of
each of four transfer functions on a single graph by using the simulink LTI
viwer. Also record the values of settling time and rise time for each step
response.
Solution
Transfer function:
1
-----
s+1
Transfer function:
3
-----
s+3
Transfer function:
4
-----
s+4
>> step(a1,a2,a3,a4)
Now for LTI VIEWER (for rise time and settling time)
>> ltiview
Import the transfer functions one by one on tha single graph.
Settling time for a1=3.91
and rise time for a1=2.2.
Transfer function:
25
--------------
s^2 + 4 s + 25
Transfer function:
37
--------------
s^2 + 8 s + 37
Transfer function:
22
--------------
s^2 + 2 s + 22
>> step(g,g1,g2)
>> ltiview
B1
Percent overshoot =25.4
Settling time =1.3
Rise time =0.732
B2
Percent overshoot=6.44
Settling time=0.988
Rise time=o.329
B3
Percent overshoot=50.4
Settling time=3.64
Rise time=0.261
1) Using simulink , set up the system of prelab 2 a)and prelab 3. Using the
simulink LTI viewer plot the step response of each of the 3 transfer functions
on a single graph . also record the values of percent overshoot , settling
time,peak time and rise time for each step response.
Solution:
Use the following commands in command window
Transfer function:
25
--------------
s^2 + 4 s + 25
Transfer function:
88
--------------
s^2 + 4 s + 88
Transfer function:
340
---------------
s^2 + 4 s + 340
>> step(f,f1,f2)
>> ltiview
for c1:
Percent overshoot=25.4
Settling time=1.3
Rise time=0.732
For c2:
Percent overshoot=50.4
Settling time=1.82
Rise time=0.131
For c3:
Percent overshoot=70.9
Settling time=1.91
Rise time=0.0607
4) simulink set up the system of prelab 2 a) and prelab 4 using the simulink
LTI viewer , plot the step response of ech of the three transfer functions
on a sigle graph. Also record the values of percent overshoot, settling
time, peaktime and a rise timr for each response
Solution:
Transfer function:
25
--------------
s^2 + 4 s + 25
Transfer function:
100
---------------
s^2 + 8 s + 100
Transfer function:
400
----------------
s^2 + 16 s + 400
>> step(r,r1,r2)
>> ltiview
Transfer function:
25
--------------
s^2 + 4 s + 25
Transfer function:
100
---------------
s^2 + 8 s + 100
>> r2=tf([400],[1 16 400])
Transfer function:
400
----------------
s^2 + 16 s + 400
>> step(r,r1,r2)
Now for LTI VIEWER (for rise time and settling time,over shoot and peak time)
>> ltiview
For d2:
Percent overshoot=25.4
Settling time=0.147
Rise time=0.841
For d3:
Percent overshoot=25.4
Settling time=0.42
Rise time=0.0734