Introduction to Simulink

Similar documents
Introduction to the MATLAB SIMULINK Program

Introduction to Simulink

SIMULINK Tutorial. Select File-New-Model from the menu bar of this window. The following window should now appear.

Simulink Basics Tutorial

Simulink Basics Tutorial

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

Introduction to Simulink

Experiment 6 SIMULINK

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

SIGNALS AND LINEAR SYSTEMS LABORATORY EELE

Example: Modeling a Cruise Control System in Simulink

Experiment 8 SIMULINK

ECE-205 Lab 1. Introduction to Simulink and Matlab

Assignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Experiment 3. Getting Start with Simulink

Introduction to Matlab Simulink. Control Systems

Session 3 Introduction to SIMULINK

ELEC ENG 4CL4 CONTROL SYSTEM DESIGN

Note 10 Introduction to MATLAB & SIMULINK

2 SIMULATING A MODEL Simulink Tutorial

BME 5742 Bio-Systems Modeling and Control

How to set up an Amazon Work Profile for Windows 8

What is Simulink. >>simulink

Introduction to IgorPro

PART 1 PROGRAMMING WITH MATHLAB

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid

Figure 1: Control & Simulation Loop

Open Loop Step Response

Mathematical Modelling Using SimScape (Mechanical Systems)

SIMULINK A Tutorial by Tom Nguyen

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

Modeling Mechanical System using SIMULINK

Course Notes for Students

Introduction to MATLAB

Using Mapmaker s Toolkit. In this tutorial, you will learn the following basic elements of Mapmaker s Toolkit:

How to make a Work Profile for Windows 10

Rotary Motion Servo Plant: SRV02. Rotary Experiment #00: QuaRC Integration. Using SRV02 with QuaRC. Student Manual

Locate your Advanced Tools and Applications

Objectives. Simulink Basics

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

CDA5530: Performance Models of Computers and Networks. Chapter 8: Using Matlab for Performance Analysis and Simulation

[ MATLAB ] [ Resources ] PART TWO: SIMULINK

Navigate to Cognos Cognos Analytics supports all browsers with the exception of Microsoft Edge.

Systems & Control Lab.-Manual

Lecture 10: Simulink. What is Simulink?

EE 350. Continuous-Time Linear Systems. Recitation 1. 1

Navigate to Cognos Cognos Analytics supports all browsers with the exception of Microsoft Edge.

MATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li

Matlab Handout Nancy Chen Math 19 Fall 2004

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation

Overview. Lecture 13: Graphics and Visualisation. Graphics & Visualisation 2D plotting. Graphics and visualisation of data in Matlab

16.06/16.07 Matlab/Simulink Tutorial

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial Vb

Let s start by examining an Excel worksheet for the linear programming. Maximize P 70x 120y. subject to

Read Me First (Excel 2007)

Information Technology and Media Services. Office Excel. Charts

Polymath 6. Overview

Exercise: Graphing and Least Squares Fitting in Quattro Pro

MAT 275 Laboratory 1 Introduction to MATLAB

Getting Started in FCS Express for Previous FlowJo Users

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation

Introduction to Simulink. The Use of Mathematic Simulations in Electrical Engineering

Closed Loop Step Response

Tutorial - Exporting Models to Simulink

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

STIPlotDigitizer. User s Manual

Using the reporting function

Import and Export Explorer Queries

Justin s Guide to Good Lab Writing

MATLAB Premier. Middle East Technical University Department of Mechanical Engineering ME 304 1/50

Excel Spreadsheets and Graphs

MODELING IN SCILAB: PAY ATTENTION TO THE RIGHT

ACADEMIC TECHNOLOGY SUPPORT

EXCEL BASICS: MICROSOFT OFFICE 2010

SPA_GUI. Matlab graphical user interface allowing signal processing and. variable selection for multivariate calibration.

Intelligent GP Reporting. Docman10 Import Process

DataSweet also has a whole host of improvements which are not covered in this document.

EXCEL BASICS: MICROSOFT OFFICE 2007

SAP Favorites. You can manage your own SAP menu Favorites in multiple ways: 1. From the SAP menu bar click on Favorites to display your options:

Analog Simulation and Testing via FPAA Jeffrey Teng, Fall 2016

Getting Started. Chapter 1. How to Get Matlab. 1.1 Before We Begin Matlab to Accompany Lay s Linear Algebra Text

Microsoft Excel Using Excel in the Science Classroom

Wits Maths Connect Secondary Project Card-sorting Activities

Welcome to MicroStation

EE 1105 Pre-lab 3 MATLAB - the ins and outs

The following instructions cover how to edit an existing report in IBM Cognos Analytics.

Excel 2010 Charts and Graphs

Eastern Bank TreasuryConnect Balance Reporting User Manual

Working with Charts Stratum.Viewer 6

INTRODUCTION TO THE MATLAB APPLICATION DESIGNER EXERCISES

Charts in Excel 2003

addition + =5+C2 adds 5 to the value in cell C2 multiplication * =F6*0.12 multiplies the value in cell F6 by 0.12

Insight: Measurement Tool. User Guide

Introduction to Excel Workshop

Everything in red on the screenshots has been added for the purpose of this user guide and is the context for the words around it.

HAViewer. User guide

Client Care Desktop V4

Scottish Improvement Skills

Transcription:

Introduction to Simulink Mikael Manngård Process Control Laboratory, Åbo Akademi University February 27, 2014 Simulink is an extension to MATLAB that is used for modeling and simulation of dynamic systems. In Simulink, systems are drawn as block diagrams that can be simulated without prior knowledge in programming mathematical solvers. Simulink offers a variety blocks, such as transfer functions, mathematical operators, plotting tools and logical operators that are ready to use. Simulink is integrated within MATLAB and data can easily be transferred between the programs. Contents 1 Starting Simulink 2 2 Library Browser 3 3 Creating a Model 4 3.1 Example 1. Step response of a second order system...... 4 3.2 Example 2. Feedback control.................. 5 4 Simulateing a Model 7 5 Using the MATLAB plot command 7 1

1 Starting Simulink Simulink can be started in several ways, where one is by simply typing simulink in the MATLAB command prompt, or by selecting File New Model. When creating a new model, a blank model window is opened. Our simulink model will be drawn into this window. In Matlab 2012 or newer versions, the Simulink window will look like the following. The library browser that contains all the blocks that can be used, is accessed by clicking on the highlighted icon, in older versions of MATLAB it will look like. 2

2 Library Browser The library browser contains all the operators, and functions that can be used in Simulink. When it is first opened the library browser will look something like the following. In the left hand column, the blocks are organized into folders or so called libraries. The Commonly used blocks library contains (as it says) a set of commonly used blocks, the Contineous library contains contineous time transfer functions, PID-controllers, integrators and derivatives, sources contains input signals such as sinuoids, constants and steps and the sinks library contains scopes and blocks that saves signals to Matlab workspace. Another way to navigate the library is by typing the block names into the search field. 3

3 Creating a Model Simulink models can be created by simply dragging blocks from the library browser into the empty Simulink window. The blocks can either be connected by dragging arrows between them or by ctrl-clicking on the blocks. Blocks can be modified by double clicking in them, which will open new window of block specific settings. The principle of how to model simple dynamic systems is going to be explained by the following examples 3.1 Example 1. Step response of a second order system Assume that we want to simulate a step response for a second order system with the following transfer function G(p) = 3 3p 2 + 2p + 1 when a step change in the input u(t) from 0 to 1 at time step t = 0. To build this model, three blocks are needed, a Step (source), a Transfer Fcn (continuous) and a Scope (sink). The blocks are dragged from the library browser into the model window, and are liked together, this will look somethink like the following. The step size and step time can be modified by double clicking on the Step block, which will open a settings window. In the step time field, insert the time when the step takes place, and in the Initial value and final value fields, define the size of the step. 4

To modify the transfer function, we will double click on the Transfer Fcn block and input the numerator coefficient (3) and denominator coefficients ([3, 2, 1]). The applied settings and final model are displayed below. 3.2 Example 2. Feedback control The second order system described in Example 1 can be controlled with feedback and a PID-controller with controller described as u(t) = (P + I 1p ) + Dp e(t) where e(t) is the control error given by e(t) = r(t) y(t), where y(t) is the output and r(t) is the set point. The parameter P is the controllers proportional gain, I is the integral gain and D is the derivative gain. The controller parameters are chosen as P = 1 and I = 1/3 and D = 2/3. This sytem can be modelled in Simulink by adding a Sum and a PID Controller block to our existing model from example 1. Our step input 5

will now represent the set point r(t), which is set to change from 0 to 1 at t=0. We want a negative feedback (deviation from set point), so the sign in the Sum block needs to be changed from ++ to +. The controller parameters are inserted by double clicking on the PID Controller block. The applied settings and the final model are presented below. 6

4 Simulateing a Model Models can be simulated in Simulink simply by pressing the Run button and the results can be displayed by double clicking the Scope. If you wish to export signals to MATLAB Workspace, the To Workspace block can be used. By double clicking on the block, the variable name can be changed. Remember also to change the format to Array if you wish to save it as a vector in workspace! If the plots seem to be jagged or cut off, you will need to use a smaller step size. This can be achieved by going to Simulation Model Configuration Parameters Max Step Size, and decrease the max step size. Solver type and settings can be change in the same menu if needed. Accurate simulation time can also be saved to workspace by using the Clock and To Workspace blocks. 5 Using the MATLAB plot command Variables saved in MATLABs workspace can be plotted by using the plot command. plot(x, Y ) plots a vector Y versus vector X. Different line types, markers and colours can be obtained with plot(x, Y, S ), where S is a string from any or all of the following columns As an example, for a red dotted line with x markers, the following string will be used: plot(x, Y, rx : ) 7

To insert labels for the x and y axes, the bommands xlabel and ylabel are used. A figure title can be inserted by using the title command and line descriptions can be inserted by the legend command. The step responses for Example 1 and 2 and the matlab scrips are presented below. 8