Ipuch / bioNC

Natural Coordinates with python for biomechanics
MIT License
11 stars 4 forks source link

Forward dynamics with variational integrator #25

Closed Ipuch closed 1 year ago

Ipuch commented 2 years ago

How to implement this, it looks cool to preserve momentum.

Understood:

Source: https://arxiv.org/pdf/2002.11245.pdf

https://zacmanchester.github.io/docs/Variational_Integrator.pdf

jacobleft commented 2 years ago

I would recommend the modified symplectic integration scheme that I derived in this preprint. It is simple, accurate, and particularly suitable for natural coordinates. I can help with your implementation if you are interested.

Ipuch commented 2 years ago

I’d really appreciate, for now I only built a DAE, but the numerical drift is too large.Do you have a repository, or code where I can find how to implement it ?

jacobleft commented 2 years ago

Constraint drift is eliminated in our proposed integration scheme, because the constraint equations are enforced explicitly by the second line of Eq. (54) in the above-mentioned preprint. All you need to implement is Eq. (54) and (55), then a Newton-Raphson solver would do the rest. You can ignore all accents in those equations, assuming you don't have boundary conditions. Our repo will be public soon.

Ipuch commented 2 years ago

Thanks for the insight, let me know when your public repo is available.

Ipuch commented 1 year ago

done in https://github.com/Ipuch/variational_integrator