// The NEURON Book // Carnevale & Hines // Chapter 6: How to build and use models of individual cells // For later convenience, although not needed for anything in this script! load_file("nrngui.hoc") // 6.3: Implementing a model with hoc. // This hoc code creates the same model implemented in Chapter 1 // using the CellBuilder GUI. ///////////////////////// /* model sepcification */ ///////////////////////// /////topology///// create soma, apical, basilar, axon access soma // defines which section is the default section connect apical(0), soma(1) connect basilar(0), soma(0) connect axon(0), soma(0) /////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 } // 6.4: Instrumenting a model with hoc ///////////////////// /* instrumentation */ ///////////////////// ///// synaptic input ///// objref syn soma syn = new AlphaSynapse(0.5) syn.onset = 0.5 syn.tau = 0.1 syn.gmax = 0.05 syn.e = 0 ///// graphical display ///// objref g g = new Graph() addplot(g,0) // makes graph accessible to both hoc and GUI control g.size(0,5,-80,40) g.addvar("soma.v(0.5)",1,1,0.6,0.9,2) // 6.5: Setting up simulation control with hoc //////////////////////// /* simulation control */ //////////////////////// dt=0.025 tstop=5 v_init=-65 proc initialize(){ finitialize(v_init) fcurrent() } proc integrate(){ g.begin() while (t