Getting started with Simulink An introductory tutorial.

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,
© 2002 QxDesign, Inc. Building a PI controller This unit discusses Installation of Visual ModelQ The Visual ModelQ default model Placing and configuring.
For System Dynamics & Control
Lecture 3: Signals & Systems Concepts
ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Getting started with Simulink An introductory tutorial ES205 Analysis and Design of Engineering Systems Rose-Hulman Institute of Technology © R. Layton.
System Dynamics, Third Edition
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:
Matlab Matlab is a powerful mathematical tool and this tutorial is intended to be an introduction to some of the functions that you might find useful.
Lecture 2: Signals Concepts & Properties
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.
1 Simulink Create a model in Simulink Run simulation from Simulink Invoke simulation from a MATLAB script Create a subsystem Create a testbed for testing.
Simulink ® From Simulink® 7 Getting Started Guide.
By Hrishikesh Gadre Session I Introduction to EES Department of Mechanical Engineering Louisiana State University Engineering Equation.
Copyright © The McGraw-Hill Companies, Inc. System Dynamics, Third Edition William J. Palm III Using Simscape TM for Modeling Thermal Systems: Dynamics.
Using Simscape™ for Modeling Vibration Problems:
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Introduction to Simulink Dr. Mohammed F. Alsayed.
LAB 1 MATLAB, dSPACE and Simulink
Basic Pspice Instructions Stuart Tewksbury
Ansys Workbench 1 Introduction
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
Simulink ® Interface Course 13 Active-HDL Interfaces.
Simulink SubSystems and Masking April 22, Copyright , Andy Packard. This work is licensed under the.
Control Theory Lab 4 Modeling of Physical-SİMULİNK.
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.
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.
Problem Transient Response By: Matt Lausmann ME 114 Granda Assignment #3.
Regensburg, 24. – Introduction to Simulink Pavel Karban University of West Bohemia, Faculty of Electrical Engineering, Department of Theory.
OUTLINE Overview Numbers, variables and similar in Matlab
Introduction to Matlab and Simulink
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.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VII Introduction to SIMULINK Rajeev Madazhy
DC Motor Speed Modeling in Simulink
EE3417 – Introduction to Simulink
Modeling of Power Converters using Matlab and Simulink
Lecture 6: Time Response 1.Time response determination Review of differential equation approach Introduce transfer function approach 2.MATLAB commands.
Links take you to…  Different slides in your presentation  A different PowerPoint presentation  Any program - (Word can be used for example to complete.
Simulink Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams.
INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.
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.
MATLAB and SimulinkLecture 21 To days Outline Introduction to Simulink Block diagrams Building models Exercises on today’s topics.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
Modeling First Order Systems in Simulink And Analyzing Step, Pulse and Ramp Responses SOEN385 Control Systems and Applications.
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.
An Introduction to Simulink
WORKSHOP 1 CO-SIMULATION.
Formulas and Functions
VAB™ for INFINITY Tutorial
Introduction to Matlab
- Graphical extension to MATLAB for modeling and simulation of systems
National Mathematics Day
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Damped Forced Vibrations Analysis Using CAMP-G® and Simulink® Modeled Solutions to Problem (
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
Licensed Electrical & Mechanical Engineer
OptiSystem-MATLAB data interchange model and features
Fundamental Operation
Getting Started With Simulink
Presentation transcript:

Getting started with Simulink An introductory tutorial

Introduction to Simulink Simulink is a graphical, “drag and drop” environment for building simple and complex signal and system dynamic simulations. It allows users to concentrate on the structure of the problem, rather than having to worry (too much) about a programming language. The parameters of each signal and system block is configured by the user (right click on block) Signals and systems are simulated over a particular time.

Launch Simulink In the MATLAB command window, at the >> prompt, type simulink and press  Enter

Create a new model Click the new-model icon in the upper left corner to start a new Simulink file Select the Simulink icon to obtain elements of the model

Your workspace Library of elements Model is created in this window

Save your model You might create a new folder, like the one shown below, called simulink_files Use the.mdl suffix when saving

Configuration Parameters Simulink is designed to be a front-end tool for integrating ordinary differential equations (ODEs). So, you need to keep sampling issues in mind: Experiment with the ODE “Solver” parameters to make things appear correctly.

Setting the Configuration Parameters To start: 1. Click on the Simulink icon to open up Simulink in Matlab. 2. In the new model window, click on the configuration parameters.

Starting and Ending Time Parameters Simulation time Start time: 0.0End time: 100 Note that these times come from the “Sources” parameters. Keep in mind that the “Sources” are usually designed for continuous-time (not discrete time) simulations.

Solver Configuration Parameters Solver Options Type: Variable-step Solver: discrete (no continuous-states) Max Step Size: 0.5 <- Set lower for better simulations! Or: Type: Fixed-step Solver: discrete (no continuous-states) Fixed Step Size (fundamental sample size): 0.5 Set lower “Fixed Step Size” for better simulations! The rest are not as important …

Connecting Things 1. Hold down the Control key down. 2. Click on the “source” icon. 3. Click on the “sink” icon. 4. Press the left mouse key to make the connection.

Displaying Things Can use the “scope” attached to any signal. Use the “Autoscale” function that appears as binoculars in order to look at the results of the entire simulations Click on the “X”, the “Y” or the “zoom” functions to look at any specific part of the simulation

Example 1: a simple model Build a Simulink model that solves the differential equation Initial condition First, sketch a simulation diagram of this mathematical model (equation) (3 min.)

Simulation diagram Input is the forcing function 3sin(2t) Output is the solution of the differential equation x(t) Now build this model in Simulink 3sin(2t) (input) x(t) (output) integrator

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

Select an operator block Drag an Integrator block from the Continuous library to the model window

Select an output block Drag a Scope block from the Sinks library to the model window

Connect blocks with signals Place your cursor on the output port (>) of the Sine Wave block Drag from the Sine Wave output to the Integrator input Drag from the Integrator output to the Scope input Arrows indicate the direction of the signal flow.

Select simulation parameters Double-click on the Sine Wave block to set amplitude = 3 and freq = 2. This produces the desired input of 3sin(2t)

Select simulation parameters Double-click on the Integrator block to set initial condition = -1. This sets our IC x(0) = -1.

Select simulation parameters Double-click on the Scope to view the simulation results

Run the simulation In the model window, from the Simulation pull- down menu, select Start View the output x(t) in the Scope window.

Simulation results To verify that this plot represents the solution to the problem, solve the equation analytically. The analytical result, matches the plot (the simulation result) exactly.

Example 2 Build a Simulink model that solves the following differential equation 2nd-order mass-spring-damper system zero ICs input f(t) is a step with magnitude 3 parameters: m = 0.25, c = 0.5, k = 1

Create the simulation diagram On the following slides: The simulation diagram for solving the ODE is created step by step. After each step, elements are added to the Simulink model. Optional exercise: first, sketch the complete diagram (5 min.)

(continue) First, solve for the term with highest- order derivative Make the left-hand side of this equation the output of a summing block summing block

Drag a Sum block from the Math library Double-click to change the block parameters to rectangular and + - -

(continue) Add a gain (multiplier) block to eliminate the coefficient and produce the highest-derivative alone summing block

Drag a Gain block from the Math library Double-click to change the block parameters. Add a title. The gain is 4 since 1/m=4.

(continue) Add integrators to obtain the desired output variable summing block

Drag Integrator blocks from the Continuous library Add a scope from the Sinks library. Connect output ports to input ports. Label the signals by double-clicking on the leader line. ICs on the integrators are zero.

(continue) Connect to the integrated signals with gain blocks to create the terms on the right-hand side of the EOM summing block c k

Drag new Gain blocks from the Math library  Double-click on gain blocks to set parameters  Connect from the gain block input backwards up to the branch point.  Re-title the gain blocks. To flip the gain block, select it and choose Flip Block in the Format pull-down menu. c=0.5 k=1.0

Complete the model Bring all the signals and inputs to the summing block. Check signs on the summer. c k f(t) input x(t) output

Double-click on Step block to set parameters. For a step input of magnitude 3, set Final value to 3

Final Simulink model

Run the simulation

Results Underdamped response. Overshoot of 0.5. Final value of 3. Is this expected?

Paper-and-pencil analysis based on the equations of motion Standard form Nat’l freq. Damping ratio Static gain

Check simulation results Damping ratio of 0.5 is less than 1. Expect the system to be underdamped. Expect to see overshoot. Static gain is 1. Expect output magnitude to equal input magnitude. Input has magnitude 3, so does output. Simulation results conform to expectations.

A Simple Example: Displaying a Chirp Signal in Simulink The Model ->

Chirp Parameters Thus, the correct display should show a slowly varying sinusoid that is speeding up. From the source parameters: Start time = 0 End time = 100

Configuration Parameters Notice the “Fixed-step size” of 0.1.

After Running the Simulation After clicking on “Autoscale”, it all appears to be working.

Aliasing Due to Insufficient Sampling After changing the “Fixed-step size” to 1... TOO LARGE!

System Performance Using MATLAB and Simulink

End of tutorial