The Algebraic Constraint block works in my continuous model but not in my discrete, why?

3 views (last 30 days)
I have a Simulink model that uses a Algebraic Constraint block to calculate an important parameter for the rest of the model. I first built the model with continuous blocks and now I want to build the same model but with discrete blocks. It works perfect with continuous blocks but when I use the discrete model the block Algebraic Constraint does not work at all. The fault message I receive is:
Algebraic state in algebraic loop containing 'model/Subsystem Pump, variable parameters/Subsystem Flow, q2/Subsystem/Algebraic Constraint/Sum' computed at time 0.0013000000000000002 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
I have tried reducing the step size to ridiculously low values and nothing happens. My question is how can I solve this problem? And why does it work in the continuous model but not the discrete?

Answers (1)

Drew Davis
Drew Davis on 24 Jun 2015
When using the algebraic constraint block you are introducing an algebraic loop into your model. The Simulink algebraic loop solver has some limitations specifically the solver cannot solve loops that has blocks with discrete valued outputs. See the documentation for more info on algebraic loops.

Community Treasure Hunt

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

Start Hunting!