-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCClamp.mod
63 lines (54 loc) · 1.77 KB
/
CClamp.mod
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
TITLE Current clamp that can receive NetStim input
:------------------------------------------------------------------------------
COMMENT
This file models a current clamp that can receive input from a NetStim
object via a NetCon object.
ENDCOMMENT
:------------------------------------------------------------------------------
NEURON
{
POINT_PROCESS CClamp
RANGE pulseon, nevents, amp, dur
NONSPECIFIC_CURRENT i
}
:------------------------------------------------------------------------------
UNITS {
(nA) = (nanoamp)
}
:------------------------------------------------------------------------------
PARAMETER {
amp = 1 (nA)
dur = 10 (ms)
}
:------------------------------------------------------------------------------
ASSIGNED {
i (nA) : synaptic current
pulseon : current conductance boolean
nevents : number of current events
}
:------------------------------------------------------------------------------
INITIAL {
i = 0
pulseon = 0
nevents = 0
}
:------------------------------------------------------------------------------
BREAKPOINT {
i = -amp*pulseon
}
:------------------------------------------------------------------------------
NET_RECEIVE (w) { : the NetCon weight is ignored in this model
if(flag == 0) { : spike event, increment events counter
nevents = nevents + 1
if (pulseon == 0) { : this is a new event, turn conductance to on mode
pulseon = 1
}
net_send(dur, 1) : send a signal dur later to turn to off mode
}
else { : received an off signal, decrement the events counter
nevents = nevents - 1
if (nevents == 0) { : no remaining events, turn conductance to off mode
pulseon = 0
}
}
}