Skip to content

An extended Hodgkin-Huxley model that doesn't want to work.

7 messages · Berend Hasselman, Jannetta Steyn

#
Forgot Reply to All.
On 13-02-2013, at 23:30, Jannetta Steyn <jannetta at henning.org> wrote:

            
1. why are you suing simecol when only deSolve is necessary?

2. there are some errors in your model. The return list from function HH_soma does not correspond with the state variables.
 You return dCa2 but there is no state variable Ca2. ECa is in the initial state variable init but there is no dECa derivative in the return list of function HH_SOMA.  Finally you have set parameter CaI to 0 in the parms vector.
But that parameter is only used in calling function ECa with argument CaI, where you are now dividing by 0 and taking the logarithm of the result (which is Inf).

So change the return list of function HH_soma to

  list(c(dv,
         dCaTm, dCaTh,
         dCaSm,
         dNapm, dNaph,
         dhm,
         dKm,
         dKCam,
         # dCa2,    <==== Not needed not in init
         dAm, dAh))  

Change parms into (change CaI to 1; if that is a sensible value if for you to decide).

parms = c(gCaT=22.5, gCaS=60, gNap=4.38, gh=0.219,
        gK=1576.8, gKCa=251.85, gA=39.42, gL=0.105,
        ENap=50, Ca2=0.52,
        Eh=-20, EK=-80, EL=-55, EKCa=-80, EA=-80,
        C=1/12, I=10, F=0.418, TauCa=303, C0=0.5, CaI=1)

and change the initial state to (leaving out ECa)

init = c(v=-65, CaTm=0.52 , CaTh=0.52, CaSm=0.52,
       Napm=0.52, Naph=0.52, hm=0.52, Km=0.52,
       KCam=0.52, Am=0.52, Ah=0.52)#, ECa=-80);


Finally  you don't need to end R expressions with ; (only needed to join several expressions on a single line)

I uses library(deSolve) and got an interesting plot.

Berend
#
On 15-02-2013, at 10:28, Jannetta Steyn <jannetta at henning.org> wrote:

            
Difficult to tell as you haven't shown how ode was defined.

I just did this:

out<-ode(y=init, times=times, func=HH_soma, parms=parms)
plot(out)    

and got the plots of all state variables.

Berend
#
On 15-02-2013, at 11:22, Jannetta Steyn <jannetta at henning.org> wrote:

            
You are not doing what I told you to do.

You should plot the result of ode not ode itself (that's the function).
So do

plot(out)

and you will get the plots.

Berend