{"action":"created","issue":{"url":"https://api.github.com/repos/poliastro/poliastro/issues/265","repository_url":"https://api.github.com/repos/poliastro/poliastro","labels_url":"https://api.github.com/repos/poliastro/poliastro/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/poliastro/poliastro/issues/265/comments","events_url":"https://api.github.com/repos/poliastro/poliastro/issues/265/events","html_url":"https://github.com/poliastro/poliastro/issues/265","id":264974318,"number":265,"title":"Propagating long times does not converge","user":{"login":"Juanlu001","id":316517,"avatar_url":"https://avatars2.githubusercontent.com/u/316517?v=4","gravatar_id":"","url":"https://api.github.com/users/Juanlu001","html_url":"https://github.com/Juanlu001","followers_url":"https://api.github.com/users/Juanlu001/followers","following_url":"https://api.github.com/users/Juanlu001/following{/other_user}","gists_url":"https://api.github.com/users/Juanlu001/gists{/gist_id}","starred_url":"https://api.github.com/users/Juanlu001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juanlu001/subscriptions","organizations_url":"https://api.github.com/users/Juanlu001/orgs","repos_url":"https://api.github.com/users/Juanlu001/repos","events_url":"https://api.github.com/users/Juanlu001/events{/privacy}","received_events_url":"https://api.github.com/users/Juanlu001/received_events","type":"User","site_admin":false},"labels":[{"id":46418226,"url":"https://api.github.com/repos/poliastro/poliastro/labels/bug","name":"bug","color":"fc2929","default":true},{"id":46418228,"url":"https://api.github.com/repos/poliastro/poliastro/labels/enhancement","name":"enhancement","color":"207de5","default":true},{"id":710571731,"url":"https://api.github.com/repos/poliastro/poliastro/labels/research","name":"research","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/poliastro/poliastro/milestones/9","html_url":"https://github.com/poliastro/poliastro/milestone/9","labels_url":"https://api.github.com/repos/poliastro/poliastro/milestones/9/labels","id":2915745,"number":9,"title":"0.9","description":"New solvers in SciPy 1.0, better propagator with better validation, fix all convergence problems, unify 2D and 3D plotting.","creator":{"login":"Juanlu001","id":316517,"avatar_url":"https://avatars2.githubusercontent.com/u/316517?v=4","gravatar_id":"","url":"https://api.github.com/users/Juanlu001","html_url":"https://github.com/Juanlu001","followers_url":"https://api.github.com/users/Juanlu001/followers","following_url":"https://api.github.com/users/Juanlu001/following{/other_user}","gists_url":"https://api.github.com/users/Juanlu001/gists{/gist_id}","starred_url":"https://api.github.com/users/Juanlu001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juanlu001/subscriptions","organizations_url":"https://api.github.com/users/Juanlu001/orgs","repos_url":"https://api.github.com/users/Juanlu001/repos","events_url":"https://api.github.com/users/Juanlu001/events{/privacy}","received_events_url":"https://api.github.com/users/Juanlu001/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":2,"state":"open","created_at":"2017-11-15T23:40:48Z","updated_at":"2018-02-21T17:34:45Z","due_on":"2018-04-20T07:00:00Z","closed_at":null},"comments":4,"created_at":"2017-10-12T14:58:30Z","updated_at":"2018-02-21T22:41:43Z","closed_at":null,"author_association":"OWNER","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n🐞 **Problem**\r\n\r\nPropagating long times fails in different ways:\r\n\r\n```python\r\nIn [5]: iss.propagate(100 * u.year)\r\n---------------------------------------------------------------------------\r\nAssertionError                            Traceback (most recent call last)\r\n<ipython-input-27-503eb53e62e7> in <module>()\r\n----> 1 iss.propagate(100 * u.year)\r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/orbit.py in propagate(self, epoch_or_duration, rtol)\r\n    245             time_of_flight = time.TimeDelta(epoch_or_duration)\r\n    246 \r\n--> 247         return propagate(self, time_of_flight, rtol=rtol)\r\n    248 \r\n    249     def sample(self, *, num_points=None, time_values=None):\r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/propagation.py in propagate(orbit, time_of_flight, method, rtol, **kwargs)\r\n    156                   time_of_flight.to(u.s).value,\r\n    157                   rtol=rtol,\r\n--> 158                   **kwargs)\r\n    159     return orbit.from_vectors(orbit.attractor, r * u.km, v * u.km / u.s, orbit.epoch + time_of_flight)\r\n    160 \r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/propagation.py in kepler(k, r0, v0, tof, rtol, numiter)\r\n    139     f, g, fdot, gdot = _kepler(k, r0, v0, tof, numiter, rtol)\r\n    140 \r\n--> 141     assert np.abs(f * gdot - fdot * g - 1) < 1e-5  # Fixed tolerance\r\n    142 \r\n    143     # Return position and velocity vectors\r\n\r\nAssertionError: \r\n\r\nIn [6]: halleys[0].propagate(73 * u.year)\r\n---------------------------------------------------------------------------\r\nRuntimeError                              Traceback (most recent call last)\r\n<ipython-input-26-9dcacad8e904> in <module>()\r\n----> 1 halleys[0].propagate(73 * u.year)\r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/orbit.py in propagate(self, epoch_or_duration, rtol)\r\n    245             time_of_flight = time.TimeDelta(epoch_or_duration)\r\n    246 \r\n--> 247         return propagate(self, time_of_flight, rtol=rtol)\r\n    248 \r\n    249     def sample(self, *, num_points=None, time_values=None):\r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/propagation.py in propagate(orbit, time_of_flight, method, rtol, **kwargs)\r\n    156                   time_of_flight.to(u.s).value,\r\n    157                   rtol=rtol,\r\n--> 158                   **kwargs)\r\n    159     return orbit.from_vectors(orbit.attractor, r * u.km, v * u.km / u.s, orbit.epoch + time_of_flight)\r\n    160 \r\n\r\n~/Personal/poliastro/poliastro-library/src/poliastro/twobody/propagation.py in kepler(k, r0, v0, tof, rtol, numiter)\r\n    137     \"\"\"\r\n    138     # Compute Lagrange coefficients\r\n--> 139     f, g, fdot, gdot = _kepler(k, r0, v0, tof, numiter, rtol)\r\n    140 \r\n    141     assert np.abs(f * gdot - fdot * g - 1) < 1e-5  # Fixed tolerance\r\n\r\nRuntimeError: Maximum number of iterations reached\r\n```\r\n\r\n🎯 **Goal**\r\n\r\nOne thing is that the long term errors of propagation are big. But nonetheless, the propagator should always give an answer, instead of an internal error (at least for a full period, see the failure of the Halley's comet). I wonder if this is possible at all?\r\n\r\n💡 **Possible solutions**\r\n\r\nThe propagator of poliastro uses the universal variables approach, which is popular but has several limitations. Perhaps for long propagation times it should be replaced with a Newton-Raphson iteration and a good starting point as suggested by http://dx.doi.org/10.1007/s10569-013-9476-9.\r\n\r\n📋  **Steps to solve the problem**\r\n\r\n * Comment below about what you've started working on.\r\n * Add, commit, push your changes\r\n * Submit a pull request and add this in comments - `Addresses #<put issue number here>`\r\n * Ask for a review in comments section of pull request\r\n * Celebrate your contribution to this project 🎉 "},"comment":{"url":"https://api.github.com/repos/poliastro/poliastro/issues/comments/367502333","html_url":"https://github.com/poliastro/poliastro/issues/265#issuecomment-367502333","issue_url":"https://api.github.com/repos/poliastro/poliastro/issues/265","id":367502333,"user":{"login":"nikita-astronaut","id":5345808,"avatar_url":"https://avatars0.githubusercontent.com/u/5345808?v=4","gravatar_id":"","url":"https://api.github.com/users/nikita-astronaut","html_url":"https://github.com/nikita-astronaut","followers_url":"https://api.github.com/users/nikita-astronaut/followers","following_url":"https://api.github.com/users/nikita-astronaut/following{/other_user}","gists_url":"https://api.github.com/users/nikita-astronaut/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-astronaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-astronaut/subscriptions","organizations_url":"https://api.github.com/users/nikita-astronaut/orgs","repos_url":"https://api.github.com/users/nikita-astronaut/repos","events_url":"https://api.github.com/users/nikita-astronaut/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-astronaut/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T22:41:43Z","updated_at":"2018-02-21T22:41:43Z","author_association":"CONTRIBUTOR","body":"Actually, in (4) there is t_p, the time at which the body passes nearest point to attractor. Is there an efficient or already implemented in this package way to find it?"}}
{"actor":{"display_login":"nikita-astronaut"}}