-
Notifications
You must be signed in to change notification settings - Fork 0
/
munge.hoc
44 lines (38 loc) · 917 Bytes
/
munge.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
objref py,ncl,vvec,svec,nil,g[2]
{py=new PythonObject() ncl=new List() vvec=new List() svec=new List() g[0]=new Graph() g[1]=new Graph()}
nrnpython("from neuron import h")
xopen("mosinit.hoc")
nseg=100
L=1e3
objref stim
stim=IClamp[0]
py.stim=py.h.stim
stim.loc(0.0)
stim.amp=2
stim.dur=5
ena=50 // CHANGE
proc ae () { local x,i,max
for ({x=0 i=0} ; i<3 ; {x+=0.5 i+=1}) {
svec.append(new Vector())
vvec.append(new Vector())
vvec.o(i).record(&v(x))
ncl.append(new NetCon(&v(x),nil))
ncl.o(i).threshold=-20
ncl.o(i).record(svec.o(i))
}
}
proc af () { local i,j
j=$1
printf("Velocity: %0.2f m/s; ",1/(svec.o(2).max()-svec.o(0).max()))
printf("1st vs 2nd half: ")
for i=0,1 printf("%0.2f m/s ",0.5/(svec.o(i+1).max()-svec.o(i).max()))
printf(" (ena=%d mV)\n",ena)
for i=0,2 vvec.o(i).line(g[j],dt,i+1,4)
g[j].size(0,5,-70,50)
}
ae()
run()
af(0)
ena=5
run()
af(1)