Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CANNOT SOLVE THE ALGEBRAIC LOOP

1,387 views
Skip to first unread message

Jingbo Han

unread,
Oct 9, 2012, 10:39:09 PM10/9/12
to
Hi everybody,
I'm very new to simulink, have such a problem :

the model is pretty simple:
a sine wave input signal into a summation block then goes into a matlab embd func, the fuc is just like : if u >0.8 y = u;else y = 0. and then the output y is connected to summation block to form a close loop. for some reason I don't know it failed and the error info is below:
Simulink cannot solve the algebraic loop containing 'matlabfuc/MATLAB Function' at time 2.0 using the LineSearch-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.
To rule out solver convergence as the cause of this error, either
a) switch to TrustRegion-based algorithm using
set_param('matlabfuc','AlgebraicLoopSolver','TrustRegion')
b) reducing the VariableStepDiscrete solver RelTol parameter so that the solver takes smaller time steps.
If the error persists in spite of the above changes, then the model is likely ill-defined and requires modification.

I tried the suggestions below , but it didn't work. anybody pls help me.

THANK YOU!

Phil Goddard

unread,
Oct 10, 2012, 12:43:09 AM10/10/12
to
Except in some rare/specific cases you are far better trying to eliminate algebraic loops entirely from your model (instead of trying to make the algebraic loop easier to numerically solve, which is what the suggestions you are receiving are trying to do).

A somewhat detailed description on ways to do this can be found in the doc at
http://www.mathworks.com/help/simulink/ug/simulating-dynamic-systems.html

For the specific case you give (which you hint is actually simpler than your real code), consider the following:
u = sine wave + y
So for the case u > 0.8 you have, if sine wave + y > 0.8 then sine wave + y = y.
The only solution for this is when sine wave = 0.
And for the case u <=0.8 you have, if sine wave + y <= 0.8 then y = 0.

So for the sine wave <= 0.8 there is a solution, but not otherwise.

So, what happens when sine wave > 0.8?
I'm not sure, and I suspect Simulink (quite rightly) is having problems too.

Phil.

Jingbo Han

unread,
Oct 10, 2012, 12:16:08 PM10/10/12
to
Hi Phil,

The document you gave me is very helpful, I think my problem is because of the direct feed through blocks in my loop. I'm actually building a solar tracking system, trying to build up a mat fuc to control the angle of sun panel according to the input of sun's horizontal angle. However, this is something I am confused about the physical system simulation in simulink:
Since in a real physical system, the signal takes time to go through every part of it in order, but if the blocks I use are direct feed through which means no time difference between input and output , and output comes out at the same time with input signal. how could that make sense ? I don't know if I explain my confusion clearly.

Thank you again!

Jingbo
"Jingbo Han" <z161...@students.niu.edu> wrote in message <k52n4d$svs$1...@newscl01ah.mathworks.com>...
0 new messages