Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system.

Similar presentations


Presentation on theme: "Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system."— Presentation transcript:

1 Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system that can be modeled with differential or difference equations whose independent variable is time Provides a GUI that uses various types of elements called blocks to create a numerical simulation model The construction of a model is done with click-and-drag mouse operations As Simulink is an integral part of Matlab, it is easy to switch back and forth between the two environments during the analysis process Replaces lines of Matlab code Easy to learn and intuitive... Simulink files have the extension.mdl

2 2 The simplest way to understand Simulink is to imagine a gas or water line network Signal flows are represented by arrow lines Simulink

3 3 Basic Concepts a f(a) “Source” blocks f(x) Function Blocks and Signal Routing Blocks “Sink” blocks Function block Signal routing block Sink block Source block (=input block) (=input) (=output) Example: t=0...10 sec

4 Simulink Library Browser Or type >>simulink New model button New model window Construct your model here

5 5 Source Blocks click-drag-drop (= Right mouse button>Add to...) Click on a block for a brief description of the block Double-click to see required block parameters Right mouse button> Help to see more detailed description of a block You can import data from Matlab Brief description of clicked block

6 6 Sink Blocks To copy a block, Right mouse button>copy>paste, or CTRL+click-drag-drop, or Right mouse button-drag-drop Signals must be terminated at one of these blocks Any un-terminated signal will cause an error

7 7 Signal Routing Blocks Mux bundles signals of the same type Bus bundles signals of different types Click-drag the end to make it larger

8 8 Connecting Blocks To connect blocks, - Notice that the mouse cursor changes its shape to a cross-hair when placed on a input/output port - Click on the output port of the block, drag the cursor to the input port of the destination block, or - First click on the block to connect, then CTRL+click on the destination block - Drop a block on a signal line connecting blocks, then the block will be inserted and automatically connected Double-click on any spot to type a text there Double-click on the block name to change it Blocks are not connected Click-drag to rearrange blocks/signal lines Click-drag (enclose) to select multiple objects To see the entire system, View > Fit System To View CTRL+click to tap into a signal line

9 Example 1 Numerically solve Sources Math Operations Continuous Sinks simulation time

10 Example 1 Double-click on the Sine Wave block If you type 10 in the amplitude field, then you should remove the gain block leave it alone !

11 Example 1 Double-click on the Gain block leave it alone !

12 Example 1 Double-click on the Integrator block The most common mistake is forgetting to enter an initial condition

13 Example 1 To run, click on Before run, you must check the Configuration Parameters (under Simulation menu) Simulation time

14 14 Configuration Parameters Set the overall simulation environments - Set simulation time (you can set this in the model window as well) - Select an appropriate solver - Set options (not sure? leave them as they are)

15 Example 1 Double-click on the Sink block to see the results To auto-rescale, click on Always click on the auto-rescale button upon each execution

16 Example 1: Exporting output to Matlab Sinks >> plot(tout,simout) In the Matlab Command Window, Name it as you wish Set it to Array (Default setting is Structure) Simulink will automatically create tout

17 Example 2 Numerically solve Math Operations right-mouse click on the block, then choose Flip Change the equation to

18 Double-click on the Sum block Example 2 CCW from 12 O'clock Use ‘I’ to skip a port The number of input ports is the same as the number of + and - signs

19 Example 3 Sources Signal Routing Change the equation to

20 Double-click on the u(t) block Double-click on the u(t-1) block Example 3 magnitude

21 Example 3 Run the model, Double-click on the Scope block, Click on the Auto-scale button

22 Example 4: Transfer Function block Continuous To use this block, you must have zero initial conditions There is another transfer function block (under Simulink Extras>Additional Linear group) that allows non-zero initial conditions

23 Example 4 Double-click on the Transfer Fcn block

24 Example 5: State-Space Block Continuous

25 Double-click on the State-Space block Example 5

26 Run the model, Double-click on the Scope block, Click on the Auto-scale button

27 Example 6 Solver options Variable-step ode45 all others are default


Download ppt "Simulink  ? 1 Simulink  ( Simu lation and Link ) is an extension of Matlab Offers modeling, simulation, and analysis of dynamical systems; i.e., a system."

Similar presentations


Ads by Google