Title: SIMULINK
1SIMULINK
2SIMULINK
- SIMULINK is a power simulation program that comes
with MATLAB - Used to simulate wide range of dynamical systems
- To run SIMULINK
- Run MATLAB
- Click on the SIMULINK icon on tool bar
- SIMULINK automatically open a work file and the
main libraries.
3To be able to use SIMULINK
- You need to learn to do the following
- manipulate blocks
- use blocks to build models
- run simulation
- modify simulation parameters
4SIMULINK BASICS
- A systems is represented by a block diagram
- You select the block from a library of blocks
- You need to know the library that contains the
block that you need - click on the library name and you will see a list
of blocks in that library - click on the block that you want and drag it to
the work file - click on the block to select its parameters
- Connect it to other blocks
5SIMULINK LIBRARIES
- Sources
- Sinks
- Continuous
- Discrete
- Function Tables
- Math
- Nonlinear
- Signals Systems
- Subsystems
6General Procedure
- Open the library that contains the block of
interest - Click on the block that you need and drag it to
the work area - Click the left mouse button to see and modify the
block parameters. - You can do the above by clicking the right button
and select the block parameters. - Connect the input and outputs of the block
7SIMULINK LIBRARIES
- Sources Used to generate input signals
- Sinks Used to display results/signals
- Continuous To represent continuous systems
- Discrete To represent discrete systems
- Math Some mathematical functions
8Sourceto generate input signals
- Step to generate step input
- Ramp to generate ramp input
- sine Wave to generate sine wave
input - Clock
- Constant
- Pulse generator
- Signal Generator
9Constant (SOURCE LIBRARY)
- The output of the constant block is a constant
number
Select the source library click on the constant
block drag the block to the work file click on
the block update the parameters of the
block (change the constant) Connect the block to
other blocks
Constant
10Step (SOURCE LIBRARY)
- The output of the step block is step function.
User can select step time, initial value (value
before step time) and final value (the value
after)
Select the source library click on the step
block drag the block to the work file click on
the block update the parameters of the
block (change the step time, Initial value and
final value ) Connect the block to other blocks
step
11Linear
- SUM
- GAIN
- Derivative
- Integrator
- State Space
- Transfer function
12Gain (Linear library)
select linear library drag the GAIN to the work
file click on GAIN to select the gain. You can
rotate gain block connect it to other blocks
K
gain
13Integrator (Linear library)
select linear library drag the INTEGRATOR to the
work file You can adjust initial conditions if
needed. connect it to other blocks
integrator
14Sink
- Display displays the numerical value of the
signal - Scope plot the signal
- To File save in a file
- To Workspace store the signal in a MATLAB
- variable in the MATLAB
- workspace
15Sink
- To Workspace store the signal in a MATLAB
- variable in the MATLAB
- workspace.
- workspace.
-
- This is very useful when you want to do further
processing to the result of the simulation. - ---click on the box to select the variable
name---
16Block diagrams for SIMULINK Simulation
- simulate the following system
17Example
- -
sin
integrator
sum
integrator
2
gain
adjust gain , sum and sine blocks
18- Do the three exercises in the handout