Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
ECE327: Laboratory Exercise 1
Solution of Exercise 1.
p = [1 -2 1];p_roots = roots(p)
p_roots = 2×1 1 1
p_value = polyval(p,1)
p_value = 0
Solution of Exercise 2.
% Part (a) c = [3 1.5 -1];p = [1 -4.3 2];k = [2];[num,den] = residue(c,p,k);sys = tf(num,den)
sys = 2 s^3 + 6.1 s^2 - 22.7 s - 1.3 ------------------------------ s^3 + 1.3 s^2 - 10.9 s + 8.6 Continuous-time transfer function.
%% Part (b)z = [-6; -5; 0];p = [-3+4j; -3-4j; -2; -1];k = [1];sys = zpk(z,p,k)
sys = s (s+6) (s+5) --------------------------- (s+2) (s+1) (s^2 + 6s + 25) Continuous-time zero/pole/gain model.
Solution of Exercise 3.
%% Part (a)numg = [6 0 1];deng = [1 3 3 1];sysg = tf(numg,deng)
1
sysg = 6 s^2 + 1 --------------------- s^3 + 3 s^2 + 3 s + 1 Continuous-time transfer function.
pole(sysg)
ans = 3×1 complex -1.0000 + 0.0000i -1.0000 - 0.0000i -1.0000 + 0.0000i
%% Part (b)n1 = [1 1]; n2 = [1 2]; d1 = [1 2j]; d2 = [1 -2j]; d3 = [1 3];numh = conv(n1,n2); denh=conv(d1,conv(d2,d3));sysh = tf(numh,denh)
sysh = s^2 + 3 s + 2 ---------------------- s^3 + 3 s^2 + 4 s + 12 Continuous-time transfer function.
num = conv(numg,denh);den = conv(deng,numh);sys = tf(num,den) % G/H
sys = 6 s^5 + 18 s^4 + 25 s^3 + 75 s^2 + 4 s + 12 ------------------------------------------- s^5 + 6 s^4 + 14 s^3 + 16 s^2 + 9 s + 2 Continuous-time transfer function.
%% part(c)clfpzmap(sys);grid;
2
Solution of Exercise 4.
%% Part (i)syms t%% (a)theta=45*pi/180;f=8*t^2*cos(3*t+theta);pretty(f)
2 / pi \t cos| 3 t + -- | 8 \ 4 /
F=laplace(f);F=simplify(F);pretty(F)
3 2 sqrt(2) (- 8 s + 72 s + 216 s - 216)- -------------------------------------- 2 3 (s + 9)
%% (b)theta=60*pi/180;f=3*t*exp(-2*t)*sin(4*t+theta);pretty(f)
3
/ pi \t sin| 4 t + -- | exp(-2 t) 3 \ 3 /
F=laplace(f);F=simplify(F);pretty(F)
2(8 s + 4 sqrt(3) s - 12 sqrt(3) + sqrt(3) s + 16) 3---------------------------------------------------- 2 2 2 (s + 4 s + 20)
%% Part (ii)syms s%% (a)G=(s^2+3*s+10)*(s+5)/((s+3)*(s+4)*(s^2+2*s+100));pretty(G);
2 (s + 5) (s + 3 s + 10)-------------------------------- 2(s + 3) (s + 4) (s + 2 s + 100)
g=ilaplace(G);pretty(g)
/ sqrt(11) sin(3 sqrt(11) t) \ exp(-t) | cos(3 sqrt(11) t) - -------------------------- | 5203exp(-3 t) 20 exp(-4 t) 7 \ 57233 /------------ - ----------- + --------------------------------------------------------------- 103 54 5562
%% (b)G=(s^3+4*s^2+2*s+6)/((s+8)*(s^2+8*s+3)*(s^2+5*s+7));pretty(G);
3 2 s + 4 s + 2 s + 6------------------------------------- 2 2(s + 8) (s + 8 s + 3) (s + 5 s + 7)
g=ilaplace(G);g1=simplify(g);pretty(g1)
/ / sqrt(3) t \ \ | sqrt(3) sin| --------- | 131 | / 4262 sqrt(13) sinh(sqrt(13) t) \ / 5 t \ | / sqrt(3) t \ \ 2 / |exp(-4 t) | cosh(sqrt(13) t) - ------------------------------ | 1199 exp| - --- | | cos| --------- | + ---------------------------- | 65 \ 15587 / \ 2 / \ \ 2 / 15 / exp(-8 t) 266-------------------------------------------------------------------- - ------------------------------------------------------------------- - ------------- 417 4309 93
4
Solution of Exercise 5.
Hsys=tf([-2 0],[1 4 6 4])
Hsys = -2 s --------------------- s^3 + 4 s^2 + 6 s + 4 Continuous-time transfer function.
subplot(1,2,1)step(Hsys,10)gridsubplot(1,2,2)impulse(Hsys,10)grid
Solution of Exercise 6.
z=-0.5;p=[-2 -5];k=1;sys=zpk(z,p,k)
5
sys = (s+0.5) ----------- (s+2) (s+5) Continuous-time zero/pole/gain model.
clfstep(sys);grid
% stepinfo(sys) %%or use% linearSystemAnalyzer(sys)
Solution of Exercise 7.
num = [1 2 1]; den = [1 3.8 8.76 5.96];sys = tf(num,den);% figure(1),pzmap(sys);poles = pole(sys)
poles = 3×1 complex -1.4000 + 2.0000i -1.4000 - 2.0000i -1.0000 + 0.0000i
zeros = zero(sys)
zeros = 2×1 -1
6
-1
t=0:.01:10;u=2*cos(1.6*t);clffigure(2),subplot(311),impulse(sys);subplot(312),step(sys);subplot(313),lsim(sys,u,t);
7