Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

Running a Demo Simulation

Overview of the Model

One way to become familiar with the basics of SimEvents models and the way they work is to examine and run a previously built model. This section describes a SimEvents demo model. The model simulates a technique for dynamically adjusting the energy consumption of a microcontroller based on the workload, without compromising quality of service. Changes in the workload can occur as discrete events.

Opening the Model

To open this demo, enter sedemo_DVS_model in the MATLAB Command Window.

Alternatively, you can open the MATLAB Help browser and, in the Demos tab, click the + sign next to Simulink, SimEvents, and Application Demos. In the expanded list of application demos, double-click the listing for Dynamic Voltage Scaling Using Online Gradient Estimation.

Examining Entities and Signals in the Model

This section describes the different kinds of ports and lines that appear in the sedemo_DVS_model model. Compared to signal ports, entity ports look different and represent a different concept.

Entity Ports and Connections

Some blocks in this model can process entities, which the What Is an Entity? section discusses.

The FIFO Queue block and the Start Timer block, which are part of the SimEvents library set, process entities in this model. Each of these blocks has an entity input port and an entity output port. The following figure shows the entity output port of the FIFO Queue block and the entity input port of the Start Timer block.

Entity ports and entity connection line

Entity connection lines represent relationships among two blocks (or among their entity ports) by indicating a path by which an entity can:

The preceding figure shows the connection line:

When you run the simulation, entities that depart from the OUT port arrive simultaneously at the IN port.

By convention, entity ports use labels with words in uppercase letters, such as IN and OUT.

You cannot branch an entity connection line. If your application requires an entity to arrive at multiple blocks, use the Replicate block to create copies of the entity.

Signals and Signal Ports

Some blocks in this model can process signals. Signals represent numerical quantities defined at all times during a simulation, not only at a discrete set of times. Signals appear as connection lines between signal ports of two blocks. The following figure shows that the Start Timer block has not only an entity output port but also a signal output port. The signal output port connects to the Random Service Time subsystem.

Signal ports and signal connection lines

Key Components of the Model

The sedemo_DVS_model model uses event-based blocks to simulate the workload of the microcontroller:

Important discrete events in this model are the generation of a new job and the completion of processing of a job.

The model also includes blocks that simulate a dynamic voltage scaling (DVS) controller that adjusts the input voltage depending on the workload of the microcontroller. The idea is to minimize the average cost per job, where the cost takes into account both energy consumption and quality of service. For more information about the cost and the optimization technique, see Dynamic Voltage Scaling Using Online Gradient Estimation.

Appearance of Entities

Entities do not appear explicitly in the model window. However, you can gather information about entities using plots, signals, and entity-related features in the debugger. See these sections for more information:

Running the Simulation

To run the sedemo_DVS_model simulation, choose Simulation > Start from the model window. A Figure window opens with a dynamic plot showing how the DVS controller varies the voltage during the simulation to reduce the average cost per job. A triangle marker moves to indicate the current voltage and corresponding cost.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS