Sunteți pe pagina 1din 22

Process Control Matlab Laboratory Exercise No.

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.
2. Intended Learning Outcomes (ILOs):
The students shall be able to:
2.1 Determine the different 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.
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.
1
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: ECE 006 Laboratory Exercise No.: 6
Group No.: Section: CH42FB2
Group Members: Date Performed: September 20, 2018
Tayo, Neriza Joy R. Date Submitted:
Instructor:
Engr. Crispulo Maranan
6. Data and Results:
Procedure 2
Table of Commonly Used Blocks
Name of the Block Image of the Block Function
The Bus Creator block combines a
1. Bus Creator set of signals into a bus.

The Bus Selector block outputs a


2. Bus Selector specified subset of the elements of
the bus at its input.

The Constant block generates a real


3. Constant or complex constant value

The Data Type Conversion block


4. Data Type Conversion converts an input signal of any
Simulink data type to the data type
that you specify

The Delay block outputs the input of


5. Delay the block after a delay

The Demux block extracts the


6. Demux components of an input vector signal
and outputs separate signals

4
You can use the Discrete-Time
7. Discrete –Time Integrator Integrator block in place of the
Integrator block to create a purely
discrete system.

The Gain block multiplies the input


8. Gain by a constant value (gain)

The Ground block connects to


9. Ground blocks whose input ports do not
connect to other blocks

Inport blocks are the links from


10. In1 outside a system into the system.

The Integrator block outputs the


11. Integrator value of the integral of its input
signal with respect to time

The Logical Operator block


12. Logical Operator performs the specified logical
operation on its inputs

The Mux block combines its inputs


13. Mux into a single vector output

This block receives entities, which


14. Out1 depart through one of multiple entity
output ports.

Multiply and divide scalars and


15. Product nonscalars or multiply and invert
matrices

Perform specified relational


16. Relational Operator operation on inputs

5
The Saturation block imposes upper
17. Saturation and lower limits on an input signal

The real-time Scope block acquires


18. Scope data in chunks of size Number of
samples from the real-time
application that is executing on the
target computer

Subsystem whose execution is


19. Subsystem triggered by external input

The Sum block performs addition or


20. Sum subtraction on its inputs

The switch block models a two


21. Switch terminal switch

Use the Terminator block to cap


22. Terminator blocks whose output ports do not
connect to other blocks

The Concatenate block


23. Vector Concatenate 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
Numerical derivative: du/dt.
1. Derivative
Continuous-time integration of
2. Integrator the input signal.
Second-order continuous-time
3. Integrator second-order integration of the input signal.

6
Second-order continuous-time
4. Integrator second-order integration of the input signal.
limited
Continuous-time integration of
5. Integrator Limited the input signal.

This Block implements


6. PID controller continuous- and discrete-time
PID control algorithms and
includes advanced features such
as anti-windup, external reset,
and signal tracking.
This block implements
7. PID Controller (2DOF) continuous- and discrete-time
PID control algorithms with
setpoint weighting and includes
advanced features such as anti-
windup, external reset, and signal
tracking.

8. State-space State-space model:

dx/dt = Ax + Bu
y = Cx + Du

The numerator coefficient can be


9. Transfer Fcn a vector or matrix expression. The
denominator coefficient must be a
vector. The output width equals
the number of rows in the
numerator coefficient.
Apply specified delay to the input
10. Transport Delay signal. Best accuracy is achieved
when the delay is larger than the
simulation step size.
The block can be used to
11. Variable Time Delay simulate the variable transport
delay phenomenon such as
incompressible liquid flow in a
pipe.

7
The block can be used to
12. Variable Transport Delay simulate the variable transport
delay phenomenon such as
incompressible liquid flow in a
pipe.

Matrix expression for zeros.


13. Zero-pole Vector expression for poles and
gain. Output width equals the
number of columns in zeros
matrix, or one if zeros is a vector.

Procedure 4
Discrete
Name of the Block Image of the Block Function

1. Delay Delay input signal by a specified


number of samples.

Output the current input value


2. Difference minus the previous input value.

Discrete-time derivative of the


3. Discrete Derivative input.

This block only works with fixed


sample rates. Do not use this block
in subsystems with a non-periodic
trigger.

Independently filter each channel


4. Discrete Filter of the input over time using a
discrete IIR filter. Specify the
numerator and denominator
coefficients in ascending order of
powers of 1/z.

Independently filter each channel


5. Discrete FIR filter of the input over time using an
FIR filter. You can specify filter
coefficients using either tunable
dialog parameters or separate
input ports, which are useful for
time-varying coefficients.
8
This block implements
6. Discrete PID controller continuous- and discrete-time
PID control algorithms and
includes advanced features such
as anti-windup, external reset,
and signal tracking.
This block implements
7. Discrete PID Controller continuous- and discrete-time
(2DOF) PID control algorithms with
setpoint weighting and includes
advanced features such as anti-
windup, external reset, and signal
tracking.

8. Discrete State-space Discrete state-space model:


x(n+1) = Ax(n) + Bu(n)
y(n) = Cx(n) + Du(n)

9. Discrete-Time Integrator Discrete-time integration or


accumulation of the input signal.

Implement a z-transform transfer


10. Discrete Transfer Fcn function. Specify the numerator
and denominator coefficients in
descending powers of z.
Matrix expression for zeros.
11. Discrete Zero-Pole Vector expression for poles and
gain. Output width equals the
number of columns in zeros
matrix, or one if zeros is a vector.

Delay input signal by a specified


12. Enabled Delay number of samples.

The First-Order Hold block


13. First-Order Hold implements a first-order sample-
and-hold that operates at the
specified sampling interval.

9
Apply a one integration step
14. Memory delay. The output is the previous
input value.

Delay input signal by a specified


15. Resettable Delay number of samples.

Delay a signal N sample periods


16. Tapped Delay and output all the delay versions.

Discrete-time first order transfer


17. Transfer Fcn First Order function. The transfer function
has a unity DC gain.

Discrete-time lead or lag


18. Transfer Fcn Lead or Lag compensator. The compensator
has a unity instantaneous gain,
the DC gain equals (1-Zero)/(1-
Pole).
Discrete-time transfer function
19. Transfer Fcn Real Zero that has a real zero and
(effectively) has no pole.

Sample and hold with one sample


20. Unit Delay period delay.

Delay input signal by a specified


21. Variable Integer Delay number of samples.

The Zero-Order Hold block holds


22. Zero-Order Hold its input for the sample period you
specify.

Procedure 5
Sinks
Name of the Block Image of the Block Function of the Block
Numeric display of input values.
1. Display

10
Displays input signals with
2. Floating Scope respect to simulation time.

Provide an output port for a


3. Out1 subsystem or model. The 'Output
when disabled' and 'Initial output'
parameters only apply to
conditionally executed
subsystems.
The Simulink Scope block
4. Scope displays time domain signals with
respect to simulation time.
Stop simulation when input is
5. Stop Simulation non-zero.

Used to "terminate" output


6. Terminator signals. (Prevents warnings
about unconnected output ports.)
Incrementally write data into a
7. To File variable in the specified MAT-file.
The variable may be created as a
MATLAB timeseries, an array, or
a MATLAB structure.
Write input to specified
8. To Workspace timeseries, array, or structure in a
workspace. For menu-based
simulation, data is written in the
MATLAB base workspace.
Plots second input (Y) against
9. XY Graph first input (X) at each time step to
create an X-Y plot. Ignores data
outside the ranges specified by x-
min, x-max, y-min, y-max.

Procedure 6
Sources
Name of the Block Image of the Block Function of the Block
The Band-Limited White Noise
1. Band-Limited White Noise block generates normally
distributed random numbers that
are suitable for use in continuous
or hybrid systems.

11
2. Chirp Signal Output a linear chirp signal (sine
wave whose frequency varies
linearly with time).

3. Clock Output the current simulation


time.
Output the constant specified by
4. Constant the 'Constant value' parameter. If
'Constant value' is a vector and
'Interpret vector parameters as 1-
D' is on, treat the constant value
as a 1-D array. O
This block is a free-running
5. Counter Free-Running counter that overflows back to
zero after it has reached the
maximum value possible for the
specified number of bits. The
counter is always initialized to
zero.
This block is a counter that wraps
6. Counter Limited back to zero after it has output the
specified upper limit. The counter
is always initialized to zero.
Output current simulation time at
7. Digital Clock the specified rate.

Output the enumerated value


8. Enumerated Constant specified by the 'Value'
parameter.
9. From File Read data values from a variable
in the specified MAT-file.
The data values may be specified
in MATLAB timeseries or matrix
format.
Read data values from
10. From Spreadsheet spreadsheet.
The block interprets the first
column as time and the first row
and remaining columns as
signals.

12
Read data values specified in
11. From Workspace timeseries, matrix, or structure
format from the MATLAB
workspace, model workspace, or
mask workspace.
Used to "ground" input signals.
12. Ground (Prevents warnings about
unconnected input ports.)
Outputs zero.
Provide an input port for a
13. In1 subsystem or model.

Pulse type determines the


computational technique used.
14. Pulse Generator Time-based is recommended for
use with a variable step solver.
Output a ramp signal starting at
15. Ramp the specified time.

Output a normally (Gaussian)


16. Random Number distributed random signal. Output
is repeatable for a given seed.

Output a repeating sequence of


17. Repeating Sequence numbers specified in a table of
time-value pairs.

Discrete time sequence is output,


18. Repeating Sequence then repeated. Between data
Interpolated points, the specified lookup
method is used to determine the
output.

Discrete time sequence is output,


19. Repeating Sequence Stair then repeated.

Create and generate


20. Signal Builder interchangeable groups of

13
signals whose waveforms are
piecewise linear

Output various wave forms:


21. Signal Generator
Y(t) = Amp*Waveform(Freq, t)

Output a sine wave:


22. Sine Wave
O(t) = Amp*Sin(Freq*t+Phase) +
Bias

Sine type determines the


computational technique used.
The parameters in the two types
are related through: Samples per
period = 2*pi / (Frequency *
Sample time)

Number of offset samples =


Phase * Samples per period /
(2*pi)

Output a step.
23. Step

24. Uniform Random Number Output a uniformly distributed


random signal. Output is
repeatable for a given seed.

Output signal using waveform


25. Waveform Generator definition.

Syntax examples for sine wave:

sin(2, 3, 1) or

sin('Amplitude', 2, 'Frequency', 3,
'Phase', 1)

14
Supported waveforms include
step, pulse, square, Gaussian
noise, and more.

Procedure 7

The Step Response as discussed in the laboratory activity no. 6 has a staircase-like graphical
representation. Also, the plots from the previous activity also shows a parabolic graph. However, in this
activity, with the use of the simulink, we came up with a wave like graph as shown above.

Procedure 8

Procedure Assembled Blocks in Simulation Step Response


Window
8a
8b
8c
8d
8e

15
Procedure 9

Procedure Assembled Blocks in Simulation Window Ramp Response


9a

9b

9c

9d

16
9e

Procedure 10 Part a

Procedure Single Block in Simulation Window Step Response


10a

10b

17
10c

10d

10e

Procedure 10 Part b

Procedure Single Block in Simulation Window Ramp Response

18
10a

10b

10c

19
10d

10e

7. Conclusion:

I can therefore conclude that the graphical representation for dynamic systems differs with respect
to the response type used: Step; Ramp. Also, the difference in the plot can also be traced back to the
difference in transfer functions which is mainly attained depending on the conditions of the system. This
activity helps use to understand the different time responses of dynamic systems using matlab simulink.
Matlab is a commercial software that provides a computing environment that allows for sophisticated ways
of developing executing programs, and visualizing the output. You just have to learn the basic commands
and the fundamentals of Matlab.

20
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.
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.

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: CHE 530D1 Section: _______ ____Sem SY ________
Performance Unsatisfactory Developing Satisfactory Very Score
Indicators 1 2 3 Satisfactory
4
1. Apply Fails to identify Identifies Identifies Recognizes the
appropriate any modern modern modern benefits and
techniques, techniques to techniques but techniques and constraints of
21
skills, and perform fails to apply is able to apply modern
modern tools to discipline- these in these in engineering
perform a specific performing performing tools and shows
discipline- engineering discipline- discipline- intention to
specific task. specific specific apply them for
engineering engineering engineering engineering
task. task. task. practice.
2. Demonstrate Fails to apply Attempts to Shows ability to Shows ability to
skills in any modern apply modern apply apply the most
applying tools to solve tools but has fundamental appropriate and
different engineering difficulties to procedures in effective
techniques and problems. solve using modern modern tools to
modern tools to engineering tools when solve
solve problems. solving engineering
engineering engineering problems.
problems. problems.
3. Recognize the Does not Recognizes Recognizes the Recognizes the
benefits and recognize the some benefits benefits and need for
constraints of benefits and and constraints constraints of benefits and
modern constraints of of modern modern constraints of
engineering modern engineering engineering modern
tools. engineering tools. tools and shows engineering
tools. intention to apply tools and makes

Total Score
Mean Score = (Total Score / 3)
Percentage Rating = (Total Score / 12) x 100%
Evaluated by: ______________________________________ _______________
Printed Name and Signature of Faculty Member Date

22

S-ar putea să vă placă și