Object-12: Introduction To Simulink
Object-12: Introduction To Simulink
Object-12: Introduction To Simulink
INTRODUCTION TO SIMULINK
Simulink is a graphical representation of systems, differential equations, or problems encountered in
engineering fields. Blocks can be assembled to reproduce almost anything as long as it can be modeled
mathematically. Simulink has become an important part of aeronautical, astronautically, computer,
electrical, and mechanical engineering programs and industries.
Simulation is the process of designing a model of a real system and conducting experiments with this
model for the purpose of either understanding the behavior of the system and/or evaluating various
strategies for the operation of the system. Simulation is one of the most widely used techniques in
operations research and management science.
Simulink can be used to control systems with the correct hardware and software. Texas Instruments and
other electronic equipment manufacturers creates circuit boards for integration with a PC running
Simulink. Output can be directly saved to a computer and analyzed to improve the model or write the
report, more efficiently than in the past.
SIMULINK is a part of MATLAB that can be used to simulate dynamic systems. To facilitate model
definition, SIMULINK adds a new class of windows called block diagram windows. In these windows,
models are created and edited primarily by mouse-driven commands. Part of mastering SIMULINK is
to become familiar with manipulating model components within these windows.
PIYUSH
11ESLEE018
Use the model to predict future behavior, that is, the effects that will be produced by changes in
the system
ADVANTAGES OF SIMULINK
Can be used to study existing systems without disrupting the ongoing operations.
Proposed systems can be tested before committing resources.
Allows us to control time.
Allows us to gain insight into which variables are most important to system performance.
DISADVANTAGES OF SIMULINK
PIYUSH
11ESLEE018
Model building is an art as well as a science. The quality of the analysis depends on the
quality of the model and the skill of the modeler.
Simulation results are sometimes hard to interpret.
Simulation analysis can be time consuming and expensive should not be used when an
analytical method would provide for quicker results.
STARTING SIMULINK
Simulink is started from the MATLAB command prompt by entering the following
command:
>> simulink
Alternatively, you can click on the "Simulink Library Browser" button at the top of the
MATLAB
command window as shown below:
PIYUSH
11ESLEE018
PIYUSH
11ESLEE018
The Simulink Library Browser window should now appear on the screen. Most of the blocks needed for
modeling basic systems can be found in the subfolders of the main "Simulink" folder (opened by
clicking on the "+" in front of "Simulink"). Once the "Simulink" folder has been opened, the Library
Browser window should look like:-
SIMULINK TOOLBOXES
Department of Electrical Engineering
PIYUSH
11ESLEE018
These are some of the toolboxes simulink has. We will use only the first toolbox Simulink and
Simulink Extras further down.
Most commonly used blocks in Electrical engineering and Mechanical engg. are shown below
PIYUSH
11ESLEE018
Basic Elements
There are two major classes of elements in Simulink: blocks and lines. Blocks are used to generate,
modify, combine, output, and display signals. Lines are used to transfer signals from one block to
another.
Blocks
The subfolders underneath the "Simulink" folder indicate the general classes of blocks available for us to
use:
Continuous: Linear, continuous-time system elements (integrators, transfer functions, statespace models, etc.)
Functions & Tables: User-defined functions and tables for interpolating function values
Signals & Systems: Blocks for controlling/monitoring signal(s) and for creating subsystems
Blocks have zero to several input terminals and zero to several output terminals. Unused input terminals
are indicated by a small open triangle. Unused output terminals are indicated by a small triangular point.
The block shown below has an unused input terminal on the left and an unused output terminal on the
right.
PIYUSH
11ESLEE018
Lines
Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals from
the output terminal of one block to the input terminal of another block. One exception to this is that a
line can tap off of another line. This sends the original signal to each of two (or more) destination
blocks, as shown below:
Lines can never inject a signal into another line; lines must be combined through the use of a block such
as a summing junction.
A signal can be either a scalar signal or a vector signal. For Single-Input, Single-Output systems, scalar
signals are generally used. For Multi-Input, Multi-Output systems, vector signals are often used,
consisting of two or more scalar signals. The lines used to transmit scalar and vector signals are
identical. The type of signal carried by a line is determined by the blocks on either end of the line.
PIYUSH
11ESLEE018
BUILDING A SYSTEM
To demonstrate how a system is represented using Simulink, we will build the block diagram for a
simple model consisting of a sinusoidal input multiplied by a constant gain, which is shown below:
PIYUSH
11ESLEE018
This model will consist of three blocks: Sine Wave, Gain, and Scope. The Sine Wave is a Source
Block from which a sinusoidal input signal originates. This signal is transferred through a line in the
direction indicated by the arrow to the Gain Math Block. The Gain block modifies its input signal
(multiplies it by a constant value) and outputs a new signal through a line to the Scope block. The
Scope is a Sink Block used to display a signal (much like an oscilloscope).
We begin building our system by bringing up a new model window in which to create the block
diagram. This is done by clicking on the "New Model" button in the toolbar of the Simulink Library
Browser (looks like a blank page).
Building the system model is then accomplished through a series of steps:
The necessary blocks are gathered from the Library Browser and placed in the model window.
The parameters of the blocks are then modified to correspond with the system we are modeling.
Finally, the blocks are connected with lines to complete the model.
RUNNING SIMULATIONS
Now that our model has been constructed, we are ready to simulate the system. To do this, go to
the Simulation menu and click on Start, or just click on the "Start/Pause Simulation" button in the
model window toolbar (looks like the "Play" button on a VCR). Because our example is a relatively
simple model, its simulation runs almost instantaneously. With more complicated systems, however,
you will be able to see the progress of the simulation by observing its running time in the the lower box
of the model window. Double-click the Scope block to view the output of the Gain block for the
simulation as a function of time. Once the Scope window appears, click the "Autoscale" button in its
PIYUSH
11ESLEE018
toolbar (looks like a pair of binoculars) to scale the graph to better fit the window. Having done this,
you should see the following:
PIYUSH
11ESLEE018
PIYUSH
11ESLEE018