{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/6326","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/6326/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/6326/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/6326/events","html_url":"https://github.com/scipy/scipy/pull/6326","id":162701941,"number":6326,"title":"[WIP] ENH: New ODE solvers","user":{"login":"nmayorov","id":7074023,"avatar_url":"https://avatars.githubusercontent.com/u/7074023?v=3","gravatar_id":"","url":"https://api.github.com/users/nmayorov","html_url":"https://github.com/nmayorov","followers_url":"https://api.github.com/users/nmayorov/followers","following_url":"https://api.github.com/users/nmayorov/following{/other_user}","gists_url":"https://api.github.com/users/nmayorov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmayorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmayorov/subscriptions","organizations_url":"https://api.github.com/users/nmayorov/orgs","repos_url":"https://api.github.com/users/nmayorov/repos","events_url":"https://api.github.com/users/nmayorov/events{/privacy}","received_events_url":"https://api.github.com/users/nmayorov/received_events","type":"User","site_admin":false},"labels":[{"id":37340735,"url":"https://api.github.com/repos/scipy/scipy/labels/enhancement","name":"enhancement","color":"bfe5bf","default":true},{"id":199201380,"url":"https://api.github.com/repos/scipy/scipy/labels/needs-decision","name":"needs-decision","color":"fbca04","default":false},{"id":37342805,"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.integrate","name":"scipy.integrate","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":104,"created_at":"2016-06-28T14:36:26Z","updated_at":"2016-11-17T13:37:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/6326","html_url":"https://github.com/scipy/scipy/pull/6326","diff_url":"https://github.com/scipy/scipy/pull/6326.diff","patch_url":"https://github.com/scipy/scipy/pull/6326.patch"},"body":"Hi!\r\n\r\nFirst some considerations about the current `ode` class.\r\n1. It allows to use several good quality solvers.\r\n2. It feels like a giant black box, the usability and docs are not the best. It's hard to understand if you get your setup right or not, seeing output from fortran code is awkward, etc.\r\n3. It's not clear how to efficiently compute the solution at many points (\"dense output\"). For Runge-Kutta methods (dopri5 and dop853) just calling `integrate` by small steps would be very wrong, but that's what a user would probably do (a \"proper\" way is discussed [here](http://stackoverflow.com/questions/12926393/using-adaptive-step-sizes-with-scipy-integrate-ode)) . For other solvers the situation should be better, but still it is not efficient to make small steps (but this is limitation of solvers and not on scipy side).\r\n4. No continuous solution output, i.e. which can be evaluated at any point with the same accuracy as the values computed at discrete points.\r\n5. No event detection capabilities.\r\n\r\nSo I want to provide a new monolithic implementation, which is easy to understand and use and also provides missing features 4 and 5. Yes, it will be in Python and not as fast. But the same situation is in MATLAB and people are totally fine with it, as the solvers are well designed and easy to use. In fact I was largely motivated by MATLAB suite. I realize that this is not a super clear situation, and there are pros and cons. But comparing the current state of scipy and MATLAB in ODE integration, I come to conclusion that scipy could do better.\r\n\r\nCurrently I only implemented two explicit Runge-Kutta methods (admittedly the easiest methods, but no doubt useful). And getting right implicit solvers for stiff problems will be a challenge.\r\n\r\nI prepared an example with two main features, continuous output and event detection: http://nbviewer.jupyter.org/gist/nmayorov/ca99381bb20a87762758f7dad4fc2220\r\n\r\nThe code is in preliminary stage. The current TODO list:\r\n- [x] Implement at least one implicit method for stiff problems.\r\n- [x] Refine API: add necessary parameters, rename current parameters, etc.\r\n- [ ] Develop a benchmark suite and assess quality of the algorithms.\r\n\r\nAny feedback and suggestions are very welcome. A concrete technical question: which implicit method you believe would be the most useful (if implement only one)? The BDF (and its modifications) seems to be the most widely used, so I want to start looking into it.\r\n"},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/261248145","html_url":"https://github.com/scipy/scipy/pull/6326#issuecomment-261248145","issue_url":"https://api.github.com/repos/scipy/scipy/issues/6326","id":261248145,"user":{"login":"pv","id":35046,"avatar_url":"https://avatars.githubusercontent.com/u/35046?v=3","gravatar_id":"","url":"https://api.github.com/users/pv","html_url":"https://github.com/pv","followers_url":"https://api.github.com/users/pv/followers","following_url":"https://api.github.com/users/pv/following{/other_user}","gists_url":"https://api.github.com/users/pv/gists{/gist_id}","starred_url":"https://api.github.com/users/pv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pv/subscriptions","organizations_url":"https://api.github.com/users/pv/orgs","repos_url":"https://api.github.com/users/pv/repos","events_url":"https://api.github.com/users/pv/events{/privacy}","received_events_url":"https://api.github.com/users/pv/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T13:37:58Z","updated_at":"2016-11-17T13:37:58Z","body":"@nmayorov: the ctypes recipe gives same evaluation speed as writing in \nC/fortran. The difference between that and statically typed cython \nfunction should be ~ Python call overhead (probably ~ microseconds per \ncall).\n.\nIt's likely the solver overhead per evaluation is large compared to \nPython call overhead.\n"}}
{"actor":{"display_login":"pv"}}