Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Design Considerations for Continuous-Time Modeling in Stateflow Charts

Rationale for Design Considerations

To maintain the integrity orsmoothness of the results in continuous-time modeling, you must constrain your charts to a restricted subset of Stateflow® chart semantics. By restricting the semantics, the inputs do not depend on unpredictable factors or side effects such as:

  • Simulink® solver's guess for the number of minor intervals in a major time step

  • Number of iterations required to stabilize the integration loop or zero crossings loop

By minimizing side effects, a Stateflow chart can maintain its state at minor time steps and, therefore, update state only during major time steps when mode changes occur. Using this heuristic, a Stateflow chart can always compute outputs based on a constant state for continuous time.

To help you correct semantic violations, a Stateflow chart generates informative errors.

Summary of Rules for Continuous-Time Modeling

Here are the rules for modeling continuous-time Stateflow charts:

 Update local data only in transition, entry, and exit actions

 Do not call Simulink functions in state during actions or transition conditions

 Compute derivatives only in during actions

 Do not read outputs and derivatives in state during actions or transition conditions

 Use discrete variables to govern conditions in during actions

 Do not use input events in continuous-time charts

 Do not use inner transitions

 Limit use of temporal logic

 The chart must have at least one substate

 Do not use change detection operators in continuous charts

 Do not modify any SimState values for continuous-time charts

Related Topics

Was this topic helpful?