Page 1 of 1

my model have a problem !

Posted: Fri Dec 15, 2006 7:08 pm
by okanerkaymaz

Code: Select all



UNITS {
        (mA) = (milliamp)
        (mV) = (millivolt)
}
 
NEURON {
        POINT_PROCESS HHok
        USEION na READ ena WRITE ina
        USEION k READ ek WRITE ik
        NONSPECIFIC_CURRENT il
        RANGE gnabar,gkbar,gl,el,m_inf,h_inf,n_inf,tau_m,tau_n,tau_h,ina,ik ,g_m,g_h,g_n
GLOBAL Nna, NK
}
 
PARAMETER {
        v (mV)
        celsius = 6.3 (degC)
        dt (ms)
        gnabar =120
        ena = 50 (mV)
        gkbar = 36 
        ek = -77 (mV)
        gl = .3 (mho/cm2)
        el = -54.4 (mV)
area=100
Nna
NK

}
 
STATE {
        m h n
}
 
ASSIGNED {
        ina	(mA/cm2)
        ik	(mA/cm2)
        il	(mA/cm2)
        m_inf h_inf n_inf tau_m tau_h tau_n
	tadj
g_m g_n g_h p_m p_n p_h
}
 
BREAKPOINT {
        SOLVE states
        ina = gnabar * m*m*m*h * (v - ena)
        ik = gkbar * n*n*n*n * (v - ek)      
        il = gl * (v-el)
}
 :PROCEDURE states() { 
  :      rates(v)   
   :     m = m + (1-exp(-dt/tau_m)) * (m_inf-m)+g_m

    :    h = h + (1-exp(-dt/tau_h)) * (h_inf-h)+g_h

     :   n = n + (1-exp(-dt/tau_n)) * (n_inf-n)+g_n

:}
DERIVATIVE states { : exact Hodgkin-Huxley equations 
rates(v)
 m' = (m_inf - m) / tau_m +g_m
h' = (h_inf - h) / tau_h +g_h
n' = (n_inf - n) / tau_n +g_n
}

UNITSOFF
INITIAL {
Nna=60*area
NK=18*area
	tadj = 3.0^((celsius-23.5)/10)
	rates(v)
	m = m_inf
	h = h_inf
	n = n_inf
}


 
PROCEDURE rates(v) { LOCAL alpha, beta, q10, tinc
        TABLE m_inf, tau_m, h_inf, tau_h, n_inf, tau_n, p_m,p_h,p_n,g_m,g_h,g_n DEPEND dt, 
	      celsius FROM -100 TO 100 WITH 200
	:"m" sodium activation system
          alpha = .091 * vtrap(v+38,5)
          beta =  .062 * vtrap(-(v+38),5) 
		p_m=2/Nna*alpha*beta/(alpha+beta)
		g_m=sqrt(p_m)*normrand(-1,1)
       	  tau_m = 1 / (alpha+beta) / tadj
       	  m_inf = alpha/(alpha+beta)
	:"h" sodium inactivation system
       	  alpha = .016 * exp(-(v+55)/15)
       	  beta = 2.07 / (1+exp((17-v)/21))
		p_h=2/Nna*alpha*beta/(alpha+beta)
		g_h=sqrt(p_h)*normrand(-1,1)       	  
			tau_h = 1 / (alpha+beta) / tadj
       	 	h_inf = alpha/(alpha+beta)

	:"n" potassium activation system
       	  alpha = .01*vtrap(v+45,5) 
       	  beta = .17*exp(-(v+50)/40)
			p_n=2/NK*alpha*beta/(alpha+beta)
			g_n=sqrt(p_n)*normrand(-1,1)

       	  tau_n = 1 / (alpha+beta) / tadj
       	  n_inf = alpha/(alpha+beta)
}
 
FUNCTION vtrap( x, b) {
	: Traps for 0 in denominator of rate equations
	if (fabs(x/b) < 1e-6) {
	  vtrap = b+x/2 }
	else {
	  vtrap = x / (1-exp(-x/b)) }
}
UNITSON




Hii friends.
i have a problem and error's subject is about fox lu algorithm.
but i wrote a code your helping i compiled in Neuron and when i pressed init & run button , my model has return only first values and then m,n, h parameters haven't changed.
anybody have a aim for this problem?
or what can i do this situation ?

Posted: Sat Dec 16, 2006 9:30 pm
by okanerkaymaz
friends.
why is anyone answer my questions ?
i wonder am i asking very hard question ?
or easy question so anyone isn't answer!

Posted: Sun Dec 17, 2006 10:49 am
by ted
okanerkaymaz wrote:i wonder am i asking very hard question ?
Well, you are. People are generally willing to share their expertise. If you haven't received
any answers, it may be because you are the only person reading the Forum who knows
anything about the Fox Lu algorithm. I sure don't know anything about it.

One thing I can tell you: the SOLVE statement needs a METHOD. I am reluctant to suggest
changing it to
SOLVE states METHOD cnexp
because I am worried about the extra terms g_m, g_h, and g_n that are added to the right
hand sides. These differential equations are not mathematically equivalent to the formulas
in PROCEDURE states(), which has been commented out. Are the formulas in
PROCEDURE states the original, correct way to calcuate m, h, and n? If the answer is
yes, then the original mechanism cannot be restated in a form that will be compatible with
CVODE.