load_file("nrngui.hoc") ///////////////////////// /* model specification */ ///////////////////////// /////// topology //////// create soma, apical, basilar, axon connect apical(0), soma(1) connect basilar(0), soma(0) connect axon(0), soma(0) access soma /////// geometry //////// soma { L = 30 diam = 30 nseg = 1 } apical { L = 600 diam = 1 nseg = 23 } basilar { L = 200 diam = 2 nseg = 5 } axon { L = 1000 diam = 1 nseg = 37 } /////// biophysics ////// forall { Ra = 100 cm = 1 } soma { insert hh } apical { insert pas g_pas = 0.0002 e_pas = -65 } basilar { insert pas g_pas = 0.0002 e_pas = -65 } axon { insert hh } ///////////////////////// /* instrumentation */ ///////////////////////// ///// synaptic input //// objref syn //declares object variable soma syn = new AlphaSynapse(0.5) //creates new AlphaSynapse in the middle of the soma syn.onset = 0.5 //specifies onset syn.tau = 0.1 //specifies time constant syn.gmax = 0.05 //specifies conductance syn.e = 0 //specifies reversal potential (default value is 0) ///////////////////////// /* initialization */ ///////////////////////// dt = 0.025 tstop = 5 v_init = -65 proc initialize() { t=0 finitialize(v_init) //custom initialization //calls the INITIAL block for all mechanisms (eg. m,h and n gates) //and point processes inserted in the sections. //if the optional argument is present then all voltages of all sections are initialized to v. t is set to 0. fcurrent() //makes all assigned variables (currents, conductances, etc) consistent with the values of the states. } ///////////////////////// /* graphical display */ ////////////////////////// objref g //declares object variable g = new Graph() //creates new Graph window addplot(g, 0) //adds g to a list of graphs that the standard run system automatically updates //allows GUI’s own simulation control code to update the graph that is created by a hoc file. g.size(0,tstop,-80,40) //specifies sizes of x and y axes g.addvar("soma V", "soma.v(0.5)", 1, 1, 0.6, 0.9, 2) //adds variable to plot when g.plot(x) is called //.addvar arguments: label, variable, color, linewidth, //x_position legend, y_position legend, //position legend (1-absolute coordinates, 2-normalized coordinates) ///////////////////////// /* simulation control */ ///////////////////////// proc integrate() { g.begin() //tells the interpreter that commands to plot specific functions will follow. while (t