Hi,
I am trying to build a python script to have some bifurcation diagrams for a corticotroph cell model.
I have successfully ran some other models such as HH, Morris Lecar etc. using pydstool. But building this script with PyDsTool, I am having some problems.
I do something wrong in the defining stage of functions and variables for sure since I cannot even start the computation but getting some dictionary and parsing errors.
I am attaching an .ode file where all the equations and parameters are defined and known to be working. (tried in XPPAUT).
I am also attaching the .py file which I wrote to try out if I can get at least the v-t plot. But with no luck...
Any help is muchly appreciated.
Hi, Ahmet. I'll take a look at your code, but in the meantime, you might want to try VFGEN by Weckesser. It's a markup language for differential equations models. What's nice about it is you only need to write up the model once, and then VFGEN can create XPPAUT and PyDSTOOL model files from the template. Pretty nice. I'll report back if I find where your model is having trouble.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, just realized this is not PyCont related, so it's probably best if another member of the team chases after this one. Also just noticed that you are creating things symbolically, which I don't think VFGEN deals with. Anyone else from the PyDSTool team wanna try their hand at this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, just realized this is not PyCont related, so it's probably best if
another member of the team chases after this one. Also just noticed that you
are creating things symbolically, which I don't think VFGEN deals with.
Anyone else from the PyDSTool team wanna try their hand at this?
Hi again Mr. Lamar,
I actually managed to make this python script work using VFGEN. Thanks again for letting me know existence of that software.
But now I am having problem with PyCont.
'Could not find starting point on curve. Stopping continuation.'
How should I determine the right or at least a close point? I made lots of tries with no success.
Hi, Ahmet. The best thing to do would be to use the 'initpoint' argument of your input dictionary and feed in a good initial guess to an equilibrium point. It looks like, based on your output, that you are at a limit cycle and not an equilibrium point. If your system is bistable, you can change initial conditions to see if you can't find an equilibrium point. You might have to change parameters to get this to occur. In any case, once you have computed a solution that settles to an equilibrium point, you can set the following argument before initializing PyCont:
PCargs.initpoint = sol[-1]
where sol is the numerical trajectory computed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mr. Lamar,
I am still trying to get some bifurcation diagrams for this model. So far I couldn't get any. I am thinking maybe my python script have some problems. Is it possible you take a look at the .ode file and generate a working .py file for me ? If you could do this, you would save me lots of time since I am very unexperienced using pydstool.
I am sure we will get a bifurcation diagram taking 'gcalb' as free paramater.
Changing the vaule of 'gcalb' to 6 will give us mix bursting. (You can see this in XPPAUT or in pydstool too).
Thanks in advance.
Hi Mr. Lamar thanks for your reply. Yes, as a starting point I just wanted to try to plot the v-t graph to check functions, paramaters etc. are defined okay. I was going to try PyCont later on. But surely, I will do it.
I will have a look at VFGEN it looks really cool! Thanks for informing that.
I actually have the python script where I tried to create things not symbolically. I am attaching that as well.
Hello all,
I am still having problem regarding the bifurcation diagrams of my model.
I couldn't get any so far. I am thinking maybe my python script have some problems. Is it possible someone take a look at the .py file ? @DrewLamar @RobCrewley
I am sure I will get a bifurcation diagram taking 'gcalb' as free paramater.
Changing the vaule of 'gcalb' to 6 will give us mix bursting. (You can see this in XPPAUT or in pydstool too).
Thanks in advance.
Hi,
I am trying to build a python script to have some bifurcation diagrams for a corticotroph cell model.
I have successfully ran some other models such as HH, Morris Lecar etc. using pydstool. But building this script with PyDsTool, I am having some problems.
I do something wrong in the defining stage of functions and variables for sure since I cannot even start the computation but getting some dictionary and parsing errors.
I am attaching an .ode file where all the equations and parameters are defined and known to be working. (tried in XPPAUT).
I am also attaching the .py file which I wrote to try out if I can get at least the v-t plot. But with no luck...
Any help is muchly appreciated.
Last edit: Ahmet Kurt 2017-05-17
Hi, Ahmet. I'll take a look at your code, but in the meantime, you might want to try VFGEN by Weckesser. It's a markup language for differential equations models. What's nice about it is you only need to write up the model once, and then VFGEN can create XPPAUT and PyDSTOOL model files from the template. Pretty nice. I'll report back if I find where your model is having trouble.
Actually, just realized this is not PyCont related, so it's probably best if another member of the team chases after this one. Also just noticed that you are creating things symbolically, which I don't think VFGEN deals with. Anyone else from the PyDSTool team wanna try their hand at this?
Hi, Ahmet
could you paste the specific error messages you received for your two
approaches to designing your RHS?
On Thu, May 18, 2017 at 9:42 AM, Drew LaMar mdlamar@users.sf.net wrote:
Hi again Mr. Lamar,
I actually managed to make this python script work using VFGEN. Thanks again for letting me know existence of that software.
But now I am having problem with PyCont.
How should I determine the right or at least a close point? I made lots of tries with no success.
Hi, Ahmet. The best thing to do would be to use the 'initpoint' argument of your input dictionary and feed in a good initial guess to an equilibrium point. It looks like, based on your output, that you are at a limit cycle and not an equilibrium point. If your system is bistable, you can change initial conditions to see if you can't find an equilibrium point. You might have to change parameters to get this to occur. In any case, once you have computed a solution that settles to an equilibrium point, you can set the following argument before initializing PyCont:
where
sol
is the numerical trajectory computed.Hi Mr. Lamar,
I am still trying to get some bifurcation diagrams for this model. So far I couldn't get any. I am thinking maybe my python script have some problems. Is it possible you take a look at the .ode file and generate a working .py file for me ? If you could do this, you would save me lots of time since I am very unexperienced using pydstool.
I am sure we will get a bifurcation diagram taking 'gcalb' as free paramater.
Changing the vaule of 'gcalb' to 6 will give us mix bursting. (You can see this in XPPAUT or in pydstool too).
Thanks in advance.
Hi Mr. Lamar thanks for your reply. Yes, as a starting point I just wanted to try to plot the v-t graph to check functions, paramaters etc. are defined okay. I was going to try PyCont later on. But surely, I will do it.
I will have a look at VFGEN it looks really cool! Thanks for informing that.
I actually have the python script where I tried to create things not symbolically. I am attaching that as well.
Yes sure.
For not symbolic:
For symbolic one:
Hello all,
I am still having problem regarding the bifurcation diagrams of my model.
I couldn't get any so far. I am thinking maybe my python script have some problems. Is it possible someone take a look at the .py file ? @DrewLamar @RobCrewley
I am sure I will get a bifurcation diagram taking 'gcalb' as free paramater.
Changing the vaule of 'gcalb' to 6 will give us mix bursting. (You can see this in XPPAUT or in pydstool too).
Thanks in advance.