Apply output smoothing when connecting variable-step network to fixed-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.
When variable-step network (Network 1) has high-frequency activity above what the fixed-step network (Network 2) can sample, applying smoothing to the output of Network 1 can sometimes be advantageous because it helps you avoid picking a local peak or trough of the Network 1 activity. The Smoothing (continuous->discrete) block uses a first-order filter to remove unwanted high-frequency information from the Network 1 output before providing the value to Network 2. The block implementation is a masked subsystem.
u — Signal with high-frequency activity
Connect this port to the variable-step network, Network 1, to capture its output.
y — Smoothed signal for the fixed-step network
Connect this port to the input of the fixed-step network, Network 2.
Smoothing time constant (s) — Specify time constant for the first-order filter
0.001 (default) | positive scalar
Specify the time constant for the first-order filter, in seconds. Typically, the smoothing time constant is at least 10 times larger than the step size of the fixed-step network, Network 2.
Initial output — Specify initial output value
0 (default) | scalar
Specify initial output value for the variable-step network, Network 1.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2022a