source: project/release/4/nemo/trunk/examples/CGC/vclamp/nemo_nmodl_generated/CGC_Kir_vclamp.hoc @ 27547

Last change on this file since 27547 was 27547, checked in by Ivan Raikov, 8 years ago

nemo: CGC example reorganization

File size: 1.4 KB
Line 
1load_file("nrngui.hoc")
2load_file( "CGC_Kir.hoc" )
3objref vce      // voltage clamp
4objref g[ 1 ] // graph objects
5objref vgraphbox, hgraphbox[ 1 ]
6vgraphbox=new VBox()
7vgraphbox.intercept(1)
8hgraphbox[ 0 ]=new HBox()
9hgraphbox[ 0 ].intercept(1)
10i =  0
11g[i]=new Graph()
12g[i].exec_menu("Keep Lines")
13hgraphbox[ 0 ].intercept(0)
14hgraphbox[ 0 ].map()
15
16vgraphbox.intercept(0)
17
18vec_sizes = tstop/dt + 1        // recorded traces are all this size
19
20vce=new VClamp(0)
21
22dt = 0.001
23
24proc vcrun() {
25       
26        vce.dur[0]=vchdur
27        vce.dur[1]=vcbdur
28        vce.dur[2]=vchdur
29
30        tstop=vce.dur[0]+vce.dur[1]+vce.dur[2]
31       
32        vce.amp[0]=vchold
33        vce.amp[2]=vchold
34       
35        for j=0, vcsteps-1 {
36                x=vcbase+j*vcincrement
37                vce.amp[1]=x
38
39                init()
40
41                run()
42                $o2.line(g[$1], dt)
43
44                for i=0,$o2.size()-1 {
45                    $o4.printf("%g %g\n", $o3.x[i], $o2.x[i])
46                    }
47
48                if (stoppedrun()) {
49                        break
50                }
51        }
52}
53print "generating  Kir "
54vchold = soma.comp1464_vchold_CGC_Kir
55vcbase = soma.comp1464_vcbase_CGC_Kir
56vcincrement = soma.comp1464_vcinc_CGC_Kir
57vcsteps = soma.comp1464_vcsteps_CGC_Kir
58vchdur = soma.comp1464_vchdur_CGC_Kir
59vcbdur = soma.comp1464_vcbdur_CGC_Kir
60objref  Kir
61Kir = new Vector(vec_sizes)
62Kir.record (&soma.i_Kir_CGC_Kir( 0.5 ))
63objref tlog
64tlog = new Vector(vec_sizes,0)
65tlog.record (&t)
66objref logfile
67logfile = new File()
68logfile.wopen ( "Kir.dat" )
69vcrun( 0 ,  Kir , tlog, logfile)
70g[ 0 ].label(.5,.85," Kir ")
71logfile.close()
72i=0
73g[i].exec_menu("View = plot")
74vgraphbox.map()
Note: See TracBrowser for help on using the repository browser.