Why does algebraic loop not solve?
Mostrar comentarios más antiguos
I have what I thought was a pretty simple model that intentionally includes algebraic loops which I wanted to use to explore how Simulink deals with circular dependencies. But, Simulink 2011a can't seem to solve it and I'm not sure why or what to do to fix the problem. Here's what the model looks like in Simulink (mdl file link here):

The model is supposed to represent two poles (physical, rigid objects), each of which have one of their ends pinned to the X axis, and their other ends are pinned together. The components to the left of the XY Graph represent the behavior of the left pole. It accepts the X coordinate of its end not pinned to the X axis and computes the Y coordinate of that end based on the X coordinate of the end pinned to the X axis (-3 in this case) and the length of the pole (5 in this case). The components to the right of the XY Graph represent the behavior of the right pole. It accepts the Y coordinate of its non-X-axis end and computes the X coordinate of that end, which is fed back into the input of the left pole. Here's what the situation looks like physically -- black indicates given information and green is what Simulink should compute as the unique solution:

So, I expect the XY Graph to display a point at (0,4) which is time-invariant. Instead, I get this error message:

I'm new to Simulink and don't know how to go about resolving that error. What step size? There seem to be multiple step parameters, but all of them that I see seem to be related to time rather than algebraic loops, and almost all are set at 'auto' -- how can I figure out what a reasonable order of magnitude would be? Likewise, where can I set the error tolerance?
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 8 de En. de 2013
Editada: Azzi Abdelmalek
el 8 de En. de 2013
If you have to simulate this equation:
y(n+1)=y(n)+1
you can't do it just by using one sum block, which causes an algebraic loop, you should use a memory block or unit delay block to do it. Your model don't contain any memory block
9 comentarios
Ben
el 8 de En. de 2013
Azzi Abdelmalek
el 8 de En. de 2013
Editada: Azzi Abdelmalek
el 8 de En. de 2013
The problem is that Simulink don't know how to start simulation, because the output y depends on the input u, which depends on the same output y. The unit delay block contains a initial value, which will be used by simulink to start simulation
Ben
el 8 de En. de 2013
Azzi Abdelmalek
el 8 de En. de 2013
it's not about y=2x+3 it's about y=2y+3
Ben
el 8 de En. de 2013
Azzi Abdelmalek
el 8 de En. de 2013
Try to simulate this model,
- the first one will simulate, but the result have no sens
- the second one make sens

Ben
el 8 de En. de 2013
Azzi Abdelmalek
el 8 de En. de 2013
You are right. I've never noticed that! Then what if the algebraic has multiple solutions, maybe it will cause an error?
Ben
el 8 de En. de 2013
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


