This is a special instance of a custom initialization. A good introduction to
initialization in NEURON is presented in chapter 8 of the NEURON book,
which you can pick up from
http://www.neuron.yale.edu/ftp/ted/book/revisions/
The general strategy for custom initializations is to use a custom proc init().
The default init() in NEURON's standard run system is
Code: Select all
proc init() {
finitialize(v_init)
// User-specified customizations go here.
// If this invalidates the initialization of
// variable time step integration and vector recording,
// uncomment the following code.
/*
if (cvode.active()) {
cvode.re_init()
} else {
fcurrent()
}
frecord_init()
*/
}
Since hoc is an interpreter, it is easy to replace this with a custom init()--
just make sure that hoc parses your custom init()
after the first
load_file("nrngui.hoc")
that appears in your program (you
are using NEURON's standard run
system, right?).
Now to the particulars of your question. Let's start small (a model with just
one cell) and work up to big (a network).
If your model contained a single neuron and you wanted v to have different
values in different sections, your init() would look like this
Code: Select all
proc init() {
. . . statements that set v to the desired values in each section . . .
finitialize()
/*
if (cvode.active()) {
cvode.re_init()
} else {
fcurrent()
}
frecord_init()
*/
}
You're not changing anything after the finitialize() call, so there's no need
to uncomment the if (cvode.active()) { } block.
Of course, exactly the same approach will do the job for a network. Assuming
that the cells in your network are instances of cell classes, it would be most
convenient if you add a public proc to each class's template that lets
you quickly set v to whatever value you like, e.g. like this
Code: Select all
begintemplate Pyr3
. . . various declarations . . .
public setv
. . . miscellaneous code . . .
proc setv() {
forall v = $1
}
. . . more code . . .
endtemplate Pyr3