MATLAB: Is the saturation model of the Three-Phase Transformer (Two Windings) block not converging

algebraicloopSimscape Electricalsimulinktransformer

When using the Three-Phase Transformer (Two Windings) block:
and simulating the saturation (open block and check 'Simulate saturation') , the simulation does not converge and throws an algebraic loop error:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Simulink cannot solve the algebraic loop containing '<model_name>/Three-Phase Transformer (Two Windings)/Model/Discrete1/1-D Lookup Table' at time 0.22034 using the TrustRegion-based algorithm due to one of the following reasons: the model is ill-defined i.e., the system equations do not have a solution; or the nonlinear equation solver failed to converge due to numerical issues.
Why is this and how do I work around it?

Best Answer

This issue is related to the 'Discrete solver model' selected for the saturation model of the transformers. The solver used in your model can be checked by opening the Transformer block> 'Advanced' > see drop down menu for 'Discrete solver model'. There are two options to resolve this:
  • 'Trapezoidal iterative' solver
When using the saturation model of the transformer, the default solver, 'Trapezoidal iterative' solver creates an algebraic loop within the block. The algebraic loop cannot be deterministically solved, therefore the option 'Break Algebraic loop in discrete saturation model' (located right above the drop down menu) must be enabled to successfully compile the model. However, this can lead to less accurate results, such as introducing unwanted numerical oscillations.
  • 'Trapezoidal robust' solver
You also have the option of selecting 'Trapezoidal robust' in the 'Discrete solver model' drop down menu. With this solver, an algebraic loop is not created within the transformer block, therefore the model should successfully compile without having to enableĀ 'Break Algebraic loop in discrete saturation model'. We recommend this solution. Please see the link below for more information on discrete solver options:
https://www.mathworks.com/help/physmod/sps/powersys/ref/threephasetransformertwowindings.html#bra9ddu-3