Professional Documents
Culture Documents
CPE642/Simulation Lab/Sept2014
What is SIMULINK?
SIMULINK is an extension to MATLAB that allows engineers to rapidly and accurately build
computer models of dynamical systems using block diagram notations. SIMULINK model can
occupy for both continuous and discrete-time system.
The MATLAB and Simulink environments are integrated into one entity, and thus we can analyze,
simulate, and revise our models in either environment at any point. We invoke Simulink from
within MATLAB
1.0
Click the
Simulink
icon to start
simulink
Alternatively
type simulink
and enter to start
simulink
NHA0914/Simulink/Notes
CPE642/Simulation Lab/Sept2014
New
Window icon
Simulink library
icon
The Simulink library browser, shown in Figure 1.2, will open. Click the new window
icon, opening an empty model window, named untitled, in which you will build the
Simulink model.
Click the simulink parameters, to change the simulation time. Simulink give default
time start from 0.0 to 10.0. This is in seconds.
NHA0914/Simulink/Notes
CPE642/Simulation Lab/Sept2014
2.0
To save the model, just click Save or Save as and save the model using appropriate
name and make sure the save as type Simulink model, which has an extension of .mdl
The unsaved model has an * symbol at the end of the name, as indicated in figure 2.1,
and the * symbol will disappeared if the model has been saved.
3
NHA0914/Simulink/Notes
CPE642/Simulation Lab/Sept2014
To open a model, use File: Open. Prior to open, note that the default directory in the
MATLAB is work directory (Figure 2.2), and change the directory according the
previous directory that has been used. Then only you can open the model either from
MATLAB browser or Simulink browser.
NHA0914/Simulink/Notes
3.0
CPE642/Simulation Lab/Sept2014
Building a model
A Simulink model consists of three types of element: sources, thesystem being modeled
and sinks. Figure 3.1 shows the relationship among the three elements. The central
element, i.e. the system, is the Simulink representation of a block diagram of the
dynamical system being modeled. The sources are the inputs to the dynamical system, and
the sinks acts as the output of the system.
Inputs/
Sources
Process/System
Outputs/Sinks
To build a model, drag the icon required from the library to the model window.
To connect the blocks, place a cursor on the output port, symbolized as > on the right
edge of the block, and drag to the input port (< on the left edge of block).
The signal line has an arrowhead indicating the direction of signal flow and the blocks
are connected to each other.
Red dotted
line - not
connected
NHA0914/Simulink/Notes
CPE642/Simulation Lab/Sept2014
Exercise
Additional info: Sinks input, Sources Output, Continuous processes, Math Operation
mathematical tools. Alternative for looking the block is by typing the required block in here and
click Find. Browse through the libraries to know more about the contents.
To see the output, double click the Scope block, and then clicking on the Autoscale icon.
NHA0914/Simulink/Notes
CPE642/Simulation Lab/Sept2014