andreadelprete / consim

GNU General Public License v3.0
14 stars 1 forks source link

Quadruped Squat Results #31

Closed andreadelprete closed 3 years ago

andreadelprete commented 4 years ago

In the last week I've optimized a bit the c++ code, and here I report the results I got for the quadruped squatting task. I've decided to start with this task because here the number of contacts is constant throughout the simulation, so we don't have to worry about memory allocation that is needed when resizing.

Besides testing the standard Exponential and Euler integrators, now I am also testing different versions of Exponential in which I bound the number of matrix multiplications to be used for computing the matrix exponential. Moreover, now I am plotting the integration error VS the computation time (per time step, which is 10 ms in this test) rather than VS ndt.

local_err_vs_comp_time

The best method for a given accuracy (y axis) is the one corresponding to the smallest computation time (x axis). We can see that Euler is never the best, it just gets almost as good as Exponential for integration error = 2e-4. Comparing the different versions of Exponential, the one performing the default number of matrix multiplications ("mmm-1" in the legend) is constantly outperformed by the other versions. The best versions are the ones using 0, 2, or 3 matrix multiplications, depending on the time step used. In general, for smaller time steps (hence smaller integration errors) it is preferable to use less matrix multiplications. Automatically finding the optimal number of matrix multiplications does not seem easy, but even if we simply fix it to 3, we would still outperform the default method for any time step.