0% found this document useful (0 votes)
41 views

Matlab Code For Step Response of Transfer Function Using Zoh Equivalent Approximation When T 1, 0.1, 0.01

The document contains MATLAB code to simulate the step response of a transfer function using two different discretization methods: zero-order hold equivalent approximation and z=exp(sT) approximation. The code generates step response plots for sampling periods of T=1, 0.1, and 0.1. It analyzes that the rise time increases and settling time decreases for T=1, while rise time decreases and settling time increases for T=0.1.

Uploaded by

Ejaz Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Matlab Code For Step Response of Transfer Function Using Zoh Equivalent Approximation When T 1, 0.1, 0.01

The document contains MATLAB code to simulate the step response of a transfer function using two different discretization methods: zero-order hold equivalent approximation and z=exp(sT) approximation. The code generates step response plots for sampling periods of T=1, 0.1, and 0.1. It analyzes that the rise time increases and settling time decreases for T=1, while rise time decreases and settling time increases for T=0.1.

Uploaded by

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

MATLAB CODE FOR STEP RESPONSE OF TRANSFER FUNCTION

USING ZOH EQUIVALENT APPROXIMATION when T=1, 0.1, 0.01:


%Using ZOH Equivalent Approximation, when T=1
num=[0 0.99995]
den=[2 -0.00009]
u=[1 ones(1,30)]
k=0:30;
x=filter(num,den,u);
subplot(2,1,1);
plot(k,x);
v=[0 30 -1 1];
axis(v);
xlabel('k');
ylabel('h(k)');
title('Step Response of T/F When T=1');
grid on;
%Using ZOH Equivalent Approximation, when T=0.1
num=[0 0.633]
den=[2 -0.734]
u=[1 ones(1,30)]
k=0:30;
x=filter(num,den,u);
subplot(2,1,2);
plot(k,x);
v=[0 30 -1 1];
axis(v);
xlabel('k');
ylabel('h(k)');
title('Step Response of T/F When T=0.1');
grid on;

STEP RESPONSE WAVEFORM:


Step Response of T/F When T=1

h (k )

0.5
0
-0.5
-1

10

15
20
k
Step Response of T/F When T=0.1

25

30

25

30

h (k )

0.5
0
-0.5
-1

10

15
k

20

ANALYSIS FROM THE WAVEFORM:From the step response waveform, we analyze that when T=1,rise
time increases whereas the settling time decreases. The system is stable having
no overshoot. When T=0.1,rise time decreases and settling time increases. The
system is also stable in this case, having no overshoot.

MATLAB CODE FOR STEP RESPONSE OF TRANSFER FUNCTION


USING z=exp(sT) APPROXIMATION when T=1, 0.1, 0.01:
%Using z=exp(st)Approximation,when T=1
num=[0 5]
den=[1 0.000045]
u=[1 ones(1,15)]
k=0:15;
x=filter(num,den,u);
subplot(2,1,1);
plot(k,x);
v=[0 15 0 6];

axis(v);
xlabel('k');
ylabel('h(k)');
title('Step Response of T/F When T=1');
grid on;
%Using z=exp(st) Approximation,when T=0.1
num=[0 5]
den=[1 0.367]
u=[1 ones(1,15)]
k=0:15;
x=filter(num,den,u);
subplot(2,1,2);
plot(k,x);
v=[0 15 0 6];
axis(v);
xlabel('k');
ylabel('h(k)');
title('Step Response of T/F When T=0.1');
grid on;

STEP RESPONSE WAVEFORM:


Step Response of T/F When T=1

h(k )

6
4
2
0

h(k )

10

15

10

15

k
Step Response of T/F When T=0.1

4
2
0

You might also like