You are on page 1of 6

MATLAB Command Window Page 1

>> % Alya Shafa Syafii


% Tugas 1

num=[1];
den=[1 1.6 0];
g1=tf(num,den)
t1=feedback(g1,1)
d1=c2d(t1,.1,'zoh')
step(d1,'g')
hold on

g1 =

1
-----------
s^2 + 1.6 s

Continuous-time transfer function.

t1 =

1
---------------
s^2 + 1.6 s + 1

Continuous-time transfer function.

d1 =

0.00474 z + 0.004494
----------------------
z^2 - 1.843 z + 0.8521

Sample time: 0.1 seconds


Discrete-time transfer function.

>> num1=[10];
den1=[1 1.6 0];
g2=tf(num1,den1)
MATLAB Command Window Page 2

t2=feedback(g2,1)
d2=c2d(t2,.1,'zoh')
step(d2,'m')
hold on

g2 =

10
-----------
s^2 + 1.6 s

Continuous-time transfer function.

t2 =

10
----------------
s^2 + 1.6 s + 10

Continuous-time transfer function.

d2 =

0.04705 z + 0.0446
----------------------
z^2 - 1.761 z + 0.8521

Sample time: 0.1 seconds


Discrete-time transfer function.

>> Kp=500;
Kd=10;
numc=[Kd Kp]
numo=conv(numc,num)
deno=den
g3=tf(numo,deno)
t3=feedback(g3,1)
d3=c2d(t3,.1,'zoh')
step(d3,'b')
MATLAB Command Window Page 3

hold on

numc =

10 500

numo =

10 500

deno =

1.0000 1.6000 0

g3 =

10 s + 500
-----------
s^2 + 1.6 s

Continuous-time transfer function.

t3 =

10 s + 500
------------------
s^2 + 11.6 s + 500

Continuous-time transfer function.

d3 =

1.401 z + 0.5338
-----------------------
z^2 + 0.6218 z + 0.3135
MATLAB Command Window Page 4

Sample time: 0.1 seconds


Discrete-time transfer function.

>> Kp=500;
Kd=5;
numc=[Kd Kp]
numo=conv(numc,num)
deno=den
g3=tf(numo,deno)
t3=feedback(g3,1)
d3=c2d(t3,.1,'zoh')
step(d3,'y')
hold on

numc =

5 500

numo =

5 500

deno =

1.0000 1.6000 0

g3 =

5 s + 500
-----------
s^2 + 1.6 s

Continuous-time transfer function.

t3 =
MATLAB Command Window Page 5

5 s + 500
-----------------
s^2 + 6.6 s + 500

Continuous-time transfer function.

d3 =

1.474 z + 0.9023
-----------------------
z^2 + 0.8596 z + 0.5169

Sample time: 0.1 seconds


Discrete-time transfer function.

>> Kp=500;
Kd=.01;
numc=[Kd Kp]
numo=conv(numc,num)
deno=den
g3=tf(numo,deno)
t3=feedback(g3,1)
d3=c2d(t3,.1,'zoh')
step(d3,'r')
hold on

numc =

0.0100 500.0000

numo =

0.0100 500.0000

deno =

1.0000 1.6000 0
MATLAB Command Window Page 6

g3 =

0.01 s + 500
------------
s^2 + 1.6 s

Continuous-time transfer function.

t3 =

0.01 s + 500
------------------
s^2 + 1.61 s + 500

Continuous-time transfer function.

d3 =

1.543 z + 1.446
----------------------
z^2 + 1.137 z + 0.8513

Sample time: 0.1 seconds


Discrete-time transfer function.

>>

You might also like