Documentation Center

  • Trial Software
  • Product Updates

Behavior Changes in Migrated Models

This section provides you with a more detailed description of some behavior changes that you might see when you migrate your model. Where applicable, a workaround is included.

For more information on the most significant behavior and syntax changes introduced in recent versions of SimEvents®, see R2011b.

Eliminate Multifiring Behavior

Once you use the seupdate function to migrate your model to the latest version of the software, you can select the configuration parameter Prevent duplicate events on multiport blocks and branched signals. This parameter eliminates each type of multifiring behavior that is described in Multifiring Behavior. For more information on this configuration parameter, see Prevent duplicate events on multiport blocks and branched signals.

Algebraic Loops

If the model has a time-driven section or block that is not contained in a discrete-event subsystem, such as an IC block, seupdate inserts a gateway before and after that section or block. When you simulate the model, you might notice algebraic loop errors.

To remove algebraic loop errors do one of the following:

  • Replace the time-driven block, such as the IC block, with its SimEvents equivalent. For example, replace the IC block with the SimEvents Initial Value block.

    When you replace a time-driven block with a SimEvents block, remove the gateway blocks.

  • Add a Simulink® Memory or Delay block adjacent to the gateway block, outside the discrete event system. However, this action might cause a delay that you do not want. If so, use the third option.

  • Remove the gateway blocks and move the remaining blocks into an atomic subsystem.

Changed Behavior of Entities Arriving at Empty Queue Blocks

In previous releases, when an entity arrived at an empty queue block, if possible, the entity advanced immediately and the #n output of the queue block did not change in value. Now, when an entity arrives at an empty queue block, the software behaves as follows.

  • If the output port of the queue block is not blocked:

    • The #n output of the queue block, which is the number of entities in the queue, changes from 0 to 1.

    • The entity immediately advances.

    • When the entity depart the block, the #n output changes from 1 back to 0.

  • If the output port is blocked:

    • The entity is held in the queue.

    • The #n output of the queue block changes from 0 to 1.

Events at Time Zero

In previous versions of SimEvents, blocks did not have events at time zero. Your converted model might now have events at time zero that cause changes in simulation results. In the updated model, the number of events at time zero depends on whether or not you select the configuration parameter Prevent duplicate events on multiport blocks and branched signals.

The following graphic shows the updated version of the model introduced in the section, No Events at Time Zero.

In this updated version of the model, the software now produces events at time zero.

Because the Add block is a multiport block, at each time instant, the block exhibits multifiring behavior that causes it to produce two separate results. At each simulation time, you can consider the first of these results to be an intermediate value that you might not want. For more information, see Multifiring Behavior.

If you select the configuration parameter Prevent duplicate events on multiport blocks and branched signals, the multifiring behavior is eliminated. The software produces a single result at each simulation time, including time zero .

Blocks with Unevaluated Events at Time Zero

In an updated model, the following blocks are exceptions to the behavior described in Events at Time Zero.

  • Atomic Subystem

  • MATLAB® Function block

  • Stateflow® Chart

When you migrate a model containing any of these blocks, in the updated model, the blocks have events at time zero. However, if you do not select the configuration parameter, Prevent duplicate events on multiport blocks and branched signals, these events are not evaluated. Therefore, at time zero, these blocks output an initial value of 0.

The following graphic shows a SimEvents model that has been updated to the latest version of the software. The model is similar to the model shown in Events at Time Zero. However, in this example, the Gain, Bias, and Add blocks are within an Atomic Subsystem.

In this updated model, the software produces events at time zero.

Similar to the example in Events at Time Zero, the model exhibits multifiring behavior that causes two results at each time instant. However, because the Gain, Bias, and Add blocks are within an Atomic Subsystem, the events at time zero are not evaluated. Therefore, for each event at time zero, the Atomic Subsystem outputs 0.

When you select the configuration parameter, Prevent duplicate events on multiport blocks and branched signals, the software:

  • Eliminates multifiring behavior and outputs a single result at each time instant, including time zero.

  • Evaluates the single event at time zero. In this case, the result at time zero is 2.

Bus Signals Converted to Non-Bus Signals

When seupdate adds a gateway block to the output port of a block that produces a bus signal, if possible, the gateway block converts the bus signal to a non-bus signal. This conversion might not always be possible. In such cases, because the bus signal remains in your updated model, when the software compiles the model, you see an error.

In the updated model, to connect a bus signal to a gateway block without seeing an error, select the configuration parameter, Prevent duplicate events on multiport blocks and branched signals.

For more information, see:

Was this topic helpful?