Menu

corticotroph cell model

Help
Ahmet Kurt
2017-05-17
2017-05-17
  • Ahmet Kurt

    Ahmet Kurt - 2017-05-17

    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
  • Drew LaMar

    Drew LaMar - 2017-05-18

    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.

     
  • Drew LaMar

    Drew LaMar - 2017-05-18

    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?

     
    • Rob Clewley

      Rob Clewley - 2017-05-18

      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:

      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?


      corticotroph cell model


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/pydstool/discussion/472291/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
    • Ahmet Kurt

      Ahmet Kurt - 2017-05-19

      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.

       
      • Drew LaMar

        Drew LaMar - 2017-05-20

        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.

         
        • Ahmet Kurt

          Ahmet Kurt - 2017-05-31

          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.

           
  • Ahmet Kurt

    Ahmet Kurt - 2017-05-18

    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.

     
  • Ahmet Kurt

    Ahmet Kurt - 2017-05-18

    Yes sure.
    For not symbolic:

    Error calling right hand side function:
    capi_return is NULL
    def _specfn(ds, t, x, parsinps):
    Call-back cb_f_in_dvode__user__routines failed.
    Traceback (most recent call last):
        xnew0 = (ds._auxfn_bkfarinf(parsinps, x[4],x[2])-x[0])/parsinps[27] 
      File "C:/Users/Ahmet/PycharmProjects/DSAnalysis/corticotrophMU.py", line 81, in <module>
        xnew1 = (ds._auxfn_bknearinf(parsinps, x[4])-x[1])/ds._auxfn_taubkn(parsinps, )
        traj = testDS.compute('test')  # integrate ODE
        xnew2 = -parsinps[5]*(parsinps[2]*ds._auxfn_ica(parsinps, x[4])+parsinps[14]*x[2])
      File "C:\Python27\lib\site-packages\PyDSTool\Generator\Vode_ODEsystem.py", line 371, in compute
        xnew3 = (ds._auxfn_phik(parsinps, x[4])-x[3])/parsinps[30] 
        y_ignored = solver.integrate(new_t)
      File "C:\Python27\lib\site-packages\scipy\integrate\_ode.py", line 408, in integrate
        xnew4 = -(ds._auxfn_ica(parsinps, x[4])+ds._auxfn_ik(parsinps, x[4],x[3],x[0],x[1])+ds._auxfn_ins(parsinps, x[4])+ds._auxfn_ikir(parsinps, x[4]))/parsinps[1] 
        return array([xnew0, xnew1, xnew2, xnew3, xnew4])
        self.f_params, self.jac_params)
    
      File "C:\Python27\lib\site-packages\scipy\integrate\_ode.py", line 865, in run
    Numerical traceback information (current state, parameters, etc.)
        y1, t, istate = self.runner(*args)
    in generator dictionary 'traceback'
      File "<string>", line 3, in _specfn
      File "<string>", line 2, in _auxfn_bknearinf
      File "<string>", line 2, in _auxfn_vbknear
    TypeError: unsupported operand type(s) for /: 'instancemethod' and 'float'
    
    Process finished with exit code 1
    

    For symbolic one:

    C:\Python27\python.exe C:/Users/Ahmet/PycharmProjects/DSAnalysis/corticotrpohMU-symbolic_syntax.py
    Traceback (most recent call last):
      File "C:/Users/Ahmet/PycharmProjects/DSAnalysis/corticotrpohMU-symbolic_syntax.py", line 100, in <module>
        testDS = Generator.Vode_ODEsystem(DSargs)
      File "C:\Python27\lib\site-packages\PyDSTool\Generator\Vode_ODEsystem.py", line 47, in __init__
        ODEsystem.__init__(self, kw)
      File "C:\Python27\lib\site-packages\PyDSTool\Generator\ODEsystem.py", line 54, in __init__
        kw))
      File "C:\Python27\lib\site-packages\PyDSTool\Generator\baseclasses.py", line 476, in _kw_process_dispatch
        f(kw, fs_args)
      File "C:\Python27\lib\site-packages\PyDSTool\Generator\baseclasses.py", line 785, in _kw_process_pars
        for k, v in dict(kw['pars']).items():
    ValueError: dictionary update sequence element #0 has length 0; 2 is required
    
    Process finished with exit code 1
    
     
  • Ahmet Kurt

    Ahmet Kurt - 2017-06-02

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.