Algebraic loops within Simcenter Amesim > How can I avoid/break algebraic loops?
At component level
Avoid basic variables on outputs
Most of the time, algebraic loops result from ports with insufficient information on the relationship between inputs and outputs. They are mainly caused by the presence of basic variables as outputs, as the main assumption with this kind of variable is that its computations require all inputs of the submodel to be known first.
In Submodel Editor, some types of variables have been introduced to explicitly add information on the relationship between computed variables and inputs, called one-line or multi-line macros. These variables bring additional information, specifying the relationship between inputs and outputs and thus defining the information flow through a given submodel in a finer way.
This is illustrated in the following very simple system.
Figure 68: A simple algebraic loop example
An algebraic loop has been created as there is a direct feed-though effect through the f(x,y) component. When the function f(x,y) only depends on the y value, this type of algebraic loop is theoretically avoided but still handled by Simcenter Amesim (model compiling is processed before f(x,y) parameterization). In this case it might be relevant to change the f(x,y) model to a block expressing a dependency of its unique output only on the y argument.
Introduce state/discrete variables
State and discrete variables are both types of variable that are computed by the Simcenter Amesim solver. Replacing a basic variable by this type of variable in some submodels might help lowering the number of generated algebraic loops, as this kind of variable, being provided by the Simcenter Amesim simulator, does not participate in information workflow through ports.
Note
Introducing state variables might on the other hand lead to a bigger system size and thus bigger computational efforts.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Performance_Analyzer/xid1017754 · retrieved 2026-07-17