INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.

Slides:



Advertisements
Similar presentations
1 Application Software Course Simulink By: Mahdi Akbari 2010.
Advertisements

1 1 Mechanical Design and Production Dept, Faculty of Engineering, Zagazig University, Egypt. Mechanical Design and Production Dept, Faculty of Engineering,
ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Simulink Overview: open simulink to open simulink Library Browser.
Getting started with Simulink An introductory tutorial ES205 Analysis and Design of Engineering Systems Rose-Hulman Institute of Technology © R. Layton.
© 2011 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Simulink Basics.
Microsoft Word Basics. Introduction to Microsoft Word Microsoft Word is a word processor designed by Microsoft. A word processor is a computer application.
System Dynamics, Third Edition
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
1 A Tool for System Simulation: SIMULINK Can be used for simulation of various systems: – Linear, nonlinear; Input signals can be arbitrarily generated:
SIMULINK Dr. Samir Al-Amer. SIMULINK SIMULINK is a power simulation program that comes with MATLAB Used to simulate wide range of dynamical systems To.
HossamTalaat - MATLAB Course - KSU - 21/1/24 1 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink By Prof. Hossam Talaat.
Simulink ® From Simulink® 7 Getting Started Guide.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Learning. Microwave office Creators: Iman Radmanesh Amin Fehresti-sani.
Digital Image Processing Lecture3: Introduction to MATLAB.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
Word Processing ADE100- Computer Literacy Lecture 12.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
Introduction to Simulink Dr. Mohammed F. Alsayed.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
MagicInfo Pro Scheduler Now that a template has been created from content imported into the Library, the user is ready to begin scheduling content to.
Simulink ® Interface Course 13 Active-HDL Interfaces.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
Introduction To Microsoft Word C Apply intermediate skills in utilizing word processing software Word processing programs make the writing process.
Simulink SubSystems and Masking April 22, Copyright , Andy Packard. This work is licensed under the.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Control Theory Lab 4 Modeling of Physical-SİMULİNK.
Active-HDL Interfaces Debugging C Code Course 10.
ECEN/MAE 3723 – Systems I MATLAB Lecture 2. Lecture Overview What is Simulink? How to use Simulink  Getting Start with Simulink  Building a model Example.
WS09-1 VND101, Workshop 09 MSC.visualNastran 4D Exercise Workbook Belted Cylinder.
Chapter Two Creating a First Project in Visual Basic.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Very Short Simulink Tutorial In the Matlab command window write simulink. The window that has opened is the Simulink Library Browser. –It is used to choose.
Regensburg, 24. – Introduction to Simulink Pavel Karban University of West Bohemia, Faculty of Electrical Engineering, Department of Theory.
Microsoft Office XP Illustrated Introductory, Enhanced Started with Windows 2000 Getting.
Introduction to Matlab Module #9 Page 1 Introduction to Matlab Module #9 – Simulink Topics 1.Simulink Textbook Reading Assignments Practice Problems.
Introduction to MATLAB for Engineers Third Edition William J. Palm III Chapter 10 Simulink PowerPoint to accompany Copyright © The McGraw-Hill Companies,
SIMULINK-Tutorial 1 Class ECES-304 Presented by : Shubham Bhat.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VII Introduction to SIMULINK Rajeev Madazhy
DC Motor Speed Modeling in Simulink
Introduction to MATLAB II Steve Gu Jan 25, Outline Matrix Operation –Matrix functions –Element-wise operations Dynamic Systems –Classification –2nd.
EE3417 – Introduction to Simulink
Modeling of Power Converters using Matlab and Simulink
Intro to Simulink April 15, Copyright , Andy Packard. This work is licensed under the Creative Commons.
Simulink Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams.
Simulink by Dr. Amin Danial Asham. References  MATLAB Help  Telemark University College - Department of Electrical Engineering, Information Technology.
Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
HossamTalaat - MATLAB Course - KSU - 17/08/14231 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink (part 2) By Prof. Hossam.
Getting started with Simulink
Simulink Modelling Tutorial In Simulink, it is very straightforward to represent a physical system or a model. In general, a dynamic system can be constructed.
Getting started with Simulink An introductory tutorial.
BEST Robotic, Inc. MATLAB/Simulink Team Training
- Graphical extension to MATLAB for modeling and simulation of systems
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
Microsoft Windows XP Inside Out Second Edition
WORKSHOP 3 GSE IMPORT.
Simulink Basics Reijo Vuohelainen
Fundamental Operation
Digital Image Processing
Getting Started With Simulink
Tutorial 7 – Integrating Access With the Web and With Other Programs
Presentation transcript:

INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin

TABLE OF CONTENTS What Is Simulink? What Is Simulink? Starting Simulink Starting Simulink Simulink Windows Simulink Windows Simulink Library Simulink Library Creating A New Model Creating A New Model Entering Simulink Commands Entering Simulink Commands Connecting Blocks Connecting Blocks Modeling In Simulink Modeling In Simulink Example 1 Example 1 Example 2 Example 2  Creating Subsystems  Simulation Parameters  Running A Simulation Getting Output Getting Output Using Scope Using Scope Further Considerations Further Considerations Ending A Simulink Session Ending A Simulink Session Case Study Case Study References References

What Is Simulink Simulink is a graphical method of modeling and simulating a mathematical equation or a system in Matlab. Simulink is a graphical method of modeling and simulating a mathematical equation or a system in Matlab. Simulink is not a stand alone program which means that it could not be run without running Matlab. Simulink is not a stand alone program which means that it could not be run without running Matlab. Whatever variable defined in Matlab can be used in Simulink. Whatever variable defined in Matlab can be used in Simulink.

Starting Simulink To start Simulink, you must first start MATLAB. Consult your MATLAB documentation for more information. You can then start Simulink in two ways: Click the Simulink icon on the MATLAB toolbar. Click the Simulink icon on the MATLAB toolbar. Enter the simulink command at the MATLAB prompt. Enter the simulink command at the MATLAB prompt. On Microsoft Windows platforms, starting Simulink displays the Simulink Library Browser

Simulink Windows Simulink uses separate windows to display: Simulink uses separate windows to display: a block library browser a block library a model graphical (scope) simulation output These windows are not MATLAB figure windows and cannot be manipulated using HandleGraphics® commands. These windows are not MATLAB figure windows and cannot be manipulated using HandleGraphics® commands.

Simulink Library The Library Browser displays a tree-structured view of the Simulink block libraries installed on your system. You can build models by copying blocks from the Library Browser into a model window. The Library Browser displays a tree-structured view of the Simulink block libraries installed on your system. You can build models by copying blocks from the Library Browser into a model window.

Sources and Sinks

Continuous and Discrete Systems All dynamic systems can be analyzed as continuous or discrete time systems. Simulink allows you to represent these systems using transfer functions, integration blocks, delay blocks etc. All dynamic systems can be analyzed as continuous or discrete time systems. Simulink allows you to represent these systems using transfer functions, integration blocks, delay blocks etc.

Simulink Extras Figure 5 contains some advanced linear blocks, available in the “Simulink Extras” ibrary. They contain certain advanced blocks, such as a PID control block, transfer functions with initial conditions, etc. Figure 5 contains some advanced linear blocks, available in the “Simulink Extras” ibrary. They contain certain advanced blocks, such as a PID control block, transfer functions with initial conditions, etc.

Non-linear operators

Functions and Tables

Math Block (Mathematical tools)

Signals & Systems Block ( Signals and data transfer) In complicated block diagrams, there may arise the need to transfer data from one portion to another portion of the block. They may be in different subsystems. That signal could be dumped into a GOTO block, which is used to send signals from one subsystem to another. In complicated block diagrams, there may arise the need to transfer data from one portion to another portion of the block. They may be in different subsystems. That signal could be dumped into a GOTO block, which is used to send signals from one subsystem to another. Multiplexing helps us remove clutter due to excessive connectors, and makes matrix (column/row) visualization easier. Multiplexing helps us remove clutter due to excessive connectors, and makes matrix (column/row) visualization easier.

Subsystems Block

Creating a New Model Click the New button on the Simulink Library Browser’s toolbar (Windows only) or choose New from the library window’s File menu and select Model. You can move the window as you do other windows. Click the New button on the Simulink Library Browser’s toolbar (Windows only) or choose New from the library window’s File menu and select Model. You can move the window as you do other windows. You can build models by copying blocks from the Library Browser into a model window (this procedure is described later in the modeling example ). You can build models by copying blocks from the Library Browser into a model window (this procedure is described later in the modeling example ).

Simulink opens a new model window as below.

Entering Simulink Commands You run Simulink and work with your model by entering commands. You can enter commands by: You run Simulink and work with your model by entering commands. You can enter commands by: Selecting items from the Simulink menu barSelecting items from the Simulink menu bar Selecting items from a context-sensitive Simulink menu (Windows only)Selecting items from a context-sensitive Simulink menu (Windows only) Clicking buttons on the Simulink toolbar (Windows only) Clicking buttons on the Simulink toolbar (Windows only) Entering commands in the MATLAB command windowEntering commands in the MATLAB command window

Using Context-Sensitive Menus to Enter Commands:Using Context-Sensitive Menus to Enter Commands: Simulink displays a context-sensitive menu when you click the right mouse button over a model or block library window. The contents of the menu depend on whether a block is selected. If a block is selected, the menu displays commands that apply only to the selected block. If no block is selected, themenu displays commands that apply to a model or library as a whole.

Connecting Blocks To connect blocks, left-click and drag the mouse from the output of one block to the input of another block. The figure below shows the steps involved. To connect blocks, left-click and drag the mouse from the output of one block to the input of another block. The figure below shows the steps involved.

Modeling In Simulink Example 1: Modeling Equations Converting Celsius to Fahrenheit: Converting Celsius to Fahrenheit: To model the equation that converts Celsius temperature to Fahrenheit T F = 9/5(T C ) + 32 T F = 9/5(T C ) + 32 First, consider the blocks needed to build the model: First, consider the blocks needed to build the model: A Ramp block to input the temperature signal, from the Sources library A Constant block to define a constant of 32, also from the Sources library A Gain block to multiply the input signal by 9/5, from the Math library A Sum block to add the two quantities, also from the Math library A Scope block to display the output, from the Sinks library

Next, gather the blocks into your model window. Next, gather the blocks into your model window. Assign parameter values to the Gain and Constant blocks by opening Assign parameter values to the Gain and Constant blocks by opening (double-clicking) each block and entering the appropriate value. Then, click the Close button to apply the value and close the dialog box. (double-clicking) each block and entering the appropriate value. Then, click the Close button to apply the value and close the dialog box. Now, connect the blocks. Now, connect the blocks.

The Ramp block inputs Celsius temperature. Open that block and change the Initial output parameter to 0. The Ramp block inputs Celsius temperature. Open that block and change the Initial output parameter to 0. The Gain block multiplies that temperature by the constant 9/5. The Sum block adds the value 32 to the result and outputs the Fahrenheit temperature. The Gain block multiplies that temperature by the constant 9/5. The Sum block adds the value 32 to the result and outputs the Fahrenheit temperature. Open the Scope block to view the output. Now, choose Start from the Simulation menu to run the simulation. The simulation runs for 10 seconds. Open the Scope block to view the output. Now, choose Start from the Simulation menu to run the simulation. The simulation runs for 10 seconds.

Example 2: Modeling A Simple Continuous System To model the differential equation To model the differential equation x′ (t) = – 2x (t) + u (t) where u(t) is a square wave with an amplitude of 1 and a frequency of 1 rad/sec. The Integrator block integrates its input x′ to produce x. Other blocks needed in this model include a Gain block and a Sum block. To generate a square wave, use a Signal Generator block and select the Square Wave form but change the default units to radians/sec. Again, view the output using a Scope block. Gather the blocks and define the gain. Again, view the output using a Scope block. Gather the blocks and define the gain.

An important concept in this model is the loop that includes the Sum block, the Integrator block, and the Gain block. In this equation, x is the output of the Integrator block. It is also the input to the blocks that compute x′, on which it is based. This relationship is implemented using a loop. An important concept in this model is the loop that includes the Sum block, the Integrator block, and the Gain block. In this equation, x is the output of the Integrator block. It is also the input to the blocks that compute x′, on which it is based. This relationship is implemented using a loop.

The Scope displays x at each time step. For a simulation lasting 10 seconds, the output looks like this:The Scope displays x at each time step. For a simulation lasting 10 seconds, the output looks like this:

The equation you modeled in this example can also be expressed as a transfer function. The model uses the Transfer Fcn block, which accepts u as input and outputs x. So, the block implements x/u. If you substitute sx for x′ in the above equation, you get sx = -2x + u Solving for x gives x = u /(s + 2) or, x ⁄ u = 1 ⁄ ( s + 2)

The results of this simulation are identical to those of the previous model. The results of this simulation are identical to those of the previous model. The Transfer Fcn block uses parameters to specify the numerator and denominator coefficients. In this case, the numerator is 1 and the denominator is s+2. Specify both terms as vectors of coefficients of successively decreasing powers of s. In this case the numerator is [1] (or just 1) and the denominator is [1 2]. The model now becomes quite simple.

Creating Sub System It helps reduce the number of blocks displayed in your model window. It helps reduce the number of blocks displayed in your model window. It allows you to keep functionally related blocks together. It allows you to keep functionally related blocks together. It enables you to establish a hierarchical block diagram, where a Subsystem block is on one layer and the blocks that make up the subsystem are on another. It enables you to establish a hierarchical block diagram, where a Subsystem block is on one layer and the blocks that make up the subsystem are on another.

Before - After Before - After Check with model browser in Simulink window Check with model browser in Simulink window Label subsytem Ports Label subsytem Ports

Simulation Parameters You can set the simulation parameters for each simulation such as run time or solver option You can set the simulation parameters for each simulation such as run time or solver option

Simulation Parameters (Continue) Setting simulation time Setting simulation time Setting solver Setting solver Step Size Solver type

Running A Simulation A simulation can be run using 3 ways: A simulation can be run using 3 ways: Clicking the start word on the simulation tab Clicking the start word on the simulation tab Clicking the “play” button on the window Clicking the “play” button on the window Pressing Ctrl+T. Pressing Ctrl+T.

When a simulation is running, the status bar displays the status of the simulation, including the current simulation time and the name of the current solver. You can display or hide the status bar by selecting or clearing the Status Bar option on the Simulink View menu.

Getting Output You can save scope data into workspace (you can do this with “save to workspace” block in “sinks” catagory) You can save scope data into workspace (you can do this with “save to workspace” block in “sinks” catagory) You can view more than one signal in scope either on the same axis or in the separate axis. You can view more than one signal in scope either on the same axis or in the separate axis. Data can also be exported to the workspace using the scope. Data can also be exported to the workspace using the scope. Parameters

Using Scope Setting the number of axes for the scope (Figure 1) Setting the number of axes for the scope (Figure 1) Saving the data to workspace (Figure 2) Saving the data to workspace (Figure 2)

Further Considerations This lecture can’t possibly look upon all the blocks. This lecture can’t possibly look upon all the blocks. Another way is to get “help” concerning the block. Another way is to get “help” concerning the block. This can be done by double clicking on the block. A window will appear where a help button is available. This can be done by double clicking on the block. A window will appear where a help button is available. Click on that button to know what is the potential of the block. Click on that button to know what is the potential of the block.

Ending A Simulink Session Terminate a Simulink session by closing all Simulink windows. Terminate a Simulink session by closing all Simulink windows. Terminate a MATLAB session by choosing the command below from the File menu: Terminate a MATLAB session by choosing the command below from the File menu: Exit MATLABExit MATLAB

References SIMULINK – Model-Based and System-Based Design SIMULINK – Model-Based and System-Based Design Matlab Documentation, The MathWorks. l.pdf l.pdf l.pdf l.pdf b1.pdf b1.pdf ulink_basics/ ulink_basics/