-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNTDiffusion.mod
More file actions
166 lines (142 loc) · 3.16 KB
/
NTDiffusion.mod
File metadata and controls
166 lines (142 loc) · 3.16 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
COMMENT
ALE - 08.06.2011
NTDiffusion model using analytic solution [A1.2] of savtchenko - The optimal height of the synaptic cleft - 2007
ENDCOMMENT
DEFINE NDates 10
:DEFINE NDates 20
NEURON {
POINT_PROCESS NTDiffusion
RANGE Radius, CleftWidth, Diffusivity, BasalNTConcentration, NTi, k, Nused
RANGE NTConcentration
RANGE comp
RANGE NTRatio
RANGE tDiff
}
UNITS {
(molar) = (1/liter) : moles do not appear in units
(mM) = (millimolar)
(um) = (micron)
(mA) = (milliamp)
(msM) = (ms mM)
}
CONSTANT{
PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
Nav = 6.02214179e23
}
PARAMETER {
Radius = 1 (um) : Radius, position of the receptor (DEFAULT 1) (50 nanometers is nominal)
CleftWidth = 0.02 (um) : CleftWidth
Diffusivity = 0.33 (um.um/ms) : Diffusivity coefficient of the NT in the cleft (DEFAULT 0.4)
BasalNTConcentration = 0.0 (mM) : resting NT concentration
k = 1.0 : variable d'ajustement
comp = 0
tRound = 0
tDiff = 0
NTRatio = 0
}
ASSIGNED {
NTConcentration
NTi
tr[NDates]
Nused
}
STATE {
NT1
NT2
NT3
NT4
NT5
NT6
NT7
NT8
NT9
}
INITIAL {
NTConcentration = BasalNTConcentration
NTi = 0
FROM i = 0 TO NDates-1{
tr[i] = -1e12
}
Nused = 0
}
: LOCAL comp
BREAKPOINT {
SOLVE state METHOD cnexp
NTConcentration = BasalNTConcentration
FROM i = 0 TO Nused-1{
if(i == 0) {
NTRatio = NT1
tDiff = t-tr[i]
} else if(i == 1) {
NTRatio = NT2
} else if(i == 2) {
NTRatio = NT3
} else if(i == 3) {
NTRatio = NT4
} else if(i == 4) {
NTRatio = NT5
} else if(i == 5) {
NTRatio = NT6
} else if(i == 6) {
NTRatio = NT7
} else if(i == 7) {
NTRatio = NT8
} else if(i == 8) {
NTRatio = NT9
} else {
:printf("Warning: More NT events than expected")
NTRatio = 0
}
if(Radius == 0){
comp = NTRatio * 1e18 * NTi / (4 * PI * CleftWidth * Diffusivity) : en mM
} else {
comp = NTRatio * 1e18 * NTi / (4 * PI * CleftWidth * Diffusivity) * exp(- NTRatio * (Radius*Radius)/(4*Diffusivity)) : en mM
}
:printf("comp : %4.5f\n", comp)
:printf("t = %f :\t %1.0f / %1.0f\t : comp = %f \n", t, i+1, Nused, comp)
if(comp >= 0.001*NTConcentration){
NTConcentration = NTConcentration + comp
} else if(t==tr[i]){
NTConcentration = BasalNTConcentration
} else {
Nused = i
:printf("component used until %1.0f, %f / %f \n", Nused, comp, NTConcentration)
}
}
: NTConcentration = NTConcentration/.06 : testing modifying the amplitude of glutamate
}
DERIVATIVE state {
NT1' = - (NT1 * NT1)
NT2' = - (NT2 * NT2)
NT3' = - (NT3 * NT3)
NT4' = - (NT4 * NT4)
NT5' = - (NT5 * NT5)
NT6' = - (NT6 * NT6)
NT7' = - (NT7 * NT7)
NT8' = - (NT8 * NT8)
NT9' = - (NT9 * NT9)
}
NET_RECEIVE(w){
if(flag == 0){ : external event coming from netcon object
if(Nused < NDates){
Nused = Nused +1
} else {
printf("Size of the NTDiffusion Glu array might be too small")
}
NTi = k*3000/Nav : en moles : (Nav*PI*1e-9*ri*ri*CleftWidth)
FROM i = 1 TO Nused{
tr[Nused+1-i] = tr[Nused-i]
}
tr[0] = t
NT9 = NT8
NT8 = NT7
NT7 = NT6
NT6 = NT5
NT5 = NT4
NT4 = NT3
NT3 = NT2
NT2 = NT1
NT1 = 1
:printf("NTi : %4.5f\n", NTi)
}
}