load_file("nrngui.hoc") load_file("OFF_ON_OFF.ses") // Load the Golgi cell template xopen("Golgi_template.hoc") objref goc goc = new GoC() prelength = 1000 mainlength = 2000 //********************************************************************** proc simulate() { local preDT, mainDT, logsize localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log mainDT = 0.025 preDT = 0.025 dt = preDT tstop = prelength run() if ( stoprun == 1) return dt = mainDT continuerun(prelength + mainlength) if ( stoprun == 1) return logfile=$o1 tlog=$o2 Vlog=$o3 iklog=$o4 inalog=$o5 icalog=$o6 ica2log=$o7 logsize = tlog.size() for i=0,tlog.size()-1 { logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i]) } } //*************User-Interface******************************************* nrnsecmenu(0.5, 1) xpanel("Spontaneous firing") xvalue("Time for Initialization", "prelength") xvalue("Main duration", "mainlength") xvalue("dt", "dt") xvalue("t", "t") xlabel("") xbutton("Start", "simulate()") xbutton("Stop", "stoprun = 1") xpanel() vec_sizes = (prelength+mainlength)/dt + 1 // recorded traces are all this size objref iklog iklog = new Vector(vec_sizes) iklog.record (&goc.soma.ik(0.5)) objref inalog inalog = new Vector(vec_sizes) inalog.record (&goc.soma.ina(0.5)) objref icalog icalog = new Vector(vec_sizes) icalog.record (&goc.soma.ica(0.5)) objref ica2log ica2log = new Vector(vec_sizes) ica2log.record (&goc.soma.ica2(0.5)) objref Vlog Vlog = new Vector(vec_sizes) Vlog.record (&goc.soma.v(0.5)) objref tlog tlog = new Vector(vec_sizes,0) tlog.record (&t) objref logfile logfile = new File() logfile.wopen ( "OFF_ON_OFF.dat" ) simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log) logfile.close() quit()