You are on page 1of 37

Introductionto

toMATLAB
MATLAB
Introduction
MATLAB SIMULINK
Prepared by Mohammed Salah
Supervised by

DR . Samir Badwy
10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

Introduction
Agend
a

MATLAB Simulink

Some Examples

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

Introduction

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

What is MATLAB?

The name MATLAB stands for MATrix LABoratory.

MATLAB is a "High-Performance Numeric


Computation and Visualization Software"
package.

MATLAB is basically a high level language


which has many specialized toolboxes for
making things easier for us.

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

MATLAB Toolboxes
MATLAB has a number of add-on software modules, called
toolboxes, that perform more specialized computations.

Toolboxes are comprehensive collections of MATLAB


functions (M-files) that extend the MATLAB environment to
solve particular classes of problems.
there exist large set of toolboxes, or collections of
functions
and procedures, available as part of the MATLAB
:package. The toolboxes are
Control system.
System identification.

10/30/16

Communications.

Robust control.(MIMO)

Signal processing.

Image processingetc.

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

Frequency
Domain
Identificatio
n Toolbox

Control
Systems
Toolbox

Fuzzy
Logic
Toolbox

10/30/16

System
Identificatio
n Toolbox

Model
Predictive
Control
Toolbox

Signal
Processing
Toolbox,

MATLAB Toolboxes

MATLAB SIMULINK

Image
Processin
g Toolbox

FACULTU OF ELECTORNIC ENGINEERING

Typicaluses
usesinclude
include
Typical
Math and computation.
Algorithm development.
Data acquisition.
Modeling, simulation, and
prototyping.
Data analysis, exploration,
and visualization.
Scientific and engineering
graphics.
Application development,
including graphical user
interface building.

10/30/16

MATLAB SIMULINK

Aerospace and Defense.


Automotive.
Biotech, Medical, and
Pharmaceutical.
Chemical and Petroleum.
Communications.
Computers and Office
Equipment.
Education.
Electronics and
Semiconductor.
Financial Services.
Industrial Equipment
and Machinery.
Instrumentation.
Utilities and Energy.
FACULTU OF ELECTORNIC ENGINEERING

10/30/16

Current Directory

View folders
and m-files

SIMULINK

M-file or
MATLAB
script

demo

10/30/16

Command Window

type commands

Workspace

View program
variables

Double click on a
variable to see it in
the Array Editor

Help
MATLAB
DEMOS

Command History

view past commands

save a whole session


using diary

MATLAB Demos

10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
10

Some facts for a first impression


Everything in MATLAB is a matrix !
MATLAB is an interpreted language, no
compilation needed (but possible).
MATLAB does not need any variable
declarations, no dimension statements, has no
packaging, no storage allocation, no pointers.
Programs can be run step by step, with full
access to all variables, functions etc.
10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
11

SCREENS
FOR
EXECUTE
COMMANDS

Program
In
written
form

Comma
nd
window
10/30/16

Graphic

M-file
or
MATLA
B script
MATLAB SIMULINK

SIMULIN
K

FACULTU OF ELECTORNIC ENGINEERING

12

MATLABSimulink
Simulink
MATLAB

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

13

MATLAB
Simulink
Simulink
software models, simulates, and

analyzes dynamic systems. It enables you to pose a


question about a system, model the system, and
see what happens.
Simulink : Allows you to model dynamic systems
graphically.
Provides a graphical user interface for constructing block diagram of
a system therefore is easy to use.

10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
14

Modeling Process
There are six steps to modeling any
system:
1.Defining the System.
2.Identifying System Components.
3.Modeling the System with
Equations.
4.Building the Simulink Block
Diagram.
5.Running the Simulation.
6.Validating the Simulation Results.

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

15

SIMULINK

SIMULINK

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

16

mode
l

Creating a New Model


From the Simulink Library Browser menu,
select File > New > Model.

Select File > Save > .


The Save As dialog box opens.
In the File name box, enter a name for your model, and then
click Save.
saves
yourFACULTU
model
with theENGINEERING
file extension .mdl.
10/30/16 The software
MATLAB
SIMULINK
OF ELECTORNIC
17

Simulink Library Browser menu

10/30/16

MATLAB SIMULINK
ENGINEERING

New Model

FACULTU OF ELECTORNIC
18

Some
Examples

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

19

DC Motor Principle
A machine that converts dc power into mechanical
energy is known as dc motor.
Its operation is based on the principle that when a
current carrying conductor is placed in a magnetic
field, the conductor experiences a mechanical force.
The direction of the force is given by Flemings left
hand rule.

10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
20

Torque production in a DC motor

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

21

Induced voltage in the armature


winding of DC motor

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

22

10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
23

DC Motor Applications
TECO-Westinghouse Motor Company
DC
motors are ideally suited to a multitude of
industrial and marine applications in which high
torque and variable speed are required.
These applications include ship propulsion, mine
hoists and steel rolling mills.

we will discussed the model of

SEPARATED EXCITED DC MOTOR

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

24

Example.1

DC MOTOR MODEL AND CONTROLLER DESIGN

Unit step

PI
CONTROLLE
R

5
Gain

10/30/16

MATLAB SIMULINK

1.9

output

0.0143S+1
TF OF DC motor

FACULTU OF ELECTORNIC ENGINEERING

25

Steps for simulation


Click to open Simulink

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

26

File. New.. model

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

27

File save

28

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

29

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

30

10/30/16

MATLAB SIMULINK
ENGINEERING

FACULTU OF ELECTORNIC
32

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

33

connection press on the component to change


the value RUN press on scope to show the
response

10/30/16

MATLAB SIMULINK

FACULTU OF ELECTORNIC ENGINEERING

34

EXERCISE

Example.2

Show the response of the system with :


Show the response of the system with :
P
controller.
PI controller.

Unit step

10/30/16

CONTROLLE
R

MATLAB SIMULINK

PD
controller.
PID controller.
1

output

S^2+7S+5

FACULTU OF ELECTORNIC ENGINEERING

35

GENERAL
REFERENCE
SIMULINK Dynamic System Simulation for
MATLAB.
Introduction to Simulink with
Engineering Applications.

10/30/16

MATLAB SIMULINK
FACULTU OF
ELECTORNIC ENGINEERING

36

You might also like