Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

Exploring Simultaneous Events

One way that you can see details about which events occur simultaneously and the sequence in which the application processes them is by running the simulation with the SimEvents debugger. The debugger displays messages in the Command Window to indicate what is happening in the simulation, and lets you inspect states at any point where the debugger suspends the simulation. You might still need to infer some aspects of the simulation behavior that do not appear in the Command Window messages.

Tips for how you can use the debugger to explore simultaneous events, where the commands mentioned are valid at the sedebug>> prompt of the debugger, are:

Using Nearby Breakpoints to Focus on a Particular Time

  1. Create a timed breakpoint at the time that you are interested in. For example, if you are interested in what happens at T=3, at the sedebug>> prompt, enter this command:

    tbreak(3)
  2. Enter cont to reach the breakpoint from step 1.

    If the time that you specified in step 1 is an earlier approximation of the actual time at which something interesting happens, the simulation might stop at a time later than the time of the breakpoint. For example, suppose you guess T=3 from looking at a plot, but the actions of interest really occur at T=3.0129. In this case, having the simulation stop at T=3.0129 is desirable if nothing happens in the simulation at exactly T=3.

  3. Create a timed breakpoint shortly after the current simulation time, by entering:

    tbreak(simtime + 128*eps*simtime)
  4. Enter cont to reach the next breakpoint. The portion of the simulation log between the last two cont commands contains the items of interest.

For Further Information

  


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