Linear System Simulation
Linear System Simulation
Linear System Simulation
( )
( )
( )
Where,
K Gain;
T Time constant
PROGRAM (Syntax)
FIRST ORDER SYSTEM STEP RESPONSE
% First Order System Step response [K/(sT+1)];
N=[K];
%Numerator Coefficients
D=[T 1];
%Denominator Coefficients
G=tf(N,D);
%Transfer Function
stepplot(G);
%Step response
If more than one TF use stepplot(G1,G2)
stepinfo(G);
grid;
title('G(s)=K/(sT+1)')
xlabel('TIME');
ylabel('STEP RESPONSE');
FIRST ORDER SYSTEM IMPULSE RESPONSE
% First Order System Impulse response [K/(sT+1)];
N=[K];
%Numerator Coefficients
D=[T 1];
%Denominator Coefficients
G=tf(N,D);
%Transfer Function
impulseplot(G);
%Impulse response
grid;
title('G(s)=K/(sT+1)')
xlabel('TIME');
ylabel('IMPULSE RESPONSE');
Note:
t = 0 : 0.1 : 1
plot(x,y)
plot((x1,y1),(x2,y2),(x3,y3))
gtext(text)
Ex. No.:
Date:
AIM
To simulate time response characteristics of the first order and second order linear SISO
systems.
THEORY
General form of transfer function (Type n; Order - x)
( )
( )
( )
r(t)
R(s)
Impulse
Step
1/s
Ramp
1/s2
Parabolic
t2/2
1/s3
( )
( )
()
( )
[
( )]
()
()
),
()
SIMULATION
Simulation Blocks
SIMULATUION (MODEL)
Observation
C() Final Value, Rise time (50% of final value),Settling time, Time Constant.
Theoretical
Final Value c()
Rise Time
Settling Time
Time Constant
Steady State Error
Practical
PROCEDURE
1. Write a program for the given transfer functions.
2. Simulate it using MATLAB software.
3. Observe the waveforms and tabulate the observations.
SISO linear systems can be easily defined with transfer function analysis. The transfer
function approach can be linked easily with the state variable approach. The state model of a
linear-time invariant system is given by the following equations:
(t) = A X(t) + B U(t)
Y(t) = C X(t) + D U(t)
Where
State equation
Output equation
X [n x 1] State vector
U [m x 1] Input Vector
Y [p x n] Output Vector
A [n x n] System Matrix
B [n x m] Input Matrix
C [p x n] Output Matrix
D [p x m] Transmission Matrix
% A Matrix
B=[1;0];
% B Matrix
C=[0 1];
% C Matrix
D=[0];
% D Matrix
t=0:0.1:2
Step(A,B,C,D,t);
title(Title of the Experiment);
SIMULATION
Theoretical
Practical
Rise Time - tr
Peak Time - tp
Peak Overshoot - %Mp
Settling Time - ts
Steady State Error - ess
Note:
To convert between State Space to Transfer function use command ss2tf
To convert between Transfer function to State Space use command tf2ss
MUX block can be used to merge two signals in one plot.
( )
()
( )]
Damping Ratio
Underdamped
<1
Overdamped
)
(
>1
=1
Undamped
=0
Overdamped
)
(
Damping ratio
Critically damped
)
(
()
3. Peak Time(tp)
It is the time taken for the response to reach the peak value for the very first time.or It is
the time taken for the response to reach the peak overshoot, Mp.
6. Decay Ratio
The ratio of the amplitude of first two successive peaks about steady state value. (Second
overshoot amplitude / First overshoot amplitude)
RESULT
()
()
( )
( )