Top Banner
Presentation on SIMULINK By: Kamran Gillani
30

Simulink - Introduction with Practical Example

Apr 12, 2017

Download

Technology

Kamran Gillani
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Simulink - Introduction with Practical Example

Presentationon

SIMULINK

By: Kamran Gillani

Page 2: Simulink - Introduction with Practical Example

Contents:• Introduction• Model Overview• Define Parameters• Simulink Block Connections• Observe Simulation Results• Practical Example

Page 3: Simulink - Introduction with Practical Example

INTRODUCTIONSimulink® is a block diagram environment for multidomain simulation and Model-Based Design. It supports simulation, automatic code generation, and continuous test and verification of embedded systems.

Page 4: Simulink - Introduction with Practical Example

Model Overview

Page 5: Simulink - Introduction with Practical Example

Model Overview We can use Simulink® to model a system and then simulate the dynamic behavior of that system.

To create this simple model, we need four Simulink blocks:

1. Sine Wave — Generates an input signal for the model.

2. Integrator — Processes the input signal.3. Bus Creator — Combines the input signal

and processed signal into one signal.4. Scope — Visualizes the signals.

Page 6: Simulink - Introduction with Practical Example

Simulating this model integrates a sine wave signal to a cosine signal and then displays the result, along with the original signal, in a scope window.

Page 7: Simulink - Introduction with Practical Example

Simulink Library BrowserFrom the Simulink Library Browser, we can create a new model (block diagram) and search for blocks that we want to use in our model.

Page 8: Simulink - Introduction with Practical Example

Open Simulink BrowserWe need MATLAB® running before we can open the Simulink Library Browser.

1- From the MATLAB Tool strip, click the Simulink Library button , or in the Command Window, enter “simulink”.

Page 9: Simulink - Introduction with Practical Example

Set the Library Browser to stay on top of the other desktop windows. On the Library Browser toolbar, select the Stay on top button  .

Page 10: Simulink - Introduction with Practical Example

Browse Specific Blocks

1- From the Simulink Library Browser toolbar, click the New Model button  . A Simulink Editor window opens with an new block diagram

Page 11: Simulink - Introduction with Practical Example

Add Blocks to a ModelTo build a model, begin by copying blocks from the Simulink Library Browser to the Simulink Editor.

1- In the Simulink Library Browser, select the Sources library. The Library Browser displays the source blocks in the library.

Page 12: Simulink - Introduction with Practical Example

2- Select the Sine Wave block.

Page 13: Simulink - Introduction with Practical Example

3- Drag the Sine Wave block to the Simulink Editor. A copy of the Sine Wave block appears in model.

Page 14: Simulink - Introduction with Practical Example

5- Model now has the blocks we need for the simple model.

Page 15: Simulink - Introduction with Practical Example

Move and Resize Blocks

• Click and drag a block.

• Arrow keys of Keyboard.

Page 16: Simulink - Introduction with Practical Example

Practical Example

Page 17: Simulink - Introduction with Practical Example

Starting The Program1- Start MATLAB.

2- Simulink is an extra toolbox that runs on top of MATLAB. To start this, type “simulink” in the Command Window or click on the Simulink icon.

Page 18: Simulink - Introduction with Practical Example
Page 19: Simulink - Introduction with Practical Example

3. The Simulink interface should now appear as shown below in Figure

Page 20: Simulink - Introduction with Practical Example

Example: Simple Model

Build a Simulink model that solves the differential equation

X=4sin(2t)

Initial conditionX(0)=-1

We draw the diagram with help of Simulink library

Page 21: Simulink - Introduction with Practical Example

• Goes to Simulink library, select sources and then select sine wave.

Page 22: Simulink - Introduction with Practical Example

• Goes to Simulink library, select continuous and then select Integrator.

Page 23: Simulink - Introduction with Practical Example

• Goes to Simulink library, select sinks and then select Scope.

Page 24: Simulink - Introduction with Practical Example
Page 25: Simulink - Introduction with Practical Example

• Double-click on the Sine Wave block to set amplitude = 4

freq = 2.

• This produces the desired input of 4sin(2t)

Page 26: Simulink - Introduction with Practical Example

• Double-click on the Integrator block to set

initial condition = -1.

• This sets our IC x(0) = -1.

Page 27: Simulink - Introduction with Practical Example

Double-click on the Scope to view the simulation results.

Page 28: Simulink - Introduction with Practical Example
Page 29: Simulink - Introduction with Practical Example

Show Result of the Model ON Oscilloscope

Page 30: Simulink - Introduction with Practical Example