Lab Report 08 - MEEN201101106
Lab Report 08 - MEEN201101106
Amnah Kamran
Lab 08 Introduction to SIMULINK
Lab Session 08
Objective:
Introduction to SIMULINK, its interface and some of its basic applications
Section-I Theory
Theory:
SIMULINK
SIMULINK is a powerful simulation and modeling tool provided by MATLAB that allows
engineers and scientists to model, simulate, and analyze dynamic systems. It provides a graphical
user interface (GUI) for building block diagrams and simulating the behavior of systems
represented by mathematical equations.
Simulink and its Relation to MATLAB
Simulink is a MATLAB-based graphical programming environment for modeling, simulating
and analyzing multidomain dynamical systems. Its primary interface is a graphical block
diagramming tool and a customizable set of block libraries.
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. Block Diagram Modeling:
SIMULINK uses a block diagram approach to model systems. Each block
represents a specific component or mathematical operation, and the connections
between blocks represent the flow of signals.
Blocks can represent continuous-time or discrete-time systems, linear or nonlinear
elements, mathematical operations, sensors, actuators, controllers, and more.
By connecting blocks together, complex systems can be represented and
simulated in SIMULINK.
Page | 1
Lab 08 Introduction to SIMULINK
Page | 2
Lab 08 Introduction to SIMULINK
Starting Simulink
Simulink is started from the MATLAB command prompt by entering the following command:
simulink
Alternatively, you can hit the Simulink button at the top of the MATLAB window as shown
here:
Page | 3
Lab 08 Introduction to SIMULINK
Once you click on Blank Model, a new window will appear as shown below.
Page | 4
Lab 08 Introduction to SIMULINK
Page | 5
Lab 08 Introduction to SIMULINK
Figure 5 Block
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. On exception to this
is a line can tap off of another line, splitting the signal to each of two destination blocks, as
shown below
Figure 6 Split.xls
Page | 6
Lab 08 Introduction to SIMULINK
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 (SISO)
systems, scalar signals are generally used. For Multi-Input, Multi-Output (MIMO) 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.
Basic Applications:
SIMULINK can be used for various applications, including system modeling and simulation,
control system design and analysis, signal processing, communication systems, image
processing, and more. It is commonly used in industries such as automotive, aerospace, robotics,
power systems, and process control for system-level design, testing, and verification.
SIMULINK allows for rapid prototyping, exploring different system configurations, evaluating
system performance under different conditions, and optimizing system designs.
Overall, SIMULINK is a versatile and powerful tool for system modeling, simulation, and
analysis. It provides a user-friendly interface, a wide range of block libraries, and extensive
analysis capabilities, making it a valuable tool for engineers and scientists working with dynamic
systems.
Modeling the Differential with Simulink:
To run Simulink we must first invoke MATLAB. Make sure that Simulink is installed in your
system. In the Command Window, we type: simulink alternately, we can click on the Simulink
icon shown. It appears on the top bar on MATLAB’s Command Window.
Page | 7
Lab 08 Introduction to SIMULINK
Page | 8
Lab 08 Introduction to SIMULINK
Figure 10 Untitled
This is the model window where we enter our blocks to form a block diagram. We save this as
model file name Equation_1_26. This is done from the File drop menu where we choose Save as
and name the file as Equation_1_26. Simulink will add the extension .mdl. The new model
window will now be shown as Equation_1_26, and all saved files will have this appearance.
Page | 9
Lab 08 Introduction to SIMULINK
straight line to connect the two blocks. We double−click on the gain block and on the
Function Block Parameters, we change the gain from 1 to 3.
6. From the Commonly Used Blocks of the Simulink Library Browser, we choose the
Integrator block, we drag it into the Equation_1_26 model window, and we connect it to
the output of the Add block. We repeat this step and to add a second Integrator block. We
click on the text “Integrator” under the first integrator block, and we change it to
Integrator 1. Then, we change the text “Integrator 1” under the second Integrator to
“Integrator 2” as shown.
8. The initial conditionsi L ¿ , and v c ¿ ¿ are entered by double clicking the Integrator blocks
and entering the values 0 for the first integrator, and 0.5 for the second integrator. We
also need to specify the simulation time. This is done by specifying the simulation time to
be seconds on the Configuration Parameters from the Simulation drop menu. We can start
the simulation on Start from the Simulation drop menu or by clicking on the icon.
Page | 11
Lab 08 Introduction to SIMULINK
9. To see the output waveform, we double click on the Scope block, and then clicking on
the Autoscale icon, we obtain the waveform shown
Page | 12
Lab 08 Introduction to SIMULINK
Section-II Tasks
SIMULINK:
Page | 13