HossamTalaat - MATLAB Course - KSU - 21/1/24 1 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink By Prof. Hossam Talaat.

Slides:



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

Short introduction to the use of PEARL General properties First tier assessments Higher tier assessments Before looking at first and higher tier assessments,
1 1 Mechanical Design and Production Dept, Faculty of Engineering, Zagazig University, Egypt. Mechanical Design and Production Dept, Faculty of Engineering,
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
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.
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.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
HossamTalaat - MATLAB Course - KSU - 19/09/ IEEE Student Branch - College of Engineering - KSU Getting started with Power System Blockset By Prof.
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.
Simulink ® From Simulink® 7 Getting Started Guide.
DC Motor Model Using Simscape Engr. Salim Lashari.
Using Simscape™ for Modeling Vibration Problems:
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.
Fundamentals of Power Electronics and Power System with MATLAB
Introduction to Simulink Dr. Mohammed F. Alsayed.
LAB 1 MATLAB, dSPACE and Simulink
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Simulink ® Interface Course 13 Active-HDL Interfaces.
Simulink SubSystems and Masking April 22, Copyright , Andy Packard. This work is licensed under the.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
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.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
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.
Regensburg, 24. – Introduction to Simulink Pavel Karban University of West Bohemia, Faculty of Electrical Engineering, Department of Theory.
Introduction to LabVIEW 8.5
OUTLINE Overview Numbers, variables and similar in Matlab
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
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
Lecture 6: Time Response 1.Time response determination Review of differential equation approach Introduce transfer function approach 2.MATLAB commands.
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.
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”
Getting started with MATLAB/Simulink
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.
MATLAB and SimulinkLecture 21 To days Outline Introduction to Simulink Block diagrams Building models Exercises on today’s topics.
Simulink Continuous Library by Dr. Amin Danial Asham.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
President UniversityErwin SitompulSMI 6/1 Lecture 6 System Modeling and Identification Dr.-Ing. Erwin Sitompul President University
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
Getting started with Simulink An introductory tutorial.
 Types of communication systems ◦ Coaxial (Wired) ◦ Microwave (Wireless) ◦ Satellite (Wireless) ◦ Cable (Wired) ◦ Cellular (Wireless)
- Graphical extension to MATLAB for modeling and simulation of systems
National Mathematics Day
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
Welcome to MATLAB.
Homework 5 A linear time-invariant system is given as below:
Simulink Basics Reijo Vuohelainen
سیمولینک کنترل خطی در متلب
Fundamental Operation
Homework 5 A linear time-invariant system is given as below:
Digital Image Processing
Getting Started With Simulink
Introduction To MATLAB
Presentation transcript:

HossamTalaat - MATLAB Course - KSU - 21/1/24 1 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink By Prof. Hossam Talaat

HossamTalaat - MATLAB Course - KSU - 21/1/24 2 What is Simulink? It becomes a standard in many universities. It becomes a standard in many universities. Simulink is an interactive environment for modeling, simulating and analyzing dynamic systems. Simulink is an interactive environment for modeling, simulating and analyzing dynamic systems. It uses graphical user interface of block diagram representation instead of differential and difference equations. It uses graphical user interface of block diagram representation instead of differential and difference equations. A Simulink model consists of blocks (representing elementary dynamic systems) interconnected by lines (time-domain signals). A Simulink model consists of blocks (representing elementary dynamic systems) interconnected by lines (time-domain signals).

HossamTalaat - MATLAB Course - KSU - 21/1/24 3 Capabilities of Simulink It Simulates Linear and nonlinear systems. It Simulates Linear and nonlinear systems. It Simulates continuous, discrete and hybrid systems. It Simulates continuous, discrete and hybrid systems. It has a powerful “What if” exploration capability. It has a powerful “What if” exploration capability.

HossamTalaat - MATLAB Course - KSU - 21/1/24 4 How to Simulate a Dynamic System Phase I: Create a model of the system to be simulated using Simulink’s model editor, blocks library and click and drag mouse operations. Phase I: Create a model of the system to be simulated using Simulink’s model editor, blocks library and click and drag mouse operations. Phase II: Use Simulink’s ODE solvers to simulate the behavior of the system for a specified time span. Phase II: Use Simulink’s ODE solvers to simulate the behavior of the system for a specified time span.

HossamTalaat - MATLAB Course - KSU - 21/1/24 5 Phase I: Creating a model To open Simulink click on the Simulink icon on the MATLAB toolbar. To open Simulink click on the Simulink icon on the MATLAB toolbar. To open a new model click on the corresponding icon on the Simulink toolbar. To open a new model click on the corresponding icon on the Simulink toolbar. To introduce blocks in your model, choose the block from the library, click on it and drag it in your model. To introduce blocks in your model, choose the block from the library, click on it and drag it in your model. Interconnect the output of a block to the input of the required block by a line using mouse. Interconnect the output of a block to the input of the required block by a line using mouse. Double-click each block to set its parameters. Double-click each block to set its parameters.

HossamTalaat - MATLAB Course - KSU - 21/1/24 6 Model 0: How to Build a New Model Procedure How to insert a Block? How to insert a Block? How to set the block parameters? How to set the block parameters? How to interconnect between blocks? How to interconnect between blocks? How to add text? How to add text?

HossamTalaat - MATLAB Course - KSU - 21/1/24 7

8 Simulink block libraries Simulink provides a library browser that allows you to select blocks from libraries of standard blocks: Sources - blocks that generate signals Sources - blocks that generate signals Sinks - display or output blocks. Sinks - display or output blocks. Discrete - discrete-time components blocks. Discrete - discrete-time components blocks. Continuous - linear continuous-time blocks. Continuous - linear continuous-time blocks. Math - general mathematical functions blocks. Math - general mathematical functions blocks.

HossamTalaat - MATLAB Course - KSU - 21/1/24 9 Simulink block libraries (cont.) Functions & Tables - general functions and look- up table operations. Functions & Tables - general functions and look- up table operations. Nonlinear - blocks that describe nonlinear functions. Nonlinear - blocks that describe nonlinear functions. Signal & Systems - blocks that allow multiplexing, demultiplexing, create subsystems and perform similar functions. Signal & Systems - blocks that allow multiplexing, demultiplexing, create subsystems and perform similar functions. Blocksets and Toolboxes - the Extras block library of specialized blocks. Blocksets and Toolboxes - the Extras block library of specialized blocks. Demos - useful MATLAB and Simulink demos. Demos - useful MATLAB and Simulink demos.

HossamTalaat - MATLAB Course - KSU - 21/1/24 10 Model 1: Sources and Sinks Procedure Run the model using different waveforms. Run the model using different waveforms. Run the model using different waveforms. Run the model using different waveforms. Open/close the manual switch to check the effect of noise. Open/close the manual switch to check the effect of noise. Open/close the manual switch to check the effect of noise. Open/close the manual switch to check the effect of noise. Check the workspace for y1. Check the workspace for y1. Check the workspace for y1. Check the workspace for y1. Check the file model1.mat under matlab/simulink folder. Check the file model1.mat under matlab/simulink folder. Check the file model1.mat under matlab/simulink folder. Check the file model1.mat under matlab/simulink folder.

HossamTalaat - MATLAB Course - KSU - 21/1/24 11 New Blocks in Model 1 BlockGroupDescription Signal generator Uniform random number To workspace Scope To file Sum Manual switch SourcesSourcesSinkSinkSinkMathNonlinear Generate various waveforms Generate uniformly distributed random numbers Write data to a variable in the workspace Display signals generated during a simulation Write data to a file Generate the sum of the inputs Switch between two inputs

HossamTalaat - MATLAB Course - KSU - 21/1/24 12 Model 2: Scopes and Graphs Procedure Run the model using different values of w (freq. of y in rad/s), put w= 50, 100, 150, and 250. Run the model using different values of w (freq. of y in rad/s), put w= 50, 100, 150, and 250. For each value sketch the graphs obtained in the 4 fixed scopes. For each value sketch the graphs obtained in the 4 fixed scopes. How to use a floating scope? How to use a floating scope? How to control the graph settings? How to control the graph settings?

HossamTalaat - MATLAB Course - KSU - 21/1/24 13 New Blocks in Model 2 BlockGroupDescription Sine wave XY Graph MuxSourcesSinkSignals Generate a sine wave Display an x-y plot of signals using a MATLAB figure window Combine several input lines into a vector line.

HossamTalaat - MATLAB Course - KSU - 21/1/24 14 Phase II: Solving the Dynamic Model (Simulation)  The Simulink block diagram model depicts a time-dependent mathematical relationship between Inputs, States, and Outputs in the form of a set of Ordinary Differential Equations “ODE”.  In this phase Simulink successively solves the ODE to compute the states and the outputs of the system at intervals from the simulation start time to the stop time.  To set the parameters of the simulation select simulation from Simulink’s toolbar, then select simulation parameters. Ir. Mihaela BUTUNOIU Ghent University MATLAB and Simulink Tutorial 2002

HossamTalaat - MATLAB Course - KSU - 21/1/24 15 Solver Pane In the solver tab you have to set:  Start Time (default is zero) and Stop time.  Solver options : fixed/variable step, discrete/continuous.  Step size: it is the length of time between successive calculation. If you select variable step this may produce more accurate results without sacrificing execution speed. You have to select:  Max, min and initial step size (the default is auto).  Relative and absolute tolerance to control the accuracy of the solution (the default is auto).  Output options: to control the simulation output. If you need more points use Refine output with refine factor>1.

HossamTalaat - MATLAB Course - KSU - 21/1/24 16 Model 3: Continuous Blocks Procedure How to set the transfer function? How to set the transfer function? Run the model. Run the model. Verify the output of each block in the combined graph. Verify the output of each block in the combined graph.

HossamTalaat - MATLAB Course - KSU - 21/1/24 17 New Blocks in Model 3 BlockGroupDescription RampDerivativeIntegrator Transfer Fcn Transport delay SourcesContinuousContinuousContinuousContinuous Generate a ramp signal Output the time derivative of the input. Integrate the input. Implement a linear transfer function. Delay the input by a given amount of time.

HossamTalaat - MATLAB Course - KSU - 21/1/24 18 Model 4: Transient response of a second order system Procedure Set the damping coefficient “zeta” by double clicking the transfer function, let zeta=0.2, 0.4, 0.6, 1,5. Set the damping coefficient “zeta” by double clicking the transfer function, let zeta=0.2, 0.4, 0.6, 1,5. For each value specify if the response is underdamped, critical damped, or overdamped. For each value specify if the response is underdamped, critical damped, or overdamped.

HossamTalaat - MATLAB Course - KSU - 21/1/24 19 Step-by-Step Model Construction Design of a First order L.P.F. Theoretical Background

HossamTalaat - MATLAB Course - KSU - 21/1/24 20 Required Construct a Simulink Model that describes the dynamic performance of a L.P.F. Construct a Simulink Model that describes the dynamic performance of a L.P.F. Use an original low frequency signal x with a noise high frequency signal y: Use an original low frequency signal x with a noise high frequency signal y: x=100 sin(120 t) y= 10 sin(4000 t).

HossamTalaat - MATLAB Course - KSU - 21/1/24 21 Step I Insert a “sine wave” input from Sources. Insert a “sine wave” input from Sources. Copy it to have another one. Copy it to have another one. Double click each one to adjust its parameters (Amplitude and Freq.). Double click each one to adjust its parameters (Amplitude and Freq.). Edit the Block name. Edit the Block name. Right-click to adjust foreground color. Right-click to adjust foreground color.

HossamTalaat - MATLAB Course - KSU - 21/1/24 22 Step II Insert a “scope” from Sinks. Insert a “scope” from Sinks. Double click it then select parameters icon to set “no. of axes” = 2. Double click it then select parameters icon to set “no. of axes” = 2. Use mouse to connect each of the sine wave outputs to one of the scope inputs. Use mouse to connect each of the sine wave outputs to one of the scope inputs. Name the two signals. Name the two signals.

HossamTalaat - MATLAB Course - KSU - 21/1/24 23 Step III Use the icon on toolbar to start simulation. Use the icon on toolbar to start simulation. Double-click the scope to check the signals. Double-click the scope to check the signals. If the obtained plots are not as expected select simulation parameters and adjust the stop time (say 0.05), the max step (say ), the min and initial steps (say ) and relative accurracy (say 1e- 6). If the obtained plots are not as expected select simulation parameters and adjust the stop time (say 0.05), the max step (say ), the min and initial steps (say ) and relative accurracy (say 1e- 6).

HossamTalaat - MATLAB Course - KSU - 21/1/24 24 Step IV Insert a “sum” from Math. Insert a “sum” from Math. Connect the output of each sine to on of the sum inputs. Connect the output of each sine to on of the sum inputs. Connect the output of sum to a scope. Connect the output of sum to a scope. Start simulation and verify if the plot is as expected.. Start simulation and verify if the plot is as expected..

HossamTalaat - MATLAB Course - KSU - 21/1/24 25 Step V Insert a transfer function ”T.F.” from continuous. Insert a transfer function ”T.F.” from continuous. Set its parameters such that the numerator =1 and denominator = s +1. Set its parameters such that the numerator =1 and denominator = s +1. Name it L.P.F Name it L.P.F Connect the output of sum to the input of the T.F. Connect the output of sum to the input of the T.F.

HossamTalaat - MATLAB Course - KSU - 21/1/24 26 Step VI Insert a scope and name it “filtered signal”. Insert a scope and name it “filtered signal”. Connect the output of T.F. to the scope input. Connect the output of T.F. to the scope input. Start simulation then verify the obtained plot. Start simulation then verify the obtained plot. Change the time constant to ,.001 and.01 and comment. Change the time constant to ,.001 and.01 and comment.

HossamTalaat - MATLAB Course - KSU - 21/1/24 27 Step VII Insert a scope and name it “filtered signal”. Insert a scope and name it “filtered signal”. Connect the output of T.F. to the scope input. Connect the output of T.F. to the scope input. Start simulation then verify the obtained plot. Start simulation then verify the obtained plot. Change the time constant to ,.001 and.01 and comment. Change the time constant to ,.001 and.01 and comment.

HossamTalaat - MATLAB Course - KSU - 21/1/24 28 Step VIII Insert a scope with 2 inputs to compare the filtered and unfiltered signals. Insert a scope with 2 inputs to compare the filtered and unfiltered signals.

HossamTalaat - MATLAB Course - KSU - 21/1/24 29 End of tutorial