|ID: Title||cgsl_0205: Signal handling for multirate models|
|Description||For multirate models, handle the change in operation rate in one of two ways:|
|A||At the destination block, Insert a Rate Transition.|
|B||Set the parameter Solver > Automatically handle rate transition for data transfer to either Always or Whenever possible.|
|Rationale||A,B||Following this guideline supports the handling of data operating at different rates.|
Setting the parameter Solver > Automatically handle rate transition for data transfer with the setting to Whenever possible requires inserting a Rate Transition block in locations indicated by Simulink®.
Setting the parameter Solver > Automatically handle rate transition for data transfer to Always allows Simulink to automatically handle rate transitions by inserting a Rate Transition block. The following exceptions apply:
For these cases, manually insert a Rate Transition block or blocks.
MathWorks® does not recommend using Unit Delay and Zero Order Hold blocks for handling rate transitions.
In this example, the Rate Transition block is inserted at the source, not at the destination of the signal. The model fails to update because the two destination blocks (Gain and Sum) run at different rates. To fix this error, insert Rate Transition blocks at the signal destinations and remove Rate Transition blocks from the signal sources. Failure to remove the Rate Transition blocks is a common modeling pattern that might result in errors and inefficient code.
In this example, the rate transition is inserted at the destination of the signal.