Unit Step Function in Matlab
Unit Step Function in Matlab
Object-: Write a program to find out the unit step response for the given
function-:
S(s2+9s+19)/s3+7s2+14s+8
Apparatus-: Matlab software 7.0.4
Theory-:
Step Response
Similarly to the impulse response, the step response of a system is the output of
the system when a unit step function is used as the input. The step response is a
common analysis tool used to determine certain metrics about a system.
Typically, when a new system is designed, the step response of the system is the
first characteristic of the system to be analyzed.
Convolution
However, the impulse response cannot be used to find the system output from
the system input in the same manner as the transfer function. If we have the
system input and the impulse response of the system, we can calculate the
system output using the convolution operationas such:
(The variable τ (greek tau) is a dummy variable for integration). This operation
can be difficult to perform. Therefore, many people prefer to use the Laplace
Transform (or another transform) to convert the convolution operation into a
multiplication operation, through the Convolution Theorem.
Convolution Theorem
This method of solving for the output of a system is quite tedious, and in fact it
can waste a large amount of time if you want to solve a system for a variety of
input signals. Luckily, the Laplace transform has a special property, called
the Convolution Theorem, that makes the operation of convolution easier:
Convolution Theorem
Convolution in the time domain becomes multiplication in the complex Laplace
domain. Multiplication in the time domain becomes convolution in the complex
Laplace domain.
The Convolution Theorem can be expressed using the following equations:
If we know the input to a given system, and we have the transfer function of the
system, we can solve for the system output by multiplying:
Y(s) = H(s)X(s)
C(s)=R(s).G(s)
C(s)1/s.[(s2+9s+19)/s3+7s2+14s+8]
= s2+9s+19/s3+7s2+14s+8
C(s)=11/3(s+1)-5/2(s+2)-1/6(s+4)
Coding :-
num=[1 7 8]
den=[1 14 12 4]
g=tf(num,den)
grid on
subplot(2,1,1)
step(g)
t=0:0.01:6
c=11/2*exp(-t)-5/2*exp(-2*t)-1/6*exp(-4*t)
grid on
subplot(2,1,2)
plot(t,c)
grid on
graph:-
Step Response
3
2
Amplitude
0
0 5 10 15
Time (sec)
0
0 1 2 3 4 5 6
S2+9s+9/s3 +7s2+14s+8=[a/s+1]+[b/s+4]+[c/s+2]
S2+9s+9=A(s+4)(s+2)+b(s+1)(s+2)+c(s+1)(s+4)
Put s=-1
We get ,
A =11/3
Putting S=-4
We get,
B=-5/2
Putting S=-2
We get,
B=-1/6
Putting these values and taking the laplace transform of that we get,
11/3e-t -5/2e-2t-1/6e-4t
Result:- we have successfully found out the unit step respose of the given
transfer function .
Questions:-
1)Area under a unit impulse function if
Ans) unity
3) If the poles of a control system lie on the imaginary axis in s-plane the system
will be :
Ans)marginally stable.