Replies: 2 comments 1 reply
|
It'll depend a bit on what version you're running. v1.2.x fixed this, but the releases were broken so you might be on something older. Let me know. It'd help if you could attach a minimal example that shows the problem and I can test. I'd urge you to upgrade to 1.3.0 just released. Thanks for your interest. |
0 replies
|
did that sort your problem? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm running into a "Cycle found" error at compile() time on a diagram that shouldn't contain a real algebraic loop, and I'd like to check whether this is expected behaviour or a known limitation.
Setup: A SUBSYSTEM containing a chain of blocks with two INTEGRATORs (e.g. a simple double-integrator plant: force → acceleration (algebraic) → integrate → velocity → integrate → position), whose OUTPORT exposes both the algebraic signal (acceleration) and the purely-integrated signals (velocity, position). Outside the subsystem, the position output feeds back into an algebraic function (e.g. a gravity model) whose output eventually feeds back into the subsystem's force input — the classic "state feedback through an algebraic nonlinearity" pattern.
Physically/mathematically there's no algebraic loop here, since the feedback path passes through two integrators (states), exactly the kind of loop Simulink resolves without any issue since integrators have no direct feedthrough.
However, bd.compile() raises a RuntimeError: could not compile system with a "Cycle found" trace that goes through the subsystem's INPORT/OUTPORT blocks, even though the actual signal that closes the loop (position) only depends on an INTEGRATOR's state, not on the algebraic (acceleration) branch.
I found a workaround: excluding the algebraic (feedthrough) output from the subsystem's OUTPORT and recomputing it separately outside the subsystem avoids the false positive, which supports the idea that this is a false detection rather than a genuine algebraic loop.
Question: Is this a known limitation of the current algebraic-loop detection, and if so, is a fix/patch planned? Happy to share a minimal reproducible script if useful.
Thanks for the great library!
All reactions