Professional Documents
Culture Documents
1
Introduction
2
Simulink
• Real-time Workshop
• An environment for building and simulating models.
– Continuous, discrete or hybrid systems
– Linear and nonlinear components
• Interconnection
• Sinewaves of Linear and • Displays
• Function Nonlinear blocks scopes
Generators • FFT scopes
• From MATLAB • To MATLAB
workspace workspace
• From Disk Files • To disk files
Simple Simulink Model
Scope
2
Gain1 1
0.9 Unit Delay
z
Simulink Block Libraries
• Simulink contains block libraries, which contain
components that can be used to build models.
• A block library can itself have other libraries as
blocks. Example: When you first start Simulink:
In1 Out1
Scope XY Graph
untitled.mat simout
To File To Workspace
Sinks is itself a
block library of STOP
Gain Sum
1 1
Sine Wave Sum s s+1
Integrator Transfer Fcn
Model Window
x' = Ax+Bu (s-1)
y = Cx+Du s(s+1)
State-Space Zero-Pole
1
Constant du/dt
Signal Step
Generator
Derivative Dot Product
12:34
model
window Random
Number
Uniform Random
Number
Band-Limited
White Noise
Sources Library
Connecting Blocks 1
1
Sine Wave Gain Sum
Sine Wave Gain 1
Sum
1
1
Sine Wave Gain Sum Scope
Sine Wave Gain Sum Scope
14
• To change the denominator to s2+2s+4,
• Enter the [1 2 4] into the denominator field:
15
• The "step" block can also be
double-clicked, bringing up
the following dialog box.
• The default parameters in
this dialog box generate a
step function occurring at
time =1 s, from an initial level
of zero to a level of 1.
16
• Double clicking on
scope block brings up a
blank oscilloscope
screen.
• When a simulation is
performed, the signal
which feeds into the
scope will be displayed
in this window.
17
• Take the following model to run a simulation
18
• The simulation should run very quickly and
the scope window will appear.
19
• The simulation
output (shown in
yellow) is at a very
low level relative to
the axes of the
scope.
• To fix this, hit the
auto scale button
(binoculars).
20
21
• We can change the
parameters of the
simulation also.
• In the model window,
select Parameters
from the Simulation
menu.
• You will see the
following dialog box.
22
• By just changing
the stop time 10s
to 2 s we get.
23
Reference
24
Thank you
25