panosz / ode_integrators

Examples of ode solvers
0 stars 0 forks source link

Sometimes orbits that close are not detected as closed #2

Open panosz opened 4 years ago

panosz commented 4 years ago

code does not track closed orbits correctly, when the periodic variable is outside -pi, pi

panosz commented 4 years ago

Before beginning following the orbit, a Poincare Surface is created on the starting point, oriented perpendicularly to the direction of the orbit. When the orbit crosses the Poincare surface, a comparison between the crossing point and the starting point is made, and if they are adequately close the orbit is deemed closed. If not, we continue following the orbit until we detect another crossing, or until the maximum integration time is exceeded.

The adequately close condition is determined by comparing the distance of the two points with respect to the integration tolerances. The strategy was to accept as closing point any point with distance <= 100 integration_abs_tolerance from the initial point. With this strategy some orbits never closed, as this issue indicates. When the accepting distance was raised to 1000integration_abs_tolerance, the issue disappeared.

Therefore, it seems that the issue arises from the tolerances of an orbit to be considered closed sometimes being too strict. It has nothing to do with the q interval of the initial point. The fact that the issue appeared for test points outside [-pi, pi) is only a coincidence.

See #3