Simulation output differs when optional modules are enabled

1 vue (au cours des 30 derniers jours)
Thomas
Thomas le 26 Nov 2024
I am running a closed-loop Simulink model with several modules that can be activated or deactivated for a particular run. These modules do not participate in the loop as they only receive data from the simulation and do not pass it back into the simulation. However, I am observing that the model output differs slightly depending on whether these modules are activated or deactivated. This occurs even if the modules are never called during the simulation run (by having their sample time set to a value higher than the simulation end time).
Is this a known behavior when using Simulink?
  1 commentaire
Paul
Paul le 26 Nov 2024
Can you be more specific about how exactly these modules (are these really blocks?) are activated or deactivated for a particular run?
If these blocks receive data and do any operations, including data logging, they can influence the step size of the solver if using a variable step solver.
What does "do not pass it back to the simulation" mean? The blocks are part of the simulation. Maybe that means the blocks don't pass data back into the loop?
If the block sample time is set to a large number (w/o a sample time offset) I'm pretty sure the block will still execute at t = 0, though I'm not sure if/how that can affect the subsequent time steps.

Connectez-vous pour commenter.

Réponses (1)

Githin George
Githin George le 2 Déc 2024
Hi Thomas,
As mentioned by Paul, there could be various reasons for the difference in simulation outputs, such as the block executing at t=0. Additionally, Variable-Step Solvers may calculate block outputs at minor time steps along with major time steps to increase accuracy. The following blog posted in the MathWorks Community provides an overview of how minor time steps aid in the simulation of a model (Note that it is old blog, but the information presented is still relevant).
You can also look at the following documentation to understand the behind-the-scenes process of simulation:
I suspect that these factors could be affecting your simulation results. Moreover, you may want to observe the outputs in your "SimulationOutput" object to compare the timestamp data and output signal values to further debug your model.
In case this information doesn't help, please elaborate on the "modules" mentioned in the question so that I can take a closer look.

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by