Linear System Simulation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

FIRST ORDER (TYPE 0) SYSTEM

( )

( )
( )

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);

%give details on step response

grid;

% Output plot having 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

% time scale from 0 to 1 in steps of 0.1

plot(x,y)

% Graph plot x axis vs y axis

plot((x1,y1),(x2,y2),(x3,y3))

% for multiple plots at same graph

gtext(text)

% to add text in plot line

Ex. No.:

DIGITAL SIMULATION OF FIRST & SECOND ORDER


SYSTEMS

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)
( )
( )

( )

C(s) Response of the system


R(s) Input to the system
Input

r(t)

R(s)

Impulse

(t) =1 for t=0

Step

u(t) = 1 for t>0

1/s

Ramp

1/s2

Parabolic

t2/2

1/s3

First Order system


( )
( )

( )
( )
()

( )
[

( )]
()

For unit impulse input

), The output starts at (K/T) at t=0 and decreases

exponentially and reaches to zero as t


For unit step input

()

),

exponentially to a steady state value K as t


For unit ramp input

()

The output starts at zero for t=0, increases

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

Step Response Characteristics


Time Constant (T) Time taken for the step response to reach 63.2% of the final value K.
When the time constant is small, it reaches steady state quickly. As T increases response
becomes sluggish.
Rise time (tr) Time required to reach 90% of the final state.
Settling time (ts) Time required to reach 2% tolerance band (98% to 102%) of the final value.

PROCEDURE
1. Write a program for the given transfer functions.
2. Simulate it using MATLAB software.
3. Observe the waveforms and tabulate the observations.

STATE VARIABLE METHOD

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

In Transfer function form T(s) = C [s I A] -1B + D


State Variable approach is a more general mathematical representation of a system,
which, along with the output, yields information about the state of the system variables at some
predetermined points along the flow of signals. It is a direct time-domain approach, which
provides a basis for modern control theory and system optimization. The state vector X
determines a point (called state point) in an n-dimensional space, called state space. The state
and output equations constitute the state model of the system.

STEP RESPONSE OF SECOND ORDER SYSTEM (STATE SPACE METHOD)


% Program Title
A=[1 0; 1 -1];

% A Matrix

B=[1;0];

% B Matrix

C=[0 1];

% C Matrix

D=[0];

% D Matrix

t=0:0.1:2

% Scale of the output plot

Step(A,B,C,D,t);
title(Title of the Experiment);

SIMULATION

Second Order Systems Observations


Time Constants

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.

SECOND ORDER SYSTEM


( )
( )

( )
()

( )]

Damping Ratio

Unit Impulse Response

Underdamped

<1
Overdamped

)
(

>1

Unit Step Response

=1
Undamped

=0

Overdamped

)
(

Damping ratio

Critically damped

)
(

()

Time Domain Specifications


1. Delay Time (td)
It is the time taken for response to reach 50% of the final, for the very first time.
2. Rise Time (tr)
It is the time taken for response to raise from 10 to 90% for the very first time.
For under damped system, the raise time is calculated from 0 to 100% .
For over damped system it is the time taken by the response to raise from 10% to 90%
For critically damped system. It is the time taken for response to raise from 5% to 95%.

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.

Period of oscillations = 2tp

4. Peak Overshoot (Mp)


It is defined as the ratio of the maximum value measured from final value to final value.
It indicates relative stability of system.
Let final value =c()

Maximum value =c(tp)


( )
( )
( )

5. Settling Time (ts)


It is defined as the time taken by the response to reach and stay within a specified error.
It is usually expressed as % of final value. The usual tolerable error is 2% or 5% of the final
value.
(
(

6. Decay Ratio
The ratio of the amplitude of first two successive peaks about steady state value. (Second
overshoot amplitude / First overshoot amplitude)

7. Steady State Error (ess)


The error (difference) between input (or desired output) and actual output as t tends to
infinity.
()

RESULT

()

()

( )

( )

You might also like