Menu

From XPPAUTO to PyCont

Help
2016-01-12
2016-02-26
  • Alexandre Foncelle

    Hi everyone,

    I had some trouble when going through the PyCont documentation, and wondered if anyone could help me out.

    I have a system of ODE and I want to find the bifurcations points.

    When I’m working on XPPAUTO, it’s quite easy and really fast. Correct me if I’m wrong, but on PyDSTool and PyCont it shouldn’t take more time if I correctly put the same parameters to do bifurcation ? If so here are my questions :

    1) Is there a function equivalent to Sing pts -> Equilibria (S)(G) in PyDSTool ?
    2) What is the list of parameters in PyCont to get the exact same results as AUTO (in the same amount of time)

    I’m sorry if the answers are obvious in the documentation or examples but I couldn’t find them,

    Thank you for your time,

    Alexandre

     
  • Greg

    Greg - 2016-01-12

    Hi Alexandre.

    right now, there are afaik no concise macros for doing easily the things you ask for. I am working right now on such high-level functions. But for now, look at the PyCont_* bifurcation examples provided, and just copy these code blocks and start to work your way through. I agree, the documentation alone makes it very hard to understand!

    Best,
    Gregor

     
  • Alexandre Foncelle

    Hello Gregor,

    Thank you so much for your fast answer !

    I just want to be sure I clearly understand what I can do for now ; does PyCont is as fast as AUTO to find bifurcations for the same ODE system ?
    I’m asking because, right now, in my PyDSTool code, when I launch PyCont it takes so much time compare to AUTO even if it finds the same special points.
    I was wondering if it was about other parameters that I don’t know. For now, I think I’m using the same as in AUTO (see files attached).

    Thank you again!

    Alexandre

     
  • Florian Aspart

    Florian Aspart - 2016-01-13

    Hi Alexanre,

    I haven't used PyDSTool for over a year, but unless significant changes happened in the last versions, my answer should still be valid.

    PyDSTool uses Generators to solve numerically your ODE system (for both time integration and continuation). By default a pure Python generator is used. But you can use a generator implemented in C++, which would definitely fasten the time integration and continuation in PyDSTool.

    For the continuation, the equilibrium point curve (EP-C) are implemented in Python and use the Generator you defined to solve your ODE system numerically. If you use a Generator implemented in C++, the EP-C should be generated fast enough.
    For other more complicated curves ( such as the limit cycle curves), PyCont uses AUTO. Specifically, it give AUTO a callback function corresponding to your Generator so that AUTO can solve your system numerically. In this case, the generator has to be a C++ one.

    As a conclusion, PyCont would probably be slower than AUTO in all use cases. However, it should be fast enough if you use a C++ generator and the big asset of PyCont is that it is implemented in Python and is therefore easy to integrate in your workflow.

    Best,
    Florian

     
  • Alexandre Foncelle

    Hello Florian,

    Thank you for you answer, really clear ! I did compared XPPAUTO and PyCont with the simple example ABReaction provided in PyCont example (you can find files attached)

    I certainly miss something important, probably a parameter in PyCont, because if I increase the MaxNumPoints it takes a lot more time to compute than XPP (e.g. MaxNumPoints = 2000 ->
    (XPPAUTO, < 1 sec)
    (PyCont, 30 sec)

    Do you see something obvious ?

    Thank you in advance,

    Alexandre

     
  • Alexandre Foncelle

    Hello,

    does anybody have any idea ?

    Thank you for your time !

     
  • Rob Clewley

    Rob Clewley - 2016-01-18

    Hi Alexandre,

    You're not comparing apples with apples, here. The PyCont example is using PyDSTool's Vode for the dynamical system model. Vode is a PyDSTool wrapper around the scipy wrapper of the original cvode. If at all possible, you should be using Dopri or Radau instead (C-level integrators). With Radau in this script, each part of the analysis takes less than a second on my laptop. Once you have Radau working, we can look more closely at the other parameter settings if you still find it runs too slow for you.

     
  • Alexandre Foncelle

    Hello Rob,

    Thank you for your answer.

    I didn't mention it, and I'm sorry for that but I had changed a bit the PyCont_ABReaction.py and I replace Vode with Radau, but maybe I didn't make it properly.
    Furthermore, as you said, with Radau in this script, it takes less than a second, but when I increase MaxNumPoints to 2000 in both XPPAUTO and PyCont_ABReaction.py, only PyCont_ABReaction.py becomes really slower.
    That's why I was wondering where I went wrong.

    Alexandre

     
  • Alexandre Foncelle

    Hello,

    Sorry to insist, but does someone has any ideas ?

    Thank you in advance,

    Alexandre

     
  • Alexandre Foncelle

    Hello Florian,

    Thank you for your response !

    What I did :
    -I first tried without p1 pdomain bounded to 2000
    -I tried with p1 pdomain bounded to 2000

    But in both cases PCargs.MaxNumPoints = 56

    Maybe I misunderstood what you were saying, nevertheless thank you again for your concern !

    Alexandre

     

Log in to post a comment.