Closed jcarpent closed 4 years ago
Interesting, I didn't know this semi-implicit scheme was second order. If you have a reference at hand that explains why I'd love to take a look. Otherwise I'm gonna look for one by myself.
I was incorrect when saying second-order, but this method is much more stable in the sense that it preserves the mechanical energy of the system. See https://en.wikipedia.org/wiki/Semi-implicit_Euler_method for more details. Euler explicit has very bad behavior with this aspect.
Hello @jcarpent I've implemented semi-implicit Euler and tested it on the quadruped jumping motion. Surprisingly it doesn't do better than explicit Euler. Here the mean infinity norm of the local integration error:
Semi-implicit Euler performs a bit better than explicit Euler for dt=10 ms, but in all other cases it does a bit worse than explicit Euler, and for one case the error goes out of the chart. For small time steps (<=0.3 ms), the error seems to be basically the same as for explicit Euler.
Given these results, it doesn't seem worth it to use semi-implicit Euler, so I am going to close this issue for now.
These lines of code perform a classic first-order Euler integration step
https://github.com/andreadelprete/consim/blob/c1d6b07ca4a7ae8ef64e70531ac32addd6fd8f4c/src/simulator.cpp#L237-L240
I was wondering why to not use a more stable approach based on Euler semi-implicit, namely:
This would lead to a second-order accuracy.