Strangely, activating the engine_options['contacts']['model'] = "constraint" option leads to non-consistent integration result for some systems - where the velocity is not the integral of the acceleration!
This happens for instance in the following example script, which simulates a double pendulum (servoed to be horizontal) with backlash. Backlash is needed to actually create a constraint (the pendulum, being horizontal, rests on the backlash bounds). The system has fixed base, and is thus basically a simple chain of 4 pivot joints, 2 with motors, 2 unactuated (backlash).
When simulating with constraint option, one obtains the following plot showing acceleration (top) and velocity (bottom)
We can see that though the velocity is zero, the acceleration is not - and that remains true forever, which is clearly inconsistent.
Here are some further comments:
this was observed on 1.8.4, but I believe this was already present in 1.7.13 (though it's not easy to confirm because the API has significantly changed)
the phenomenon disappears when switching to spring_damper (you'll need to adjust the controller frequency if you don't want vibrations - then you can get line, asymptotic convergence of both velocity and acceleration to zero)
the phenomenon is somehow linked to the system mass: I increased them to make the phenomenon more visible. Lowering them leads to a smaller, but still present, error.
lowering engine_options["stepper"]["tolRel"], engine_options["stepper"]["tolAbs"] by one order of magnitude does not change at all the value to which this converges.
Strangely, activating the
engine_options['contacts']['model'] = "constraint"
option leads to non-consistent integration result for some systems - where the velocity is not the integral of the acceleration!This happens for instance in the following example script, which simulates a double pendulum (servoed to be horizontal) with backlash. Backlash is needed to actually create a constraint (the pendulum, being horizontal, rests on the backlash bounds). The system has fixed base, and is thus basically a simple chain of 4 pivot joints, 2 with motors, 2 unactuated (backlash).
When simulating with
constraint
option, one obtains the following plot showing acceleration (top) and velocity (bottom)We can see that though the velocity is zero, the acceleration is not - and that remains true forever, which is clearly inconsistent. Here are some further comments:
spring_damper
(you'll need to adjust the controller frequency if you don't want vibrations - then you can get line, asymptotic convergence of both velocity and acceleration to zero)lowering
engine_options["stepper"]["tolRel"], engine_options["stepper"]["tolAbs"]
by one order of magnitude does not change at all the value to which this converges.Script to reproduce the issue: double_pendulum.zip