AmesimKnowledge

Community Knowledge > Modeling Pitfalls

Algebraic Loops and Causality Errors: Community Troubleshooting Notes

Algebraic loops (also surfaced to users as "implicit variables") are one of the most common practical stumbling blocks reported by Amesim users outside the official documentation — especially in electrical circuit models, where causality is easy to get wrong when connecting sources, switches, and passive elements.

What causes an algebraic loop

An algebraic loop appears when the solver cannot find any valid calculation order for a set of connected submodels — i.e., every candidate ordering has at least one submodel whose input depends on an output that isn't known yet at the time it needs to be evaluated. Amesim's solver responds by introducing implicit variables to solve the loop simultaneously rather than sequentially.

Why it matters beyond "does it run"

Based on discussion aggregated from Siemens community threads and the Simcenter blog on real-time modeling:

  • With no implicit state variables in a loop region, the solver may be forced into small, bounded time steps (one description cites a cap near 0.1 s) because there's no local state to absorb the discontinuity/interaction.
  • With implicit state variables present, the solver may pass through some discontinuities without them affecting the state — meaning the solver can silently "miss" certain fast transients. This is a correctness trade-off engineers should be aware of, not just a performance one.

The standard fix

The consistently recommended fix across sources: insert a small time constant into the loop. Concretely this means adding one of:

  • A small inertia (mechanical)
  • A first-order lag filter (signal/control)
  • A small inductor (electrical)

This breaks the instantaneous algebraic dependency by giving the loop a state variable to integrate against, converting an algebraic-loop solve into an ODE integration step. The alternative fix — removing the calculation that creates the loop — is only viable when that calculation isn't actually needed for the study.

Practical note for electrical models specifically

Electrical circuit topologies (especially with switches, ideal voltage/current sources, and multiple parallel paths) are a common source of algebraic loops in Amesim because ideal sources have zero internal impedance/time-constant by construction. Community discussion threads on this topic (e.g., "Algebraic loops in Amesim (electrics)" on the Siemens community) confirm this is a recurring category of question, though the detailed thread content itself was not retrievable in this pass — practitioners hitting this error should search the Siemens community directly for circuit-specific variants, as the underlying fix (add a small series resistance/inductance to break the ideal-source loop) follows the same general pattern described above.

Source: Make your Simcenter Amesim model real-time compatible – Simcenter blog

Source: https://community.sw.siemens.com/s/question/0D54O000061xmLFSAY/algebraic-loops-in-amesim-electrics · retrieved 2026-07-08