I started by creating a simple program that sets up the model cell, attaches a current clamp to it, and provides just enough of a graphical user interface to launch a simulation and display results. The main file is initcell_basic.hoc
load_file("nrngui.hoc") load_file("cellspec.hoc") // properties of model cell load_file("cellrig.hoc") // basic instrumentation and simulation control // required to launch a simulation and see results // i.e. just an IClamp, graph, and RunControl
Here is cellspec.hoc
///// specify properties of model cell create soma access soma soma { L = 10/PI diam = 10 // area = 100 um2 insert pas g_pas = 1e-4 }
And here is cellrig.hoc
///// specify instrumentation for manual exploration of model cell ///// basic instrumentation objref stim soma stim = new IClamp(0.5) stim.del = 1 stim.dur = 100 stim.amp = 0.002 objref g g = new Graph(0) { g.size(0,6,-70,-62) g.view(0, -70, 6, 8, 265, 105, 300.48, 200.32) graphList[0].append(g) // so it will update at every fadvance() g.addexpr("soma.v(.5)", 1, 1, 0.4, 0.9, 2) } ///// basic simulation control v_init = e_pas // so simulation starts with model cell "at rest" tstop = 6 // simulation duration { xpanel("RunControl", 0) xvalue("Init","v_init", 1,"stdinit()", 1, 1 ) xbutton("Init & Run","run()") xbutton("Stop","stoprun=1") runStopAt = 5 xvalue("Continue til","runStopAt", 1,"{continuerun(runStopAt) stoprun=1}", 1, 1 ) runStopIn = 1 xvalue("Continue for","runStopIn", 1,"{continuerun(t + runStopIn) stoprun=1}", 1, 1 ) xbutton("Single Step","steprun()") t = 0 xvalue("t","t", 2 ) xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 ) dt = 0.025 xvalue("dt","dt", 1,"setdt()", 0, 1 ) steps_per_ms = 40 xvalue("Points plotted/ms","steps_per_ms", 1,"setdt()", 0, 1 ) screen_update_invl = 0.05 xvalue("Scrn update invl","screen_update_invl", 1,"", 0, 1 ) realtime = 0 xvalue("Real Time","realtime", 0,"", 0, 1 ) xpanel(0,105) }
With this simple program, I ran simulations that reassured me that the model cell was implemented properly, and that soma.v did change gradually throughout the simulation.