[SciPy-Dev] dense output option in integrate.ode

David Mikolas david.mikolas1 at gmail.com
Mon Feb 20 05:20:13 EST 2017


Anne,

Thanks for the info. I don't see anything... [wow, 14 month delay; Dec 2015
to Feb 2017]  in this documentation that explains how to use the dense
output (interpolation coefficients)  for the last step when using vode, as
you've mentioned.

https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.integrate.ode.html#scipy.integrate.ode

I have a few work-arounds available, but I'd really like to try the
following. If I detect a result sufficiently close to a target, I'd like to
call the interpolation from a minimizer to find the moment and location of
closest approach within this step. If it is not close enough, I'd then like
to take the next step and test again.

ultimately this may not be the best way to do this, but I'd like to try
this none-the-less.

How can I do this with vode - as you described in December 2015? Is there a
tutorial or example of something like this being done within Python 2.7 /
SciPy?

Thanks!
David



On Fri, Dec 4, 2015 at 9:47 PM, Anne Archibald <archibald at astron.nl> wrote:

> Dense output is actually already available from some of the integrators -
> I believe vode in particular. It is limited to evaluation within the last
> step, so the most reliable way to use it is to allow the adaptive stepper
> to take a single step then evaluate within it.
>
> For many purposes, for example stopping criteria, evaluation within the
> last step is cheap and sufficient, and many solver implementations provide
> an interface for it. But it would occasionally be useful to have a solution
> object that can be evaluated anywhere - preferably including one or more
> derivatives.
>
> Anne
>
> On Mon, Nov 23, 2015, 12:43 David Mikolas <david.mikolas1 at gmail.com>
> wrote:
>
>> OK, Jim Martin has started this and I'm trying to add momentum and any
>> help that I can. I'm already using this feature (access to interpolation
>> coefficients) by installing an environment with his changes, so I can run
>> the integration flat out, yet get results at arbitrary density with nearly
>> the same precision.
>>
>> I'm new to SciPy-dev and mail lists in general, appreciate any/all
>> suggestions. Thanks!
>>
>> David
>>
>> On Mon, Nov 23, 2015 at 4:28 PM, Evgeni Burovski <
>> evgeny.burovskiy at gmail.com> wrote:
>>
>>> Hi David,
>>>
>>> This sounds like a useful feature.
>>> I guess a pull request would be welcome. (even though I'm not a user,
>>> and I won't be able to review it).
>>>
>>> Evgeni
>>> 23.11.2015 10:47 пользователь "David Mikolas" <david.mikolas1 at gmail.com>
>>> написал:
>>>
>>> One way that dense output for dopri5 and dop853 can be very useful is if
>>>> the integration is expensive/long and you don't want to repeat it, but you
>>>> want to obtain results at new time points at a later date, or even iterate
>>>> on it - for example, find the time of closest approac. This is done by
>>>> saving the interpolation coefficients. I put a simple example here, though
>>>> there is no saving to disk yet.
>>>>
>>>>     http://pastebin.com/e6qNjbL9   dendop_test_v00.py
>>>>
>>>> I wonder if this could be developed into an option to return an
>>>> interpolator object or function. If I can help let me know.
>>>>
>>>> On Sat, Nov 14, 2015 at 12:19 AM, Evgeni Burovski <
>>>> evgeny.burovskiy at gmail.com> wrote:
>>>>
>>>>> Hi David, Hi Jim,
>>>>>
>>>>> > I am new to SciPy-dev. Will the dense output option in
>>>>> scipy.integrate.ode
>>>>> > become available in 0.17.0? This is a feature already available in
>>>>> the
>>>>> > original FORTAN, but wasn't implemented in the wrapper.
>>>>>
>>>>> If the feature is sent as a pull request against the scipy master
>>>>> branch, the PR is reviewed by the maintainers of the integrate package
>>>>> and merged into master before the release split, then yes, it would be
>>>>> available in 0.17.0.
>>>>>
>>>>> So far I do not see any progress towards it.
>>>>>
>>>>>
>>>>> > I wrote these dense output extensions that you listed:
>>>>> >
>>>>> > https://github.com/jddmartin/scipy/tree/dense_output_from_
>>>>> dopri5_and_dop853
>>>>> > https://github.com/jddmartin/dense_output_example_usage
>>>>> >
>>>>> > but I didn't issue any pull request to scipy.  I sent this message
>>>>> to the
>>>>> > scipy developers list:
>>>>> >   http://article.gmane.org/gmane.comp.python.scientific.devel/19635/
>>>>> > explaining the changes.  I was hoping for some feedback before
>>>>> issuing a
>>>>> > pull request.
>>>>>
>>>>> Ah, I see that the email likely fell through the cracks back in April.
>>>>> Sorry about that.
>>>>> You might want to ping that email thread once more or send a pull
>>>>> request on github (or both).
>>>>>
>>>>> <snip>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Evgeni
>>>>> _______________________________________________
>>>>> SciPy-Dev mailing list
>>>>> SciPy-Dev at scipy.org
>>>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SciPy-Dev mailing list
>>>> SciPy-Dev at scipy.org
>>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>>
>>>>
>>> _______________________________________________
>>> SciPy-Dev mailing list
>>> SciPy-Dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>
>>>
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20170220/e142cb6f/attachment.html>


More information about the SciPy-Dev mailing list