load_file("nrngui.hoc") load_file("morphology_mechanisms.hoc") load_file("default.ses") simlength = 2000 access soma //********************************************************************** proc simulate() { tstop = simlength run() } //*************User-Interface******************************************* dt = 1e-3 cvode.active(1) cvode.maxstep(1.0) cvode.rtol(1e-6) cvode.atol(1e-6) nrnsecmenu(0.5, 1) objref tlog tlog = new Vector(simlength/dt) tlog.record(&t) objref vlog vlog = new Vector(simlength/dt) vlog.record(&soma.v(0)) simulate() objref logfile logfile = new File() logfile.wopen ("v.dat") for i=0,vlog.size()-1 { logfile.printf("%g %g\n", tlog.x[i], vlog.x[i]) } logfile.close() quit()