Repository navigation
Expose states_deriv and fix symplectic integration - #134
Conversation
|
Taking our discussion here: I think adding |
|
I think with this, we are mixing things and making it confusing. I see the following options
I think the cleanest implementation is 3. because nobody expects they can put dynamics directly into the step pipeline without integration. Then, we should add a simple example on how to compute the derivatives via finite differences or directly from the dynamics |
|
1 is not an option IMO. I like 3 more than 2, and think this should be the temporary solution. But it should be combined with 4, so that we have access to the accelerations without finite differences. |
|
I still dont like that 4 is inconsistent. However, we could use the dynamics to compute the exact derivative and store it in the data (plugins). Showing this in an example is enough imo. Let me implement this real quick |
|
How is 4 inconsistent? It is the current snapshot of the full state. We would not use e.g. the average of RK4 in acc, but the last acc estimate. This seems well defined for me. |
|
So you want to call the dynamics to integrate the state -> new state is exact. Then with the new state call the dynamics again to get the exact derivative at that state? Otherwise, the acc would be from the previous state an in the case of RK4 not even point to the current state. |
|
Ah, that's what you mean. I was thinking that we use the latest acc available, but I see that this is slightly inconsistent. We should not call the dynamics multiple times. So unless we want to save the accelerations and step with the pre-computed ones from the last step, which is a big change I would not want to commit to, we either have to accept slight inconsistencies, or use finite differences. I am not particularly happy with either, but less with finite differences. That makes no sense at all. |
|
I believe the solution now implemented (3) is the sweet spot. Dropped Due to a circular input problem with |
amacati
left a comment
There was a problem hiding this comment.
Looks okay except for the example which I believe you wanted to rework anyways before the merge
|
Merged, thanks |
I believe the derivatives were supposed to be exposed, but we forgot this, since integration does everything we want. Exposed them in this PR. While at it, fixed symplectic integration.
Here are some benchmarks
