Matlab - Simulink - Tutorial - PPT Filename - UTF-8''Matlab Simulink Tutorial
Matlab - Simulink - Tutorial - PPT Filename - UTF-8''Matlab Simulink Tutorial
Simulink
Eng. Ahmed Mustafa
Lecture Overview
What is Simulink?
How to use Simulink
Getting Start with Simulink
Building a model
Example 1 (Differential Equations )
Example 2 (Transfer Function)
Creating Subsystems
Useful Information
What is Simulink? (1)
A software package for modeling,
simulating, and analyzing dynamic systems.
Supports linear and nonlinear systems,
modeled in continuous time, sample time, or
a hybrid of the two.
Systems can also be multirate (i.e. different
parts that are sampled or updated at
different rates)
What is Simulink? (2)
For modeling, it provides a graphical user
interface (GUI) for building models as block
diagrams (using click-and-drag mouse
operations)
Can build models in hierarchical fashion
(using both top-down and bottom-up
approaches)
You can simulate, analyze the output results,
explore, revise your models and have FUN!
Lecture Overview
What is Simulink?
How to use Simulink
Getting Start with Simulink
Building a model
Example 1 (Differential Equations )
Example 2 (Transfer Function)
Creating Subsystems
Useful Information
Start a Simulink Session
Click on the SIMULINK icon on toolbar
Type simulink
on Matlab command window
Simulink Library Browser
CREAT NEW MODEL icon SEARCH window
BLOCK set
for model construction
LIBRARY
Create a New Model
CREAT NEW MODEL icon
u x y
(Input) (states) (Output)
Building a Model (2)
This is the
Sine Wave block is
from the Sources library
The Gain
block is
from the
Math library
These are
The Mux block is from from the
the Signals &Systems library Sinks library
Building a Model (5)
Step 2: Making connections
To make connection: left-click while holding down control key (on keyboard)
and drag from source port to a destination port
A connected Model
Building a Model (6)
Step 3: Set Parameters
Double click the Gain block to set the parameter for the Gain block
Gain value = 5
Building a Model (7)
Step 4: Running Simulation
Click here to run the simulation
&
x& x& x
Example 1:Differential Equations (3)
Set Step
Note:
x& x
time =0
Assume all initial conditions = 0
Example 1:Differential Equations (4)
X (s) 1
2
F ( s) 2s 2s 2
Example 2: Transfer Function (2)
STEP 1: Creating Blocks
x
Example 2: Transfer Function (4)
STEP 3: Set Parameters
x
Example 2: Transfer Function (5)
STEP 4: Running Simulation
Inport Outport
(named from sum (three outports)
Creating Subsystems (4)
Set Slope
0 5 t(s)
Start at 0 s
Start at 5.01 s
Useful Information (3)
To run programs, have to be in the current
active directory or in a directory in the path
(goto File Set path... )
To copy the SIMULINK Model from
Simulink Workspace and add to report
(Edit Copy model to clipboard)
Need help on SIMULINK (At Simulink
Library Browser Click Help)