Você está na página 1de 15

EXPERIMENT -1

1.1 TRANSFER FUNCTION:

Create a transfer function object, TF, for the 4th order system whose differential equation is
𝑦(𝑖𝑣)+10𝑦 +30𝑦̈+40𝑦̇+24𝑦=4𝑢̈+36𝑢̇+32𝑢 where 𝑦(𝑖𝑣)stands for the 4th derivative for y(t)
with respect to time.
a. Display the object’s properties and extract the numerator and denominator polynomials from
the TF object and display them as row vectors.

b. Draw a pole zero plot, Figure 1

c. Obtain the model of the system as ZPK object. Then extract its zeros, poles and gain and
show that they are the same as those in Figure 1

BACKGROUND:
Transfer function maybe defined as ratio of the Laplace transform of the output variable to the
Laplace transform of the input variable considering the initial zero conditions.

C ( s)
Generally, TF is represented as G(s) =
R( s )

Here, C(s) = Laplace output of the system

R(s) = Laplace input of the system

Using the TF of the system, Zeros, Poles, Stability of the given system can be determined.

MATLAB CODE:
% experiment 1
clear all
clc
num = [4 36 32];
den = [1 10 30 40 24];
sys1= tf(num,den);
%part A( tf model of system)
[num1,den1] = tfdata(sys1,'v'), % row vectors
%part B(pz plot of system)
figure
pzmap(sys1),% pole-zero plot of sys1
title('Pole-Zero map')
%Part C (ZPK format of system)
sys2 = zpk(sys1);
figure
pzmap(sys2)
[z2,p2,k2] = zpkdata(sys2,'v');
disp(['The poles are: ' num2str(p2')])%the transpose is to concatenate row vector and column
vector
disp(['The zeros are: ' num2str(z2')])
disp('The zeros and poles obtained are same as in the Pole-zero plot')

MATLAB OUTPUT:
Continuous-time transfer function.
4 𝑠^2 + 36 𝑠 + 32
Sys1= −−−−−−−−−−−−
𝑠^4 + 10 𝑠^3 + 30 𝑠^2 + 40 𝑠 + 24
Row vectors of numerator and denominator are:
num1 = 0 0 4 36 32
den1 = 1 10 30 40 24

Pole-Zero map of sys1


1.5

1
Imaginary Axis (seconds-1)

0.5

-0.5

-1

-1.5
-8 -7 -6 -5 -4 -3 -2 -1 0
Real Axis (seconds -1)
Continuous-time zero/pole/gain model.

4 (𝑠 + 8)(𝑠 + 1)
𝑠𝑦𝑠2 = − − − − − − − − − − − − − − − − − − − − − − −
(𝑠 + 6) (𝑠 + 2) (𝑠^2 + 2𝑠 + 2)

From Zero- Pole- Gain Model,

The poles are: -6+0i -2+0i -1-1i -1+1i


The zeros are: -8 -1v
The zeros and poles obtained are same as in the Pole-zero plot.

INFERENCE:
By observing the plot, Stability of the given system can be concluded as stable system as all
the poles of TF are on left side of the imaginary axis.
1.2 RESIDUES and IMPULSE RESPONSE:

The transfer function of a fixed linear system is 𝐺(𝑠)=3𝑠+22𝑠3+4𝑠2+5𝑠+1.


a. Plot the IMPULSE response of the system as Figure 2.

b. Perform partial-fraction expansion, RESIDUE, of G(s) and Obtain the individual response
for each pole RPOLE2T, CPOLE2T in Figure 3 and verify that the sum of these two responses
equals the impulse response obtained in Figure 2 earlier.

BACKGROUND:
There are four basic types of test signals in control systems: Step, Impulse, Ramp, Parabolic
signals. Adding to these there is one more important and more prominently used signal that is
Sinusoidal signal.
The integration of the impulse function gives step function.
Integral of step function is ramp function.
Integral of ramp function is parabolic function.

MATLAB CODE:
clc
clear all
%add path
addpath(genpath('RPI'));
% tf of system
num=[3 2];
den=[2 4 5 1];
G=tf(num,den)
[zero,poles,k]=tf2zp(num,den),% pole-zero plot of sys1
figure
impulse(G);% impulse response of the system
[r,p,k]=residue(num,den);%residue of the system
t = [-50:0.1:20]';
ycmplx = cpole2t(p(2),r(2),t);
yreal = rpole2t(p(3),r(3),t);
ytot=ycmplx+yreal;
figure
impulse(G)
hold on
plot(t,ytot,'*',t,yreal,'.',t,ycmplx,'+')
legend('Impulse response','Total response due to all poles','Complex poles response','Real poles
response')
disp('ytot is equal to ycmplx+yreal')

MATLAB OUTPUT:
G=
3s+2
-----------------------
2 s^3 + 4 s^2 + 5 s + 1
Continuous-time transfer function.
Zeros, poles and gain of the system:
zero = -0.6667
poles = -0.8796 + 1.1414i
-0.8796 - 1.1414i
-0.2408 + 0.0000i
k = 1.5000
Impulse Response
0.7
Impulse response
Total response due to all poles
Complex poles response
0.6 Real poles response

0.5

0.4
Amplitude

0.3

0.2

0.1

0
0 5 10 15 20 25 30 35
Time (seconds)

 ytot is equal to ycmplx+yreal

INFERENCE:
From the plot it is observed that the sum of individual responses of the system equals the
impulse response of the system.
The ramp function can’t be analysed directly using MATLAB. So, ramp function can be
analysed through step function by integration.
1.3 TIME RESPONSE DUE TO REPEATED POLES:

The transfer function of a fixed linear system is 𝐺(𝑠)=3𝑠+22𝑠3+4𝑠2+5𝑠+1.


a. Plot the IMPULSE response of the system as Figure 2.

b. Perform partial-fraction expansion, RESIDUE, of G(s) and Obtain the individual response
for each pole RPOLE2T, CPOLE2T in Figure 3 and verify that the sum of these two responses
equals the impulse response obtained in Figure 2 earlier.

BACKGROUND:
Two branches in parallel must be equivalent to a single branch system whose transfer function
is a sum of the transfer functions of individual branches.
Repeated poles gives the critically damped system.

MATLAB Code:
clear all;
clc;
% Find transfer function from differential Equation
num = [1 2];
den = [1 1 0.25];
G=tf(num,den)
[res,pol,k] = residue(num,den)
% Plot Impulse Responce of transfer function
figure
impulse(G)
xlabel('time')
ylabel('amplitude')
title('Impulse Response of the system')
% Finding individual response of each pole and their summation
t=[0:0.1:20]';
y1=rpole2t(pol(1),res(1),t);
y2=t.*rpole2t(pol(2),res(2),t);% vector multiplication with t
is due to repeated poles
y=y1+y2;
% Plotting the individual poles response and the summation
response
figure
plot(t,y1,t,y2,'*');
legend('Single pole response','Multi-pole response')

MATLAB OUTPUT:

INFERENCE:
By using partial fraction method, the system TF can be divided into product of two functions.
For repeated poles to be plotted second repeated pole should be multiplied with ‘t’ in Matlab
function. From plot it can be inferred that sum of the individual impulse of the two function
equals the actual impulse response of the system.
1.4 STEP RESPONSE:

For the transfer function G(s) given in Q.2, obtain a plot of the step response by
a. Adding a pole at s = 0 to G(s) and then using the IMPULSE command. Figure 5.

b. Compare the response with that obtained with the STEP command applied directly to G(s).

c. Also, determine the system’s DCGAIN.

d. Use the initial and final-value theorems to check your results. (paper based, not MATLAB
based)

BACKGROUND:

Step signal is mostly used to get the response of the system. Ramp signal response and
parabolic signal response can be obtained by adding one and two poles at origin of the system
with step signal respectively.

MATLAB CODE:

clear all,clc

numG = [3 2];

denG = [2 4 5 1];

numstep = numG;
denstep = [denG 0];
G = tf(numG,denG);
GStep = tf(numG,denstep);
figure
%Part A
impulse(GStep,30)
hold on
%Part B
step(G,30,'*')
legend('Impulse response after adding pole at origin','(Direct)
Step response','Location','southeast')
%Part C
DC_gain = dcgain(G);
display(['DC gain is ' num2str(DC_gain)])

MATLAB OUTPUT:

INFERENCE:
From the plot it is observed that the response of the system with step command and response
of the system obtained by adding pole at zero to system and applying impulse command is
matched.
Using initial value theorem, the final value of the response is given by
𝑠. 3𝑠 + 2
lim (𝑠. 𝑦(𝑠)) = lim ( )=0
𝑠→∞ 𝑠→∞ 𝑠(2s3 + 4s2 + 5s + 1 )
Using final value theorem, the final value of the response is given by
𝑠. 3𝑠 + 2
lim(𝑠. 𝑦(𝑠)) = lim( )=2
𝑠→0 𝑠→0 𝑠(2s3 + 4s2 + 5s + 1 )
The initial and final value from the plot are same as the numerical calculations.
1.5 RESPONSE TO THE GENERAL INPUT:

Find the zero-state response of the system Figure 6, for the transfer function G(s) given in Q.2
to the
0, t  0

input 𝑢(𝑡)= 2,0  t  2
0.5, t  2

BACKGROUND:
One of the methods of finding the response of the system is to split the solution into two parts,
the zero input solution and zero state solution. The zero state solution is the response of the
system to the input, with initial conditions set to zero.

MATLAB CODE:
clear all,
clc;
addpath(genpath('RPI'));
% Using Numerator and Denominator from Question 2 to find
transfer function
num=[3 2]
den=[2 4 5 1]
% Finding Transfer function
G=tf(num,den)
t = [0:0.02:10]';
%Create a time vector
u = 2*(t.^0); %Vector of 2's with same length as time
%Alter the values of u in the range of 0<=t<2
for i = 1:length(t)
if t(i)>=2
u(i) = 0.5;
end
end
%Obtaining the time resonse for desired input signal u
y = lsim(G,u,t);
plot(t,u,'r',t,y)
title('time response plot')
xlabel('time (sec)')
ylabel('amplitude')
legend('Input Signal u(t)', 'time Response')
title('Zero state response of the system')

MATLAB OUTPUT:

INFERENCE:
The zero state response of the system is obtained. To give arbitrary input for the system to get
the response ‘lsim’ command is used in Matlab program.
1.6. POLES AND STABILITY:

a. Find and the poles of the transfer function


1.5𝑠+1
G(𝑠) = 𝑠3 +2𝑠2 +2.5𝑠+0.5 and determine whether the system is stable.

b. Plot the poles and zeros in the s-plane PZMAP in Figure 7.

c. Finally, demonstrate the system stability by simulating the impulse response.

BACKGROUND:
The stability of the system can be determined by observing the poles.
1.All the poles are on the left of the imaginary axis the system will be stable.
2.Anyone of the poles are on the right of the imaginary axis, it is unstable.
3.Poles are on the imaginary axis; system will be critically stable.

MATLAB CODE:
clear all,
clc;
num=[1.5 1]
den=[1 2 2.5 0.5]
% Find Transfer function
G=tf(num,den)
% Finding poles of the transfer function
PolesG=roots(den)
poles_RHS=sum(PolesG>0)
if poles_RHS>0
disp('System is unstable')
else
disp('System is stable')
end
% Plotting the pole zero map
figure
pzmap(G)
title('Pole Zero Map')
xlabel('time')
ylabel('Amplitude')
% Plotting Impulse response
figure
impulse(G)
title('Impulse Response')
xlabel('time')
ylabel('Amplitude')
disp('program over')

MATLAB OUTPUT:
No poles are on positive real axis. Hence the system is stable.
INFERENCE:
From the pole zero map it is observed that all the poles are on the left of imaginary axis. So,
the given system stable.

Você também pode gostar