Algebraic loop within SimMechanics
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Before I post this, I've been reading thousands of posts about algebraic loop. But I still couldn't get any useful results.
Here is the issue:
I'm trying to represent a snake-shaped worm with several rigid pieces of cylinders. Under visco-elastic environment, The viscous force/external drag on one piece depends on the velocity of the current piece. I implemented this in SimMechanics,and I got a algebraic loop because the input somehow is dependent on the output (or a direct feed-through issue).
Following some advices on Matlab Answers, I've tried to add a unit delay or memory block to break the loop. The loop was broken in that way, however, the result was definitely wrong.
Could someone think about an idea to break the loop and also maintain the correct simulation results?
Let me know if more information is needed.
Best,
Frank
0 comentarios
Respuestas (1)
Sebastian Castro
el 28 de Mayo de 2014
The algebraic loop is created when you measure something in SimMechanics and directly feed it back as an input to the same physical network.
For a simple linear viscous force, I would consider 2 things that would avoid any algebraic loops in your model.
1. If the external drag is fully viscous, is it possible to simply specify a damping coefficient in the "Internal Mechanics" section of the Joint block itself?
2. If you are sending a speed in one location and applying the drag force elsewhere, you're probably using a PS-Simulink Converter, Gain, and Simulink-PS Converter block. Instead of this, you could use a PS Gain block in the Physical Signals Simscape library.
This approach will not give rise to an algebraic loop because you are not converting any values to Simulink signals. In other words, you're keeping this drag relationship as part of the physical network of equations.
The Algebraic Loops section of this documentation page explains this better. Don't worry about the fact that this uses SimMechanics First Generation -- the same principles hold for all Simscape/SimMechanics/etc. products.
2 comentarios
Sebastian Castro
el 28 de Mayo de 2014
If you are changing the gain coefficient, you can try a PS Product block, where one input is the velocity signal and the other input could be a time-varying multiplication factor that comes in as an input from Simulink.
The PS Lookup Table block is also another really useful block that lets you specify a vector of (in this case) damping forces as a function of speed.
Finally: If you want everything to stay in Simscape, you could always check out the Simscape Language to make custom components.
Ver también
Categorías
Más información sobre Physical Units en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!