ECEN/MAE 3723 – Systems I MATLAB Lecture 2.

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,
SIMULINK EXAMPLE transmitter Receiver Channel
MATLAB and SimulinkLecture 71 To days Outline  Callbacks  MATLAB And Simulink  S-functions  Project suggestions.
For System Dynamics & Control
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.
Control Systems Engineering, Fourth Edition by Norman S. Nise Copyright © 2004 by John Wiley & Sons. All rights reserved. Figure C-1 (p. 907) MATLAB window.
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.
Using Simscape™ for Modeling Vibration Problems:
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
Controlling a 3D Vehicle with Simulink Jeff Bender ME
Introduction to Simulink Dr. Mohammed F. Alsayed.
LAB 1 MATLAB, dSPACE and Simulink
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.
ENGR-25_Lec-25_SimuLink-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
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.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Introducing… Microsoft Windows VISTA Introducing… Microsoft Windows VISTA.
Regensburg, 24. – Introduction to Simulink Pavel Karban University of West Bohemia, Faculty of Electrical Engineering, Department of Theory.
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,
EE 460 Advanced Control and System Integration
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
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.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 12”
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.
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.
An Introduction to Simulink
BEST Robotic, Inc. MATLAB/Simulink Team Training
Matlab Programming for Engineers
WORKSHOP 1 CO-SIMULATION.
VAB™ for INFINITY Tutorial
Introduction to Matlab
- Graphical extension to MATLAB for modeling and simulation of systems
SIMULINK LOGIKA DAN PEMROGRAMAN KOMPUTER Wayan Nata Septiadi, ST
Damped Forced Vibrations Analysis Using CAMP-G® and Simulink® Modeled Solutions to Problem (
Welcome to MATLAB.
WORKSHOP 3 GSE IMPORT.
Simulink Basics Reijo Vuohelainen
Contents Simulink model Grouping into subsystems Naming the subsystems
Licensed Electrical & Mechanical Engineer
Lecture 1: Introduction
Chapter 2 – Introduction to the Visual Studio .NET IDE
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
سیمولینک کنترل خطی در متلب
Fundamental Operation
Getting Started With Simulink
Introduction To Simulink
Scripts In Matlab.
Simulink Examples Ex1: Simulate the following equation Blocks needed:
Introduction To MATLAB
An Introduction to Designing and Executing Workflows with Taverna
Presentation transcript:

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 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

What is Simulink? (1) A software package for modeling, simulating, and analyzing dynamic systems. Supports linear and nonlinear systems, modeled in continuous time, sample time, or a hybrid of the two. Systems can also be multirate (i.e. different parts that are sampled or updated at different rates)

What is Simulink? (2) For modeling, it provides a graphical user interface (GUI) for building models as block diagrams (using click-and-drag mouse operations) Can build models in hierarchical fashion (using both top-down and bottom-up approaches) You can simulate, analyze the output results, explore, revise your models and have FUN!

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Start a Simulink Session Type simulink on Matlab command window Click on the SIMULINK icon on toolbar

Simulink Library Browser SEARCH window CREAT NEW MODEL icon BLOCK set for model construction LIBRARY

Create a New Model CREAT NEW MODEL icon Workspace where you construct your model

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Building a Model Simulink Block Diagram – pictorial model of a dynamic system Each block represents an elementary dynamic system that produces an output (either continuous or discrete output) Lines represent connections of block inputs to block outputs u (Input) x (states) y (Output)

Building a Model (2) The following steps will guide you to construct a system/model: STEP 1: Creating Blocks STEP 2: Making connections STEP 3: Set Parameters STEP 4: Running Simulation

from the Sources library Building a Model (3) Step 1: Creating Blocks Click-Drag-Drop the Sine Wave block to Workspace Window This is the Sine Wave block is from the Sources library Sources library Save this model

the Signals &Systems library Building a Model (4) Step 1: Creating Blocks These are from the Sinks library The Gain block is from the Math library The Mux block is from the Signals &Systems library

Building a Model (5) Step 2: Making connections To make connection: left-click while holding down control key (on keyboard) and drag from source port to a destination port A connected Model

Building a Model (6) Step 3: Set Parameters Gain value = 5 Name the output parameter as “out1” Double click the Gain block to set the parameter for the Gain block

Building a Model (7) Step 4: Running Simulation click “simulation parameters” to set up the desired parameters You can change the “stop time” and then click the “OK button” Click here to run the simulation

Building a Model (8) View output via Scope block Output of the scope Double click on Scope block to display output of the scope Note: Scope block is similar to oscilloscope! Output of the scope Yellow: Input sine wave Purple: Output (sine wave with gain of 5 To fit graph to frame

Building a Model (9) View output (workspace) You can plot the output using the plot function View output (workspace) Three outputs show here

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Example 1:Differential Equations (1) Example of a dynamic system: A mass-spring-damper system M K B x The Mathematical model of the system is describe by: Lets M=2kg; B = 2 Ns/m; K=2 N/m

Example 1:Differential Equations (2) Use Simulink to simulate the step response of the system, i.e. STEP 1: Creating Blocks Unit Step Input f(t), N 1 Time, s Select BLOCK set Location in Simulink Library Step Sources Sum Math Operation Gain Integrator Continuous Scope & To Workspace Sinks

Example 1:Differential Equations (2) STEP 2: Making connections

Example 1:Differential Equations (3) STEP 3: Set Parameters Set Step time =0 Note: Assume all initial conditions = 0

Example 1:Differential Equations (4) STEP 4: Running Simulation Open “simulation parameters” window Set “Stop time” = 30 1 2 RUN Simulation

Example 1:Differential Equations (5) Step Response for the mass-spring-damper system example Output from Scope block Plot system response

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Example 2: Transfer Function (1) Use the same mass-spring-damper system example and simulate the response using transfer function approach The transfer function of the equation (assume all initial conditions =0)

Example 2: Transfer Function (2) STEP 1: Creating Blocks Select BLOCK set Location in Simulink Library Step Sources Transfer Function Continuous Scope & To Workspace Sinks

Example 2: Transfer Function (3) STEP 2: Making connections

Example 2: Transfer Function (4) STEP 3: Set Parameters Set Step time =0

Example 2: Transfer Function (5) STEP 4: Running Simulation Open “simulation parameters” window Set “Stop time” = 30 1 2 RUN Simulation

Example 2: Transfer Function (6) Same output as before (Slide 21) Output from Scope block Plot system response

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Creating Subsystems (1) Subsystem – similar to “Subroutine” Advantage of Subsystems: Reduce the number of blocks display on the main window (i.e. simplify the model) Group related blocks together (i.e. More organized) Can create a hierarchical block diagram (i.e. you can create subsystems within a subsystem ) Easy to check for mistakes and to explore different parameters

Creating Subsystems (2) Create Subsystem using model in Example 1 STEP 1: Creating Blocks (Main window) This is the Subsystem block is from the Subsystems library

Creating Subsystems (3) STEP 2: Double click Subsystem block and create a model in the Subsystem block Inport (named from “sum” Outport (three outports)

Creating Subsystems (4) STEP 3: Making connections (Main window)

Creating Subsystems (5) STEP 4: Set Parameter (Main window) STEP 5: Running Simulation Then view output response Output from Scope block

Lecture Overview What is Simulink? How to use Simulink Getting Start with Simulink Building a model Example 1 (Differential Equations ) Example 2 (Transfer Function) Creating Subsystems Useful Information

Useful Information (1) Ramp Function Set Slope Set Start time for Ramp function Set initial value

Useful Information (2) Unit Step Function or Impulse Input(t) 5 t(s) Input(t) Unit Step Function or Impulse Start at 0 s Start at 5.01 s

Useful Information (3) To run programs, have to be in the current active directory or in a directory in the path (goto File  Set path... ) To copy the SIMULINK Model from Simulink Workspace and add to report (Edit  Copy model to clipboard) Need help on SIMULINK (At Simulink Library Browser  Click Help)