Prevent accuracy loss when connecting fixed-step network to variable-step network
Simscape / Utilities / Network Couplers / Fundamental Components
Prediction and smoothing algorithms are built into the Network Coupler blocks, and you can enable them by using the check boxes in the block dialogs. The prediction and smoothing blocks in the Fundamental Components sublibrary are provided for your reference only.
Connecting a variable-step network (Network 1) to a fixed-step network (Network 2) may result in accuracy loss in the Network 1 simulation when its sample times are between the sample times of Network 2. The Prediction (discrete->continuous) block helps prevent the accuracy loss. It predicts the output of Network 2 between its sample times by using the last computed derivative of the output of Network 2 and provides the inter-sample prediction to Network 1. The block implementation is a masked subsystem.
u — Signal with fixed-step sampling
Connect this port to the fixed-step network, Network 2, to capture its output.
y — Prediction for the variable-step network
Connect this port to the input of the variable-step network, Network 1.
Port u discrete sample time (s) — Specify sample time for the fixed-step network
-1 (default) | positive scalar
Specify sample time for the fixed-step network, Network 2, in seconds.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2022a