Basics For Simulink: Dr. N. Yadaiah
Basics For Simulink: Dr. N. Yadaiah
Dr. N. YADAIAH
ASSOCIATE PROFESSOR DEPT. of E.E.E. JNTUCEH
INTRODUCTION
Simulink is a software package for modeling, simulating, and analyzing dynamical systems. It supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. It can be used to explore the behavior of a wide range of real-world systems, including electrical circuits, shock absorbers, braking systems, and many other electrical, mechanical, and thermodynamic systems. The systems can also be multirate, i.e., have different parts that are sampled or updated at different rates. For modeling, Simulink provides a graphical user interface (GUI) for building models as block diagrams, using click-and-drag mouse operations. This is a far cry from previous simulation packages that require formulating differential equations and difference equations in a language or program. Simulink has its own comprehensive block library of sinks, sources, linear and nonlinear components, and connectors. Also it can be customized and create new blocks. Steps the system through time using an engine that
Propagates signals Computes block outputs
Uses MATLAB workspace for parameters Can interface with MATLAB workspace for system inputs & outputs
STARTING SIMULINK
Simulating a dynamic system is a two-step process with Simulink. First, Simulink's model editor is used to create a model of the system to be simulated. The model graphically depicts the time-dependent mathematical relationships among the system's inputs, states, and outputs.
Then, Simulink is used to simulate the behavior of the system for a specified time span.
STARTING SIMULINK
To run Simulink from MATLAB Window:
Blocks represents the elementary dynamic systems that Simulink knows how to simulate.
SIMULINK FEATURES
Modeling Dynamical Systems with Simulink Simulink provides a library browser that allows us to select blocks from libraries of standard blocks and a graphical editor that allows us to draw lines connecting the blocks and we can model virtually any real-world dynamic system by selecting and interconnecting the appropriate Simulink blocks. Simulink Library A Simulink block diagram is a pictorial model of a dynamic system. It consists of a set of symbols, called blocks, interconnected by lines. Each block represents an elementary dynamic system that produces an output either continuously (a continuous block) or at specific points in time (a discrete block). The lines represent connections of block inputs to block outputs. Every block in a block diagram is an instance of a specific type of block. The type of the block determines the relationship between a block's outputs and its inputs, states, and time.
SIMULINK LIBRARY
The Simulink library Blocks can be used as follows:
Block search
Block description
Libraries
Blocks
COMBINING SIGNALS
RENAMING BLOCKS
Single click on block name to select and edit. Every block has a unique name. Block names can be multiple lines. Drag to the opposite side of block to change position. Use Format menu to hide the name.
ANNOTATING DIAGRAMS
Double click on background to create textbox Type in the text Right click on text to change font, size, alignment Left click and move to change position
LABELING SIGNALS
Double click on signal to type label Left-click and move anywhere on the Signal On attempt to move elsewhere, the label will snap back to the signal
CHANGING POSITION/ORIENTATION
Shift and left click and drag to disconnect Ctrl-I to flip Ctrl-R to rotate by 90 degrees
Simulink Libraries
SIMULINK LIBRARIES
Continuous: Systems with continuous states
CREATING SUBSYSTEMS
Select the region to be encapsulated (left click-drag on background) Select Create Subsystem in Edit menu
>> squared_sine
OUTPUT TO WORKSPACE
Simulink can use the MATLAB workspace for its input/outputs. Use To Workspace block. Output written to Workspace when simulation is paused/ stopped. Can be saved as structure (includes time) or array.
MODIFYING BLOCKS
Resize a block by dragging its corner Change coloring of a block using the context menu Right click on block Choose background and foreground color
>> cruisesystem
>> simplecomms
REFERENCES
[1] Simulink help files [2] Ashish Tewari, Modern Control Design with MATLAB and Simulink, John Wiley & Sons, Ltd, 2003.
THANK YOU