-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprotocolsB.hoc
88 lines (76 loc) · 1.65 KB
/
protocolsB.hoc
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
/*
Find excitation threshold to 4 significant figures.
Case B (uniform gradient field)
Threshold in V/m
Parameters
waveform
waveform type
monophasic pulse
biphasic square wave
TP (ms)
axon diameter D (um)
*/
TRUE = 1
FALSE = 0
// stimulus waveform
waveform = 0
PULSE = 1 // single pulse
SQUARE = 2 // biphasic square wave
SINE = 3 // sine with NC cycles
TP = 0 // phase duration (ms)
NC = 0 // number of cycles, a nonnegative integer
strdef wstr
func protocol() {
waveform = TP = NC = 0
if ($1==13) {
waveform = PULSE
wstr = "pls"
TP = 5e-3
NC = 1
}
if ($1==14) {
waveform = PULSE
wstr = "pls"
TP = 2.0
NC = 1
}
if ($1==16) {
waveform = SQUARE
wstr = "sqr"
TP = 5e-3
NC = 1
}
if ($1==17) {
waveform = SQUARE
wstr = "sqr"
TP = 2.0
NC = 1
}
/*
pstr = "" // start anew
if (waveform>0) {
sprint(pstr, "%s tp %5.3f ", wstr, TP) // common to all
wstr = pstr
if (waveform==SINE) sprint(pstr, "%snc %7.1f \t", wstr, NC) // peculiar to sine
wstr = pstr
sprint(pstr, "%sxa,ya %5.2f,%5.2f xc,yc %5.2f,%5.2f thresh ", wstr, XA, YA, XC, YC) // common to all
}
print pstr, $1
*/
return waveform>0
}
strdef pstr
proc testprotocols() { local ii
for ii=0,18 {
pstr = "" // start anew
protocol(ii)
if (waveform>0) {
sprint(pstr, "%s tp %5.3f ", wstr, TP) // common to all
wstr = pstr
if (waveform==SINE) sprint(pstr, "%snc %7.1f \t", wstr, NC) // peculiar to sine
wstr = pstr
// sprint(pstr, "%sxa,ya %5.2f,%5.2f xc,yc %5.2f,%5.2f thresh ", wstr, XA, YA, XC, YC) // common to all
}
print ii, pstr
}
}