To maintain the integrity — or smoothness — 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 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.
A Stateflow chart generates informative errors to help you correct semantic violations.
Here are the rules for modeling continuous-time Stateflow charts: