Uploaded by kashif4885

Lab 3

advertisement
Lab no 3
3.1 Objectives
The objective of this LAB is to familiarize students with following functions
of MATLAB® relevant to block reduction.
3.2 Transfer functions
Given a transfer function:
Writing polynomial,
clear all clc
num = [1 3 5];
den1 = [1 2];
den2 = [1 2 9];
Multiplying denominator terms,
den = conv(den1, den2);
Printing a transfer function
printsys(num,den)
Finding roots of a polynomial
den_r = roots(den)
Combining roots to form polynomial
den = poly(den_r)
Value of a polynomial
4-46
Finding value of a polynomial at = −. where, is any number.
Val_den = polyval(den,s)
Plotting poles and zeros
pzmap(num,den)
3.3
Block Diagram Models
Series Connection
3.3.1
series()
Parallel Connection
parallel()
Feedback Connection
feedback()
Minimizing a transfer function
minreal()
Example: To show all above operations
%--------------------------------------------------------------------
4-47
% Author
: Liaquat Ali Khan
% Date : xx-xx-xxx
% Lab No.
: 1
% Class
: BEMTS-VI A&B
% File name
: blk_reduction_ex.m
% Description
: The function implements a transfer function and
%
demo
%
for following functions:
%
reducing blocks in series: series()
%
reducing blocks in parallel: parallel()
%
calculating feedback: feedback()
%-------------------------------------------------------------------% Defining two functions Gs1 and Gs2
num1=[1 2];den1=[1 5 6]; num2=[1 4];
den2=[5 3 4]; printsys(num1,den1)
printsys(num2,den2) Gs1 =
tf(num1,den1); Gs2 = tf(num2,den2);
% series() sys =
series(Gs1,Gs2) pause
% parallel() sys =
parallel(Gs1,Gs2) pause
sys = parallel(Gs1,-Gs2) pause
sys = feedback(Gs1,1,+1) pause
sys = feedback(Gs1,1,-1) pause
% feedback
sys = feedback(Gs1,Gs2,+1) pause
sys = feedback(Gs1,Gs2,-1) pause
%-------------------------------------------------------------------% End
%--------------------------------------------------------------------
Example: To show minreal() operations
%-------------------------------------------------------------------% Author
: Liaquat Ali Khan
% Date
: xx-xx-xxx
% Lab No.
: 1
% Class
: BEMTS-VI A&B
% File name
: min_real_ex.m
% Description
: The function implements a transfer function and
%
demo
%
for following functions:
%
minimizing a transfer function using minreal()
%-------------------------------------------------------------------% Defining a T(s) num =
[1 -1 0] den = [1 0 0 1] printsys(num,den)
pause sys=tf(num,den);
min_sys = minreal(sys)
pause
%-------------------------------------------------------------------% End
%--------------------------------------------------------------------
4-48
4.4 LAB Task
a) Consider the feedback system
i.
Compute the closed-loop transfer function using the series and
feedback functions, and display the result with the printsys
function.
ii.
Obtain the closed-loop system unit step response with the step
function, and verify that final value of the output is 2/5.
b) Consider the block diagram.
4-49
i.
Use MATLAB to reduce the block diagram in Figure and compute
the closed-loop transfer function.
ii.
Generate a pole-zero map of the closed-loop transfer function in
graphical from using the pzmap function.
iii.
Determine explicitly the poles and zeros of the closed-loop
transfer function using the roots function, and correlate the
results with the pole-zero map in part (ii).
Deliverables:
• Please submit your lab report on Google Classroom.
• You have one week to complete your lab report according to following parameters.
• It is mandatory requirements to use one column IEEE Latex template for your report.
• Write an “Abstract” as beginning note of your lab report.
• The report should be appropriate including all figures.
• Finish your lab report with “Conclusion”.
• In the end, please add a note, commenting on the utility and appropriateness of the lab
report.
4-50
4-51
Download