# persistent sodium current ala Gillespie # napgill.ode # we use the exponential integration method # c -> o rate a # o ->c rate b # definition of a,b # a=xinf*tau^-1 # b=tau^-1 -a xinf=.5*(1+tanh((v-vxt)/vxs)) tauxi=phix*cosh((v-vxt)/(2*vxs)) a=xinf*tauxi b=tauxi-a # the cumulative probabilities p1=a*(xn-o) p2=p1+b*o # which reaction? s2=ran(1)*p2 z1=(s2