U I (UIU) : Expt. No. 1 M B, L T, T F A. Handling Polynomial in MATLAB
U I (UIU) : Expt. No. 1 M B, L T, T F A. Handling Polynomial in MATLAB
U I (UIU) : Expt. No. 1 M B, L T, T F A. Handling Polynomial in MATLAB
EXPT. NO. 1
Laplace transformation F(s) of a function f(t) and the inverse Laplace transform of a function F(s) can
be obtained as shown in the following table:
syms t syms t :
constructs a symbolic object for time variable t
laplace (ft) laplace(ft) :
finds the Laplace Transform of ft
syms s t syms s t :
constructs symbolic objects for time t and the Laplace variable s
ilaplace(fs) ilaplace(fs):
finds the Inverse Laplace Transform of fs
Find the Inverse Laplace Transform of the
function, 1/4 -1/4*exp(-t)*cos(3^(1/2)*t)
2s 1 +7/12*3^(1/2)*exp(-t)*sin(3^(1/2)*t)
F (s)
s s 2 s 4
2
Thus, the inverse Laplace transform is
f (t ) e t cos 3t e sin 3t
MATLAB command : 1 1 7 3 t
>> syms s t; 4 4 12
>> fs=(2*s+1)/(s*(s^2+2*s+4));
>> ft=ilaplace(fs)
Find the Time-Domain representation of the
output of a system:
ft =
1 s4
C ( s ) R ( s ).G ( s ) .
s ( s 2)( s 3) Make sure that this is consistent with the output
found in the section of partial fraction
tf2zp( ) tf2zp( ) finds the zeros poles and gains of a transfer function.
and pzmap( ) plots the pole zero map of the transfer function.
pzmap( )
Find the location of zeros and poles and plot 2
the pole-zero map of the system, whose
transfer function is given by, >> pzmap(n,d)
2 s 8s 6
2
F ( s) 4 Pole-Zero Map
s 6 s 3 12 s 2 24 s 2.5
MATLAB command : 2
-3 0
-1 -0.5
p= -1
0 -1.5
-4.5198 -2
-0.7401 + 2.1822i
-2.5
-0.7401 - 2.1822i -5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0
Real Axis
k=
pole and zero location using pzmap function.
1.8
Output : 1.6
Transfer function: 1.4
3s+2 1.2
-----------------------
Amplitude
0.4
Impulse Response
0.7 0.2
0
0 5 10 15 20 25
0.6
Time (sec)
MATLAB code : 2
Amplitude
output
time=[t1 t2];
x = [2*ones(size(t1)) 0.5*ones(size(t2)) ]; 1
input
y=lsim(G,x,time); 0.5
plot(time,y,time,x,'--') 0
0 1 2 3 4 5 6 7 8 9 10
gtext('input') Time(Sec)
C. Home Work:
1.1 Obtain the Laplace transform of the following f(t) using MATLAB.
i. f(t) = e 3t cos 4t
ii. f(t) = 1-2e-4t +e-5t
1.2 Obtain the inverse Laplace transform of the following F(s).
i. F(s) = (s5 + 8 s4 + 23 s3 + 35 s2 + 28 s + 3) / (s3 + 6 s2 + 8 s)
ii. F(s) = [10(s + 2) (s +4)] / [( s + 1) (s + 3) (s + 5)2 ]
1.3 Given the zeros, poles and gain K of B(s)/A(s). Obtain the function B(s)/A(s).
i. There is no zero. Poles are at -1 + 2j and 1 2j. K = 10.
ii. A zero is at 1. Poles are at 2, 4 and 8. K = 12.
1.4 Obtain a plot of the ramp response of the system whose transfer function is shown below:
3s 2
G ( s)
2 s 4 s 2 5s 1
3