










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Simulink is an interactive, graphical environment for modeling, simulating, and analyzing dynamic systems using MATLAB. It provides a user-friendly interface for building models as block diagrams, supports linear and nonlinear systems, and is integrated with MATLAB for easy data sharing. In this document, we explore the basics of Simulink, its components, and the process of creating a simple model.
Typology: Lecture notes
1 / 18
This page cannot be seen from the preview
Don't miss anything!
Simulink, an add-on product to MATLAB, provides an interactive, graphical environment for modeling, simulating, and analyzing of dynamic systems. It enables rapid construction of virtual prototypes to explore design concepts at any level of detail with minimal effort. For modeling, Simulink provides a graphical user interface (GUI) for building models as block diagrams. It includes a comprehensive library of pre- defined blocks to be used to construct graphical models of systems using drag-and-drop mouse operations. The user is able to produce an “up-and-running” model that would otherwise require hours to build in the laboratory environment. It supports linear and nonlinear systems, modeled in continuous-time, sampled time, or hybrid of the two. Since students learn efficiently with frequent feedback, the interactive nature of Simulink encourages you to try things out, you can change parameters “on the fly” and immediately see what happens, for “what if” exploration. Lastly, and not the least, Simulink is integrated with MATLAB and data can be easily shared between the programs.
In order to use Simulink, you must first start MATLAB. With MATLAB running, there are two ways to start Simulink:
In response, MATLAB displays the Simulink Library Browser.
Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals from the output terminal of one block to the input terminal of another block. One exception to this is that a line can tap off of another line. This sends the original signal to two (or more) destination blocks.
Lines can never inject a signal into another line; lines must be combined through the use of block such as a summing junction. A signal can be either a scalar signal or a vector signal.
Building a Simulink model of a system consists of selecting the appropriate blocks and connecting them in a way that represents the mathematical models. Since the best way to learn a simulation tool is to work with it, this first tutorial will guide you through a simple example. We will build the block diagram for a simple model consisting of a sinusoidal input multiplied by a constant gain, which is depicted below.
The Simulink model will consist of 6 distinct blocks, namely, Sine Wave , Scope , Mux , Clock , and To Workspace. The Sine Wave is a source block from which a sinusoidal input signal originates. The signal is transferred through a line in the direction indicated by the arrow to the Gain block. The Gain block modifies its input (scales it by 5) and outputs a new signal through a line. The output of the Gain block and the output of the Sine Wave are combined in the multiplexer (Mux) to form a signal vector. The signal vector is transferred through a line to the Scope block used to display a signal much like an oscilloscope.
Block Name Specifications Location
Sine Wave
Amplitude=1v Frequency=1 rad/s Sources
Scope Time range=10s Sinks
Gain Gain=5 Math Operations
A. Step one: Select desired blocks – Getting the blocks into the model window:
Follow the steps below to collect the necessary blocks:
B. Step 2: Configure block parameters - Resizing and moving blocks:
C. Step 3: Connecting block inputs and outputs- Adding a branch line:
To connect the output of the Sine Wave to the input of the Mux block, you will use a branch line. Drawing a branch line is slightly different in that to start, the branch line must be welded to an existing line. Position the pointer on the line that connects the Sine Wave block to the Gain block. Without moving the mouse, press and hold down the CTRL key and then press and hold the left mouse button. Drag the pointer to the input port of the Mux block and release the mouse button.
E. More Modifications
Modify blocks
Follow these steps to properly modify the blocks in your model
Copying blocks:
Removing blocks:
Connecting blocks with lines:
Now that the blocks are properly laid out, you will now connect them together. Follow these steps:
Double-click the Scope block, Scope window will pop-up. Then click SimulationÆStart, you will see the simulation result is plotted in the Scope. Click Autoscale (an icon of Telescope), the Scope will rescale the plot and make it fit the window. You can also Zoom in/out the plot. You can also rescale the axes; by right click on the axes.
In the model window, select Configuration Parameters from the Simulation menu, as depicted below.
You will see the following dialog box.
There are many simulation parameter options, we will be concerned with the Start time and Stop time , which tell SIMULINK over what time span to perform the simulation. Keep the Start time at 0.0, and change the Stop time from 10.0 to 1000.00. Next, we will alter the Max step size. Change Max step size from auto to 0.001. Close the dialog box by clicking OK and run the simulation.
After hitting the Autoscale button , the Scope window should provide a much better display of the output.
The scope block displays its input with respect to simulation time. The Scope block can have multiple axis; all axes have a common time range. You can move and resize the Scope window and you can modify the Scope’s parameter values during the simulation. When you start a simulation, Simulink does not open Scope windows.
Y-axis Limits
You set Y-limits by right-clicking an axis and choosing Axes Properties. The following dialog box appears:
Change the x-axis limits by entering a number or auto in the Time range field. Entering a number of seconds causes each screen to display the amount of data that corresponds to that number of seconds. Enter auto to set the x-axis to the duration of the simulation.
Tick labels:
You can choose to have tick labels on all axes, or one axis, or on the bottom axis only, using the Tick labels list