-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathafterdischarge-Prescott.ode
executable file
·82 lines (60 loc) · 2.35 KB
/
afterdischarge-Prescott.ode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# modified Steve Prescott, Aug 29, 2011
# For Coggan et al. (Explaining pathological changes in axonal excitability through dynamical analysis of conductance-based models. J Neural Eng 2011; 8: 065002)
# Incorporates Na influx and simple decay. No pumps yet implemented in this code.
# Nai dynamically varies and is used to update Ena based on Nernst equation.
# DIFFERENTIAL EQUATIONS
dv/dt = (I1(t)+I2(t)+Idc-gna*minf(V)*(V-Vna)-gk*w*(V-VK)-gl*(V-Vl)-gnap*z*(V-Vna))/cap
dw/dt = phi*(winf(V)-w)/tauw(V)
dz/dt = phi_z*(zinf(V)-z)/tauz(V)
dnai/dt = (-SAvol*(gna*minf(v)*(V-Vna)+gnap*z*(V-Vna)))/F-(nai-17.5)/tau_na
# if you don't want Nai to vary, comment out above line and define Nai as a fixed parameter,
# Either that, or just define Vna as a parameter rather than using the Nernst equation to calculate it (see ### below)
param tau_na=100
# PARAMETERS AND FUNCTIONS
minf(v)=.5*(1+tanh((v-v1)/v2))
winf(v)=.5*(1+tanh((v-v3)/v4))
zinf(v)=.5*(1+tanh((v-v5)/v6))
tauw(v)=1/cosh((v-v3)/(2*v4))
tauz(v)=1/cosh((v-v5)/(2*v6))
# v5 and v6 correspond to beta_z and gamma_z - checked, these parameters match PNAS paper
Vna=25*ln(nao/nai)
### see note above.
# param Vna=50
param vk=-100,vl=-70
param gk=20,gl=2,gna=30
param v1=-1.2,v2=18,v3=-10,v4=10
param gnap=0.8
param v5=-45,v6=10
param F=96485
param phi=.15,phi_z=0.05,cap=2
param nao=138
#nao and nai(0) adjusted to set Vna(0)=50mV, differences from 150 & 15 (resp) divided between them
param r=.005
# param h=.01
# !vol=(4/3)*pi*(r^3)
# !SA=4*pi*(r^2)
!SAvol=2/r
# SA:vol ratio for cylinder without ends
# note because of units, set r to 0.005 to get radius of 0.5 microns. The decimal place is not wrong.
# spherical soma r=7.5 um, cylindrical node r=.5 um, h=1 um
# for a cylinder: vol=pi*h*(r^2), SA=2*pi*r*(r+h), SA/vol=(2/r)+(2/h)
aux vna_=vna
aux vk_=vk
aux gna_=gna*minf(V)
# INITIAL CONDITIONS
z(0)=0
nai(0)=18.67
V(0)=0
w(0)=0.000025
#STIMULUS PARAMETERS
# stimulus, set I_stims to 0 if you want to use noisy stim, slope to control ramp
param idc=0
I1(t)=heav(t>=t_start)*I_stim1
# Control stimulus offset or two-stage step, slope to control ramp
I2(t)=heav(t>(t_start+t_run))*I_stim1*(-1)
param I_stim1=50,t_start=300,t_run=0
# ALWAYS USE EULER when using noise, but no noise processes are implemented here
@ total=150,dt=.05,xlo=-100,xhi=60,ylo=-.125,yhi=.6,xp=v,yp=w
@ meth=euler
@ MAXSTOR=1000000,bounds=10000
done