0% found this document useful (0 votes)
60 views5 pages

Codes Results: Num (0 0 2 1) Den (6 10 20 5) Printsys (Num, Den,)

The document contains code that defines and analyzes various continuous-time transfer functions using MATLAB. It defines transfer functions using the tf() function, converts them to other representations like zpk models and state-space, and takes the Laplace transform. Key steps include defining a transfer function, obtaining its poles and zeros, converting it to alternative models, and taking the Laplace inverse to find the impulse response.

Uploaded by

Manzur Prokorsho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

Codes Results: Num (0 0 2 1) Den (6 10 20 5) Printsys (Num, Den,)

The document contains code that defines and analyzes various continuous-time transfer functions using MATLAB. It defines transfer functions using the tf() function, converts them to other representations like zpk models and state-space, and takes the Laplace transform. Key steps include defining a transfer function, obtaining its poles and zeros, converting it to alternative models, and taking the Laplace inverse to find the impulse response.

Uploaded by

Manzur Prokorsho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Codes Results

num=[0 0 2 1] num/den =
den=[6 10 20 5]
printsys(num, den, 's')
2s+1
-------------------------
6 s^3 + 10 s^2 + 20 s + 5

>> num=[0 0 2 1]; num/den =


den=[6 10 20 5];
printsys(num, den, 's'); 2s+1
sys=tf(num, den) -------------------------
6 s^3 + 10 s^2 + 20 s + 5

sys =

2s+1
-------------------------
6 s^3 + 10 s^2 + 20 s + 5

Continuous-time transfer function.

>> num=[0 0 2 1];


den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den)
step(num,den)
num=[0 0 2 1]; r=
den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den); -0.0137 - 0.1026i
step(num,den); -0.0137 + 0.1026i
[r,p,k]=residue(num,den) 0.0275 + 0.0000i
root=roots(r)

p=

-0.6917 + 1.5694i
-0.6917 - 1.5694i
-0.2833 + 0.0000i

k=

[]
num=[0 0 2 1]; root =
den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den); 1.0000 + 0.0000i
step(num,den); -0.0352 + 0.2629i
[r,p,k]=residue(num,den)
root=roots(r) >>

num=[0 0 2 1]; system =


den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den); 10 (s+2)
step(num,den); -----------------
[r,p,k]=residue(num,den); (s+3) (s+5) (s+1)
root=roots(r);
system = zpk([-2], [-3 -1 -5], 10) Continuous-time zero/pole/gain model.

num=[0 0 2 1]; system =


den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den); 10 (s+2) (s+1)
step(num,den); -----------------
[r,p,k]=residue(num,den); (s+3) (s+5) (s+1)
root=roots(r);
system = zpk([-2 -1], [-3 -1 -5], 10) Continuous-time zero/pole/gain model.
num=[0 0 2 1];
den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den);
step(num,den);
[r,p,k]=residue(num,den);
root=roots(r);
system = zpk([-2 -1], [-3 -1 -5], 10)
step(system)

num=[0 0 2 1]; system2 =


den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den); 10 s^2 + 20 s + 30
step(num,den); -----------------------
[r,p,k]=residue(num,den); s^3 + 9 s^2 + 23 s + 15
root=roots(r);
system = zpk([-2 -1], [-3 -1 -5], 10) Continuous-time transfer function.
step(system)
system2=tf([0 10 20 30], [1 9 23 15])

num=[0 0 2 1];
den=[6 10 20 5];
printsys(num, den, 's');
sys=tf(num, den);
step(num,den);
[r,p,k]=residue(num,den);
root=roots(r);
system = zpk([-2 -1], [-3 -1 -5], 10)
step(system)
system2=tf([0 10 20 30], [1 9 23 15])
step(system2)
s=sym('s')
system3=(10*s^2+30*s+20/(s^3+9*s^2+23*s+15))

system3 =

30*s + 20/(s^3 + 9*s^2 + 23*s + 15) + 10*s^2


pretty(system3) system3 =

30*s + 20/(s^3 + 9*s^2 + 23*s + 15) + 10*s^2

20 2
30 s + --------------------- + 10 s
3 2
s + 9 s + 23 s + 15
ilaplace(system3) >> ilaplace(system3)

ans =

(5*exp(-t))/2 - 5*exp(-
3*t) + (5*exp(-5*t))/2 +
30*dirac(1, t) +
10*dirac(2, t)

t=sym('t') 2*exp(-t) - 2*t*exp(-2*t)


f=2*exp(-t)-2*t*exp(-
2*t)
laplace(t)
pretty(laplace(t)) ans =

1/s^2

1
--
2
s

>>
system1=tf([0 0 1], [2 system1 =
20 10])
1
-----------------
2 s^2 + 20 s + 10

Continuous-time
transfer function.

[A,B,C,D]=tf2ss([0 0 A=
1], [2 20 10])
-10 -5
1 0

B=

1
0

C=

0 0.5000
D=

You might also like