Main Content

Discrete Events and Mode Charts

Model discrete changes in system behavior

Physical modeling, in general, involves continuous variables and equations. In some cases, however, you can simplify the mathematical model of the system and improve simulation performance by treating certain changes in system behavior as discrete. To get started, see Discrete Event Modeling.

Mode charts provide an intuitive way to model components characterized by a discrete set of distinct operating modes. Every time you model a component with multiple operating modes and transitions, this component is a good candidate for a mode chart implementation. To get started, see Mode Chart Modeling.

Language Syntax

expand all

eventsModel discrete events
edgeTrigger event
initialeventInitialize event variables
modechartsDeclare mode charts that include operating modes and transitions
modesDeclare operating modes in mode chart
transitionsDefine transitions between modes in mode chart
initialSpecify initial mode in mode chart
entrySpecify actions to be performed upon entering a mode (Since R2020b)


Discrete Variables and Events

  • Discrete Event Modeling
    Simplify mathematical model of the system by assuming that certain variables can change values instantaneously and discontinuously at specific points in time.
  • Triggered Delay Component
    This example shows how to implement a triggered delay component.
  • Enabled Component
    This example shows how to implement a component similar to a Simulink® enabled subsystem.

Mode Charts