Algebraic loops with model referencing?

8 views (last 30 days)
Jose Martinez
Jose Martinez on 30 Aug 2013
Hi there,
I'm struggling to solve an issue with model referencing in Matlab 2010b and Simulink 7.11.0.584.
My model works perfectly, it can be run and compiled with no problem whatsoever. It is a big model divided in subsystems, all the subsystems work in parallel which means that the outputs of some subsystems are the inputs of other subsystems. I'm trying to use the block "Model Variants" to switch between two different models. This works perfectly when initially I define all my parameters, I can see how the "model variants" block references the model I want. The problem starts when I try to play it. It is giving me LOTS of algebraic loop errors when there is not mathematical algebraic loops per se.
Without the model referencing (this is replacing the "model variants" block with the referenced simulink block, my original model) there is no algebraic loops errors and as I mentioned above it plays just fine, no issues.
Does anyone knows why Matlab/Simulink is giving me these errors?
Thanks in advance
Edit: I have obviously checked "Minimize algebraic loop occurrences" in Configuration Parameters
Edit 2: I solve the problem putting an always-handy delay block after the output. I still don't understand why the algebraic loop errors come up without this new delay block.

Answers (1)

A Jenkins
A Jenkins on 30 Aug 2013
Model Varients are Atomic Subsystems, which means you have to treat them like black boxes. If you have two that feed each other's inputs with their outputs, it doesn't know which one to solve first. If you make them virtual subsystems instead, then it can "see inside" to solve the parts of each one needed to feed the inputs of the others.
There is a long discussion as well as suggested work-arounds in the documentation:

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!