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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)
sorry I have no experience with XPP so I cannot really help you in
comparing both program.
Does MaxNumPoints give you the same parameter range in both XPPAUTO and
PyCont?
For PyCont, MaxNumPoints does not directly to correspond the range of the
explored parameter. It just mean that PyCont will compute the bifurcation
until either it fails to compute or it reaches this number of points.
You can also try adjusting with the MaxStepSize parameter in order to
enable bigger steps between 2 points.
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)
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
does XPPAUT and PyCont give back the same results.
From what I understood, you limited your analysis to p1 in [0,2000] in both
XPPAUT and Pycont. I'm not sure however if PyCont really stop when p1 >
2000 or if it does not keep on computing until MaxNumPoints is reached.
I remember having such a problem, but it was a while ago.
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
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
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
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
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
Hi,
sorry I have no experience with XPP so I cannot really help you in
comparing both program.
Does MaxNumPoints give you the same parameter range in both XPPAUTO and
PyCont?
For PyCont, MaxNumPoints does not directly to correspond the range of the
explored parameter. It just mean that PyCont will compute the bifurcation
until either it fails to compute or it reaches this number of points.
You can also try adjusting with the MaxStepSize parameter in order to
enable bigger steps between 2 points.
Best,
Florian
2016-01-13 16:12 GMT+01:00 Alexandre Foncelle afoncelle@users.sf.net:
Hello,
does anybody have any idea ?
Thank you for your time !
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.
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
Hello,
Sorry to insist, but does someone has any ideas ?
Thank you in advance,
Alexandre
Hi Alexandre,
does XPPAUT and PyCont give back the same results.
From what I understood, you limited your analysis to p1 in [0,2000] in both
XPPAUT and Pycont. I'm not sure however if PyCont really stop when p1 >
2000 or if it does not keep on computing until MaxNumPoints is reached.
I remember having such a problem, but it was a while ago.
Best,
Florian
2016-01-27 9:28 GMT+01:00 Alexandre Foncelle afoncelle@users.sf.net:
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