About the stability of undamped systems #343
Replies: 3 comments 6 replies
-
Hi @SimiPixel thanks for taking a look at brax! Semi-implicit Euler does not guarantee stability, it's just "more" stable. The dt should be sufficiently small s.t. the integration does not become unstable. mujoco has several other integrators implemented that you can take a look at if you're interested https://mujoco.readthedocs.io/en/stable/computation.html#numerical-integration A vispy renderer would be awesome, the viz looks pretty cool! |
Beta Was this translation helpful? Give feedback.
-
+1 we would be very happy to review a vispy renderer PR! |
Beta Was this translation helpful? Give feedback.
-
All right then i will close this and create a new discussion to talk about a vispy renderer. One final thought: You currently do not define some abstract interface what a renderer backend would have to implement? |
Beta Was this translation helpful? Give feedback.
-
Dear Brax authors,
thanks for open-sourcing this code, it's quite illuminating.
For mostly self-educational purposes i have built my own simulator / engine, but whilst i do use different conventions the underlying concepts and math is similar or identical.
Currently, i have hit the following stability problem where i forward simulate a double pendulum with no damping (i.e. perfect hinge joints). There exists gravity and so initially there is a certain amount of potential energy in the system. However, when the simulation time step is too long, the simulation becomes unstable and energy clearly increases. Decreasing the simulation time step makes the simulation stable again.
Animation 1: dt = 0.01. At a certain breakpoint the simulation becomes unstable.
Animation 2: dt = 0.001. The simulation stays stable for the entire time duration. Note that the trajectory in both animations is identical only during the first few seconds.
First: What surprised me immediately was that, whilst the trajectories may differ, i thought that using an semi-implicit euler scheme would guarantee that energy does not increase over time. Clearly i was wrong..
Second: I checked out your source and how you forward integrate. I tried both versions of exactly and approximately inverting the mass matrix, and both yielded very similar stability properties. However, i also can not "implicitly integrate the DOF damping" as my DOFs do not have any damping to them.
My question would then be as follows:
Thanks for your time, and for reading this.
PS: I created the animations using
vispy
. I would probably be able to write myvispy_render.py
module interface general enough such that it can also be used easily bybrax
. However, i would only do this if there is interest. :)Beta Was this translation helpful? Give feedback.
All reactions