You are on page 1of 2

ADIGRAT UNIVERSITY

DEPARTMENT OF ELECTRICAL & COMPUTER ENGG


ECEg3153: Introduction to Control System

Lab- 0: Familiarization with MatLab main commands used for control system analysis.

Objective:

Familiarize how to use the following matlab commands/functions: roots, poly, conv, polyval, tf,
pzmap, pole and zero.
Find the roots of characteristics equation or poles of transfer function(TF), zeros of TF,

a. roots:this command display the roots of the given polynomial

Ex.F(s) = s3+3s2+4,
Roots can be found out as
F= [1 3 0 4];
R = roots (F)
b. poly: this command is used to reconstruct the polynomial from the given roots
F= poly(R)
c. polyval: this command Evaluates polynomial at specific value
ex. Evaluate the polynomial G(s) = s4 + 5s3 + 2s2 + 8s +5 at x = 1,3, and 4:
G = [1 5 2 8 5];
polyval(G,[1 3 4])
d. tf: this command is used to enter transfer functions.
Method -1: Ex. H(s) = (s+2)/(s2 + 5) ,you would type H = tf([1,2],[1 0 5]). The first
parameter is a row vector of the numerator coefficients. Similarly, the second parameter
is a row vector of the denominator coefficients.
Method-2: Ex. s=tf(s);
F=1/(s+1); and G=10/(s^2 +5*s +10)
e. conv: this command is used to convolve two polynomials. It is particularly useful for
determining the expanded coefficients for factored polynomials.
Ex. H(s) = (s+2)/(s+1)(s+3) by typing H = tf([1 2],conv([1 1],[1 3])).
f. pzmap: computes the poles and zeros of thetransfer function and plots them in the
complex plane. The poles are plotted as x's and the zeros are plotted as o's.
Ex.Draw the poles and zeros of C(s) = (s+1)/(s^2+2*s+4)
pzmap([1 1],[1 2 4])
[P,Z] = pzmap([1 1],[1 2 4]) returns the poles and zeros of the system in two column
vectors P and Z. No plot is drawn on the screen.
g. pole: returns the poles p of the transfer function.
Ex. Find only the poles of the C(s) = (s+1)/(s^2+2*s+4)
P= pole ([1 1],[1 2 4])
h. zero: returns the zeros z of the transfer function.
i. zpk: Constructs zero-pole-gain model or converts to zero-pole-gain format.
H = zpk([1 1],[1 2 4])
ADIGRAT UNIVERSITY
DEPARTMENT OF ELECTRICAL & COMPUTER ENGG
ECEg3153: Introduction to Control System

j. laplace- this command is used to transform a function in time domain to s-domain.


Ex1. f(t) = t4
symst
f=t^4;
laplace (f)
to make more readable
pretty(ans)
Ex2. f(t) = exp(-a*t)
syms a x t
f = exp(-a*t);
laplace (f) laplace transform in s-domain
laplace(f,x)laplace transform in x-domain

Exercise1
Find the laplace transform of f(t)= -1.25 + 3.5t*exp(-2t) + 1.25*exp(-2t)

k. ilaplace- this command is used to convert from s-domain to time domain.


Ex1. F(s) = 1/s2
syms s
F = 1/s^2;
ilaplace(F)
Ex2. F(s)= 1/(s-a)2
syms a x
g= 1/(s-a)^2;
ilaplace(g) inverse laplace in s-domain
ilaplace(g,x) inverse laplace in x-domain

Exercise2
Find the inverse laplace transform of F(s) = (s+3)/((s+4)(s+7)2)

You might also like