You are on page 1of 7

MCT-311L Modeling and Simulation LAB MANUAL

Lab # 01:

Introduction to Simulink Toolbar


Objective:
To get familiarized with different blocks of Simulink toolbar.
Introduction:
Simulink is a graphical extension to MATLAB for the modeling and simulation of systems. In
Simulink, systems are drawn on screen as block diagrams. Many elements of block diagrams are
available, as well as virtual input devices and output devices Simulink is integrated with
MATLAB and data can be easily transferred between the programs. In this tutorial, we will
introduce the basics of using Simulink to model and simulate a systeam.
Create Simple Model:
Use the Simulink Editor to build your models.
 Start MATLAB. From the MATLAB toolstrip, click the Simulink button .

Figure No.1
 After a short delay Simulink is opened.

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |1
MCT-311L Modeling and Simulation LAB MANUAL

Figure No.2
 Click the Blank Model template, and then click the Create Model button.
The Simulink Editor opens with a new block diagram.

Figure No.3

 From the Simulink Editor toolbar, click the Simulink Library button  .

Figure No.4
 Build models by dragging blocks from the Simulink Library Browser window to the Simulink
Editor or single-clicking your model and entering a search term.

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |2
MCT-311L Modeling and Simulation LAB MANUAL

Figure No.5
Modeling and Simulation:
With Simulink, you can interactively simulate your system and view the results on scopes and
graphical displays. For simulation of continuous, discrete, and mixed-signal systems, you can
choose from a range of fixed-step and variable-step solvers.
Blocks are the main elements you use to build models in Simulink. Use the Library Browser to
browse and search the block libraries. When you find the block you want to use, add it to your
model.
Some of the blocks are
 Continuous
 Discrete
 Logical and Bit operations
 Math operations
 Sinks
 Sources
But we deal with the following blocks

Sinks
Display Show value of input
Scope Display signals generated during simulation

Sources
Step Generate step function

Ramp Generate constantly increasing or decreasing signal

Sine Wave Generate sine wave, using simulation time as time


source

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |3
MCT-311L Modeling and Simulation LAB MANUAL

Pulse Generate square wave pulses at regular intervals


Generator
Signal Generator can produce sine wave, square wave,
Generator saw tooth wave, and random wave.

 Click on library browser


 Select sources from Simulink Library Browser
 Click right on Sine Wave
 Press the option : Add block to model untitled or press Crtl+l
 Using same process we can add Scope and Display from the Sinks menu

Figure No.6
 Then we connect the components with each other
 In the figure below 1 shows the frequency of the wave
 2 block use to play stop forward to backward option
 Double click the source the graph will be opened
 Display shows the last value where the graph stop or the instantaneous value
 By double click the sine wave we enter into sine wave settings from where we can change
the value of Amplitude, frequency, bias, phase and sample time.

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |4
MCT-311L Modeling and Simulation LAB MANUAL

Figure No.7
 Using the procedure make a step signal of time period 20

Figure No.8
 Using the procedure make a ramp signal of time period 20

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |5
MCT-311L Modeling and Simulation LAB MANUAL

Figure No.9
 Using the procedure make a pulse signal of time period 20

Figure No.10
 By double clicking on scope setting, graph will open by pressing at 2, Configuration Properties
of Scope will open
 We can change the layout from there

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |6
MCT-311L Modeling and Simulation LAB MANUAL

Figure No.12
Task:
 Signal generator have four different wave forms like sine square saw tooth and random
 These settings open by double clicking the signal generator icon

Figure No.11

Conclusion:
 After performing the lab am able to make different signals with required Amplitude, frequency,
bias, phase and sample time. example Sine wave, Ramp, Slope, Pulse.

INSTRUCTOR: SAQIB ZAFAR


LECTURER
MECHATRONICS & CONTROL ENGG. DEPT.

Page |7

You might also like