-
Notifications
You must be signed in to change notification settings - Fork 3
/
vcompsim.hoc
50 lines (43 loc) · 1.07 KB
/
vcompsim.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
objref vmat, vtrajeclist
proc vcompsim() { local i, j, numcomp localobj vv, vn, vf, f, s
s = new String()
vtrajeclist = new List()
vn = vtrajeclist
f = new File()
numcomp=0 forsec cell.all numcomp += 1
vmat = new Matrix(10*100-1, numcomp+1)
classname(cell, s.s)
sprint(s.s, "../p2c/state/%s.dat", s.s)
f.ropen(s.s)
vmat.scanf(f, vmat.nrow, vmat.ncol)
vf = vmat
i = 1
tsyn = new Vector()
cell.comp[1] {tsyn.record(&t)}
for i=1, vf.ncol-1 cell.comp[i] {
vv = new Vector()
vv.record(&v(.5))
vn.append(vv)
}
stdinit()
continuerun(100)
seev(2)
}
proc seev() {localobj gf, gn, s
s = new String()
gg.erase_all()
seewhich = $1
gf = vmat
gn = vtrajeclist
if (seewhich > gn.count) {seewhich = gn.count-1}
if (seewhich < 1) { seewhich = 1 }
cell.comp[seewhich] { sprint(s.s,"%s.v(.5)", secname()) }
gg.label(.5,.8,s.s,2,1,0,0,1)
gf.getcol(seewhich).line(gg, gf.getcol(0), 2, 1)
gn.object(seewhich-1).line(gg, tsyn)
}
proc mkseev() {
xpanel("compare compartment voltages")
xvalue("which", "seewhich", 1, "seev(seewhich)")
xpanel()
}