matlab simulink introduction

32
1 Lecture Series – 7 Introduction to SIMULINK Shameer K oya

Upload: ameen-san

Post on 15-Jul-2015

668 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Matlab simulink introduction

11

Lecture Series – 7

Introduction to SIMULINK

Shameer Koya

Page 2: Matlab simulink introduction

Simulink

Used to model, analyze and simulate dynamic systems using block diagrams.

Simulink is a graphical, “drag and drop” environment for building simple and complex signal and system dynamic simulations – therefore is easy to use.

It allows users to concentrate on the structure of the problem, rather than having to worry about a programming language.

We simulate a model to study the behavior of a system –need to verify that our model is correct

2

Page 3: Matlab simulink introduction

Launch Simulink3

Page 4: Matlab simulink introduction

Create a new model

Click the new-model icon in the upper left corner to start a new Simulink file

Create new model under

file/new/model.

4

Page 5: Matlab simulink introduction

Your workspace5

Page 6: Matlab simulink introduction

6

Simulink- libraries

Sources: blocks that have only output, generators, constant,...

Sinks: blocks that have only input, scope, to worspace..

Continuous; integrator, transfer function..

Discrete: discrete transfer function, unite delay, memory..

Math operations: gain, product, sum, trigonometric functions..

User defined functions: S-function, S-function builder,..

SimPowersystem: Electrical blocks – electrical sources, machines, measurements, ….

Page 7: Matlab simulink introduction

7

Libraries ….

Page 8: Matlab simulink introduction

8

Creating a model

Model is created by choosing the blocks from different libraries, dragging them to model window and linking them.

The parameters of block (shown on picture, sine wave parameters), can be reached with double click on the block.

Page 9: Matlab simulink introduction

Select an input block

Drag a Sine Wave block from the Sources library to the model window

9

Page 10: Matlab simulink introduction

Select an operator block10

Page 11: Matlab simulink introduction

Select an output block

Drag a Scope block from the Sinks library to the model window

11

Page 12: Matlab simulink introduction

Connect blocks with signals

Place your cursor on the output port (>) of the Sine Wave block

Drag from the Sine Waveoutput to the Integratorinput

Drag from the Integratoroutput to the Scopeinput

Arrows indicate the direction of the signal flow

12

Page 13: Matlab simulink introduction

Set block parameters

The parameters of block (shown on picture, sine waveand integrator parameters), can be reached with double click on the block

13

Page 14: Matlab simulink introduction

Configuration parameters

Numerical solver method, start time, stop time (it can be also set directly)...

14

Page 15: Matlab simulink introduction

Run the simulation

In the model window, from the Simulation pull-down menu, select Start

15

Page 16: Matlab simulink introduction

Simulation results

Double-click on the Scope to view the simulation results

16

Page 17: Matlab simulink introduction

17

Summary

Type the following at the Matlabcommand prompt

>> simulink

The Simulink library should appear

Click File-New to create a new workspace, and drag and drop objects from the library onto the workspace.

Selecting Simulation-Start from the pull down menu will run the dynamic simulation. Click on the blocks to view the data or alter the run-time parameters

Page 18: Matlab simulink introduction

18

Page 19: Matlab simulink introduction

19

Page 20: Matlab simulink introduction

20

Page 21: Matlab simulink introduction

21

Page 22: Matlab simulink introduction

22

Page 23: Matlab simulink introduction

23

Page 24: Matlab simulink introduction

24

Page 25: Matlab simulink introduction

25

Page 26: Matlab simulink introduction

26

Page 27: Matlab simulink introduction

27

Page 28: Matlab simulink introduction

28

Page 29: Matlab simulink introduction

29

Page 30: Matlab simulink introduction

30

Page 31: Matlab simulink introduction

31

Page 32: Matlab simulink introduction

32

Thanks

Questions ??