cmm-21 / a5

0 stars 0 forks source link

Stability of Integration Schemes #23

Open robindurkowitzer opened 3 years ago

robindurkowitzer commented 3 years ago

Hello, in task 3 I implemented an Integration Scheme that stabilized the single Spring on a cube, but the 4 Springs 2 cubes is still unstable. Now I am wondering if it is an Error in the Child-Parent spring implementation, or if the integration scheme is not "stable enough" Is there like a range of stability, or is an Integration Scheme that is stable for one configurtation stable for any configuration ? How can we determine if an Integration Scheme is always stable? Is this only possible for Implicit Integration schemes?

robindurkowitzer commented 3 years ago

It was an implementation Error!

Different but related question: Is the Symplectic Euler definition from Assignment 3 x_i+1 = x_i +dtv_i v_i+1 = v_i +dt M^(−1) F(x_i+1) equivalent to the definition in the Lecture, v_i+1 = v_i + dtM^(−1) F(x_i) x_i+1 = x_i + dtv_i+1

Should we be able to prroof this?

eastskykang commented 3 years ago

@robindurkowitzer Please use the one described in 3D Orientations and Rigid Body Dynamics.

Concerning your second question, I will back to you asap, but you don't need a proof for this assignment.

Paravain commented 3 years ago

I think there are some mistakes in the slides in the lecture: The method described in "3D orientations and Rigid Body Dynamics" as Symplectic Euler is actualy the Explicit Euler (it is the same method that is also described as explicit euler in a3 and a5 documentation).

As far as I have an overview of the lecture material, symplectic euler is only ever explained in a3.

eastskykang commented 3 years ago

@Paravain

Screenshot from 2021-05-13 13-22-31

This is not explicit Euler. Please take a look carefully again :) (especially position and orientation update part)

FYI this is from the lecture slide 3D Orientations and Rigid Body Dynamics, slide 51

Paravain commented 3 years ago

Thanks Dongho, i didn't read it carefull enough. I would also be really interessted in the answer to @robindurkowitzer second question. I spent quite some time in trying to calculate the forces also in an inplicit manner (befor realizing I dont have to) and am really curious why it is not necessary.

eastskykang commented 3 years ago

@Paravain @robindurkowitzer

The equation robin wrote

v_i+1 = v_i + dtM^(−1) * F(x_i) x_i+1 = x_i + dtv_i+1

is not implicit integration either. In fact this is implicit integration:

v_i+1 = v_i + dtM^(−1) * F(x_i+1) x_i+1 = x_i + dtv_i+1

If you want to solve this equation, you need to solve a linear system (solving Ax = b for x) which is computationally heavier than explicit and symplectic, and often it's not feasible even. Well, if there's spring forces only, you can find a solution, but anyway, you don't need to do that for this assignment.

eastskykang commented 3 years ago

BTW, indeed, implicit integration would result in more stable simulations, but it also has some caveat: the energy of the whole system will gradually decrease over time. That means, if you start simulation with springs and just leave it for a very long time, the cubes will stop moving at some point.

Plus, implementing collision for implicit Euler integration is not straight forward. I believe Bernhard introduced the simulator we are developing in our group in the lecture where Moritz (@moritzge) devised and implemented a nice model for collision (+ contacts) for implicit integration scheme.

In short, choosing an integration scheme depends on the applications. There's no perfect solution unfortunately. Do you agree on this @liyuesolo?