In a futile attempt to save some hand calculation time (and get in much needed practice in system modeler), I decided to modify an already existing model,
“PistenEngine” from the PlanarMechanics example list and simply replicate it one to one in Modelica parts.
I intend to extent my model with other things, however I just wanted to get this working first in what I thought would be mere minutes to be now constantly hit with errors of singularity.
Building “flywheel” as experiment “temporary-experiment” started at 13:35:35
[:0:0-0:0] Error: Model is structurally singular, the following equations do not allow to solve for required variables:
Then there is a massive list of equation errors.
There is something I am fundamentally misunderstanding? If this model is singular, why does planarmechanics have no issues?
When working with the Multi-body libraries you might sometimes create a so called algebraic loop. These have to be broken using Modelica.Mechanics.MultiBody.Joints.RevolutePlanarLoopConstraint. This is a suggested solution using it:
Here are some notes that might help in the future:
Note that I re-arranged the model a bit to make it easier for my-self to see how the model is actually connected. At least for me this makes it a bit easier. (As you can see I have diagonal connection lines, I can accomplish this by first making a connection, then hovering over the green corner points and clicking “-” to remove them)
I.e. I did not connect the entire loop. Instead I added a couple of point masses (btw, in general it is a good idea to have masses in the model to make it numerically easier to handle). That way I can see if I got the coordinates right to begin with:
Thank you very much. This has taken some time for me to get back to…in the end I ended up using the planer mechanics example to get the solution. But I will take this advice to heart. Algebraic loops were a frustrating thing to understand, I appreciate your step by step example!
Thanks for this post! I was experiencing this very problem, but I couldn’t us Planar Mechanics as my application needs a third dimension. I repeated your analysis of substituting balls and then inserting a RevolutePlanarLoopConstraint and I was able to compile. Thanks again!