-
Notifications
You must be signed in to change notification settings - Fork 1
/
IClampNoise.mod
83 lines (65 loc) · 1.18 KB
/
IClampNoise.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
TITLE Normal distribution
COMMENT
-----------------------------------------------------------------------------
Point current with noise coming from a normal distribution
==================================================
IMPLEMENTATION
This mechanism is implemented as a nonspecific current defined as a point process.
PARAMETERS
The mechanism takes as input the following parameters:
del (ms)
dur (ms)
amp (nA)
-----------------------------------------------------------------------------
ENDCOMMENT
NEURON {
POINT_PROCESS IClampNoise
RANGE i,del,dur,amp
ELECTRODE_CURRENT i
}
UNITS {
(nA) = (nanoamp)
}
PARAMETER {
del=500 (ms)
dur=1000000 (ms)
amp=0 (nA)
}
ASSIGNED {
ival (nA)
i (nA)
noise (nA)
on (1)
}
INITIAL {
i = 0
on = 0
net_send(del, 1)
}
PROCEDURE seed(x) {
set_seed(x)
}
BEFORE BREAKPOINT {
if (on) {
noise = normrand(0,amp*1(/nA))*1(nA)
ival = noise
} else {
ival = 0
}
}
BREAKPOINT {
i = ival
}
NET_RECEIVE (w) {
if (flag == 1) {
if (on == 0) {
: turn it on
on = 1
: prepare to turn it off
net_send(dur, 1)
} else {
: turn it off
on = 0
}
}
}