Professional Documents
Culture Documents
Vasquez 06TimeResponsesUsingMatlabSimulink
Vasquez 06TimeResponsesUsingMatlabSimulink
6
Time Responses of Dynamic Systems Using Matlab Simulink
1. Objective:
The activity aims to understand the different time responses of dynamic systems using matlab simulink.
3. Discussion:
A dynamic system is a system in which a function describes the time dependence of a point in
a geometrical space. Examples include the mathematical models that describe the swinging of a
clock pendulum, the flow of water in a pipe, and the number of fish each springtime in a lake.
The time response represents how the state of a dynamic system changes in time when subjected
to a particular input. Since the models consist of differential equations, some integration must be performed
in order to determine the time response of the system. For some simple systems, a closed-form analytical
solution may be available. However, for most systems, especially nonlinear systems or those subject to
complicated input forces, this integration must be carried out numerically. Fortunately, MATLAB provides
many useful resources for calculating time responses for many types of inputs.
The time response of a linear dynamic system consists of the sum of the transient response which
depends on the initial conditions and the steady-state response which depends on the system input. These
correspond to the free (homogeneous or zero input) and the forced (inhomogeneous or non-zero input)
solutions of the governing differential equations respectively.
Simulink, developed by MathWorks, is a graphical programming environment for modeling,
simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block
diagramming tool and a customizable set of block libraries. Visual modeling is the graphic representation of
objects and systems of interest using graphical languages.
4. Resources:
Matlab
5. Procedure:
1. To start Simulink from the Matlab IDE, select the Simulink Icon in the toolbar to open the
Simulink Start Page. Click a blank model.
2. Open Simulink Library Browser by clicking Tools and choosing Library Browser. Click
Commonly Used Blocks. Enumerate the different commonly used blocks and identify the
function of each block. Show your answers in Data and Results.
3. Click Continuous . Enumerate the different blocks under Continuous and identify the function of
each block. Show your answers in Data and Results.
1
4. Click Discrete . Enumerate the different blocks under Discrete and identify the function of each
block. Show your answers in Data and Results.
5. Click Sinks . Enumerate the different blocks under Sinks and identify the function of each block.
Show your answers in Data and Results.
6. Click Sources. Enumerate the different blocks under Sources and identify the function of each
block. Show your answers in Data and Results.
7. To determine the step response of the system
The input u is the step block from sources. Drag and drop this step block to the Simulink window. The
transfer function block can be taken from Continuous blocks. Drag and drop two transfer function
blocks and specify the numerical coefficients of the numerator and denominator of the two transfer
functions by double clicking the transfer function blocks. The output y can be determined by using
Scope block which can be taken from Sinks blocks. Drag and drop Scope block to the Simulink window.
Connect them. It should look like this in the Simulink window:
Click the run button and when it is ready, double click the Scope. Save the simulation with the
filename yourSurnameSimPro7. Show the time response of the system in Data and Results.
Compare the results of the previous activity. Are the results the same ?
8. Using following dynamic systems, simulate each of them. Show the assembled blocks and the
result of each simulation. Use step block as the input to the system. Save the simulation using
file names as yourSurnameMatlabExer02Proc8a to yourSurnameMatlabExer02Proc8e.
2
c
9. Repeat Procedure 8 using ramp block as input. Save the simulation using file names as
yourSurnameMatlabExer02Proc9a to yourSurnameMatlabExer02Proc9e
10. Using the dynamic systems in Procedure 9, reduce each of them into a single block and
simulate each of them.
a. Use step block as the input to the system. Save the simulation using file names as
yourSurnameMatlabExer02Proc10Partaa to yourSurnameMatlabExer02Proc10Partae.
b. Use ramp block as the input to the system. Save the simulation using file names as
yourSurnameMatlabExer02Proc8Partba to yourSurnameMatlabExer02Proc8Partbe
3
Course: Laboratory Exercise No.
Group No.: Section:
Group Members: Date Performed:
Date Submitted:
Instructor:
5
vector components must be
specified in each case
14. Out1 Outport blocks are the links from
a system to a destination outside
the system.
15. Product By default, the Product block
outputs the result of multiplying
two inputs: two scalars, a scalar
and a nonscalar, or two
nonscalars that have the same
dimensions.
16. Relational Operator By default, the Relational
Operator block compares two
inputs using the Relational
operator parameter that you
specify. The first input
corresponds to the top input port
and the second input to the
bottom input port.
17. Saturation The Saturation block imposes
upper and lower limits on an input
signal.
18. Scope The Scope block displays inputs
signals with respect to simulation
time.
19. Subsystem A Subsystem block represents a
subsystem of the system that
contains it. The Subsystem block
can represent a virtual subsystem
or a nonvirtual subsystem.
20. Sum The Sum block performs addition
or subtraction on its inputs. This
block can add or subtract scalar,
vector, or matrix inputs. It can also
collapse the elements of a signal.
21. Switch The Switch block passes through
the first input or the third input
based on the value of the second
input. The first and third inputs are
called data inputs. The second
input is called the control input.
22. Terminator Use the Terminator block to cap
blocks whose output ports do not
connect to other blocks.
6
23. Vector Concatenate The Concatenate block
concatenates the signals at its
inputs to create an output signal
whose elements reside in
contiguous locations in memory.
Procedure 3
Continuous
Name of the Block Image of the Block Function
1. Derivative The output is equal to the
derivative of the input.
7
6. PID Controller The PID Controller block output is
a weighted sum of the input
signal, the integral of the input
signal, and the derivative of the
input signal. The weights are the
proportional, integral, and
derivative gain parameters.
7. PID Controller (2DOF) The PID Controller (2DOF) block
generates an output signal based
on the difference between a
reference signal and a measured
system output.
8. State-Space A, B, C, and D matrices can be
specified to create a LTI state
space system. Inputs and outputs
may be vector signals depending
on the sizes of the matrices.
9. Transfer Function Numerator and denominator
polynomials can be specified to
create a standard SISO LTI
system transfer function.
10. Transport Delay The Transport Delay block delays
the input by a specified amount of
time. You can use this block to
simulate a time delay. The input to
this block should be a continuous
signal.
12. Variable Time Delay, The Variable Transport Delay and
Variable Transport Delay Variable Time Delay appear as
two blocks in the Simulink block
library. However, they are the
same Simulink block with different
settings of a Select delay type
parameter. Use this parameter to
specify the mode in which the
block operates.
13. Zero-Pole The Zero-Pole block models a
system that you define with the
zeros, poles, and gain of a
Laplace-domain transfer function.
This block can model single-input
single output (SISO) and single-
input multiple-output (SIMO)
systems.
8
Procedure 4
Discrete
Name of the Block Image of the Block Function
1. Delay Delay input signal by fixed or
variable sample periods
9
7. Discrete PID Controller The Discrete PID Controller
(2DOF) (2DOF) block generates an
output signal based on the
difference between a reference
signal and a measured system
output.
8. Discrete State-Space This is a discrete-time dynamic
system in state-space form. A, B,
C, and D matrices can be
specified, as well as initial
conditions.
9. Discrete-Time Integrator The output of this block is the
discrete-time integration of the
input signal. The integration
methods can be Forward Euler,
Backward Euler, etc
10. Discrete-Transfer Fcn This is the standard form of a
SISO LTI discrete time system.
The transfer function polynomials
are represented as coefficient
vectors in terms of z.
11. Discrete Zero-Pole A discrete-time transfer function
can be represented as list of z-
plane poles and zeros. The gain
can also be specified.
10
14. Memory The Memory block holds and
delays its input by one integration
time step. This block accepts and
outputs continuous signals. The
block accepts one input and
generates one output. Each
signal can be scalar or vector.
15. Resettable Delay The Resettable Delay block
delays the input signal by a
variable sample period and resets
with external signal.
18. Transfer Fcn Lead or Lag The Transfer Fcn Lead or Lag
block implements a discrete-time
lead or lag compensator of the
input. The instantaneous gain of
the compensator is one, and the
DC gain is equal to (1-z)/(1-p),
where z is the zero and p is the
pole of the compensator.
19. Transfer Fcn Real Zero The Transfer Fcn Real Zero block
implements a discrete-time
transfer function that has a real
zero and effectively no pole.
11
21. Variable Integer Delay The Variable Integer Delay block
delays the input signal by a
variable sample period.
Procedure 5
Sinks
Name of the Block Image of the Block Function of the Block
1. Display The Display Sink Block is a digital
readout of a signal at the current
simulation time.
12
6. Stop Simulation This is a special control block
which is triggered to stop the
current simulation when its input
is non-zero.
Procedure 6
Sources
Name of the Block Image of the Block Function of the Block
1. Band-Limited White Noise The Band-Limited White Noise
Source Block generates a
random signal which changes at a
specified sample period. The
strength of the signal and a
random number seed can also be
specified.
2. Chirp Signal The Chirp Signal Source Block
generates a sinusoidal signal
which scans over a range of
frequencies. The initial and final
frequencies as well as the scan
13
time can be specified. The
amplitude is always 1, and the
chirp signal repeats itself after
each frequency scan.
3. Clock The Clock Source Block
generates a signal equal to the
current time in the simulation.
This is useful when the output of
a simulation is exported to
MATLAB but occurs at uneven
time steps. The clock's output
reflects the times at which the
other signals outputs occur.
4. Constant Generate constant value
14
9. From File The From File Source Block
outputs a signal taken from a
specified .mat file. A matrix saved
in MATLAB as a .mat file will
become a signal where the first
row of the matrix specifies the
time values. This is similar to the
Repeating Sequence Source
Block.
10. From Spreadsheet The block reads data values from
a spreadsheet. It interprets the
first column as time and the first
row and the remaining columns
as signals.
11. From Workspace The From Workspace Source
Block is identical to the From File
Source Block except the values
are taken from a variable (or
expression) in the MATLAB
Workspace.
12. Ground Ground unconnected input port
15
15. Ramp The Ramp Source Block
generates a signal which is
initially constant and begins to
increase (or decrease) at a
constant rate at a specified time.
The slope, start time, and initial
output can be specified.
16. Random Number The Random Number Source
Block generates a sequence of
random numbers generated with
the specified random number
seed. Because of the seed, the
same sequence can be applied to
more than one simulation.
17. Repeating Sequence An arbitrary set of points (t,y) can
be specified. These points are
entered as a vector specifying the
time values, and a vector
specifying the corresponding
output values at those times. The
output is linearly interpolated
between the specified time
values. At the last time value, the
output immediately starts over,
possibly with a discontinuous
transition.
18. Repeating Sequence The Repeating Sequence
Interpolated Interpolated block outputs a
discrete-time sequence and then
repeats it.
16
21. Signal Editor Create and edit input signals that
you can organize for multiple
simulations
17
Procedure 7
The results showed a different graph curve compared to the previous experiment. This graph shows a
slightly curvy line wherein the previous graph appears to have parabolic curve.
Procedure 8
18
8b
8c
8d
8e
19
Procedure 9
9b
9c
9d
20
9e
Procedure 10 Part a
10b
10c
21
10d
10e
Procedure 10 Part b
10b
22
10c
10d
10e
7. Conclusion:
I therefore conclude that Simulink library is a big help to familize students with different
commonly used blocks giving them knowledge on how to use these blocks to create linear dynamic system
and transfer functions. The simulink library thus, makes it easier for modeling, simulating and analyzing
multidomain dynamic systems.
8. Further Readings:
Ferraris, G. and Manenti, F. (2010). Interpolation and regression models for the chemical engineer:
solving numerical problems. Germany: Wiley-VCH Verlag
Filo, O. (2010). Information processing by biochemical systems: neural network type configurations.
New Jersey: Wiley.
Gopal, S. (2009). Bioinformatics: a computing perspective. India: McGraw-Hill Science/Engineering
Math.
Jaluria, Y. (2012). Computer methods for engineering with MATLAB applications (2 nd ed.). Boca,
Raton,Florida: CRC Press.
23
Knopf, F. C. (2012). Modeling, analysis and optimization of process and energy systems.Hoboken,
New Jersey: John Wiley and Sons.
Velten, K. (2009). Mathematical modeling and simulation: introduction for scientists and engineers.
Singapore: Wiley-VCH.
24
9. Assessment (Rubric for Laboratory Performance):
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
RUBRIC FOR MODERN TOOL USAGE
(Engineering Programs)
Student Outcome (e): Use the techniques, skills, and modern engineering tools necessary for engineering
practice in complex engineering activities.
Program: Chemical Engineering Course: ECE 006 Section: CH42FB2 2nd Sem SY 2018-2019
Performance Unsatisfactory Developing Satisfactory Very Satisfactory Score
Indicators 1 2 3 4
1. Apply Fails to identify Identifies Identifies modern Recognizes the
appropriate any modern modern techniques and is benefits and
techniques, techniques to techniques but able to apply constraints of
skills, and perform fails to apply these in modern
modern discipline- these in performing engineering tools
tools to specific performing discipline-specific and shows
perform a engineering discipline- engineering task. intention to apply
discipline- task. specific them for
specific engineering engineering
engineering task. practice.
task.
2. Demonstrate Fails to apply Attempts to Shows ability to Shows ability to
skills in any modern apply modern apply fundamental apply the most
applying tools to solve tools but has procedures in appropriate and
different engineering difficulties to using modern effective modern
techniques problems. solve tools when solving tools to solve
and modern engineering engineering engineering
tools to problems. problems. problems.
solve
engineering
problems.
3. Recognize Does not Recognizes Recognizes the Recognizes the
the benefits recognize the some benefits benefits and need for benefits
and benefits and and constraints of and constraints of
constraints constraints of constraints of modern modern
of modern modern modern engineering tools engineering tools
engineering engineering engineering and shows and makes good
tools. tools. tools. intention to apply use of them for
them for engineering
engineering practice.
practice. Total Score