/
test_model_LR.hoc
70 lines (42 loc) · 1.03 KB
/
test_model_LR.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
load_file("nrngui.hoc")
xopen("RS_neuron_tuned.hoc")
xopen("LR_neuron_tuned.hoc")
n=1
objref cell[100],hines,g,tvec
g = new Graph()
tvec = new Vector()
proc hines1(){
dt = 0.025
printf("%d t=%g dt=%g dreal=%g treal=%g\n", \
0, t, dt, startsw()-hinest2, startsw()-hinest1)
hinest2 = startsw()
cvode.event(t + 1, "hines1()")
}
proc init() {
finitialize()
if (cvode_active()) {
cvode.re_init()
} else {
fcurrent()
}
frecord_init()
}
for i=0,n-1{
cell[i] = new LR_neuron_tuned(1)
}
tstop = 1500
hinest1 = startsw()
hinest2 = startsw()
hines = new FInitializeHandler(2, "hinest1=startsw() hinest2=startsw() hines1()")
finitialize()
tvec.record(&t)
proc runandplot() {
g.exec_menu("Erase")
g.addexpr("LR_neuron_model",7,1)
run()
cell[0].voltagem.plot(g,tvec)
g.exec_menu("View = plot")
}
runandplot()
cell[0].spiketimes.printf
//quit()