Then let me point you to this discussion thread
Initial conditions
viewtopic.php?f=12&t=1427
My post from
Fri Oct 31, 2008 11:54 am
shows how to do almost what you want.
You should first implement a "type B" initialization and make sure that it works, before adding the perturbation of membrane potential. The first steps are
1. Ensure that each cell class template has a SectionList called "all" whose elements will be all the sections in the cell.
2. Define a func f() that returns the values you will use to initialize each compartment.
You should already have a List to which you append each of the cells in your network during model setup. If you like, you can substitute the name of that List for "needcustominit" in proc custominit().
Since you want to initialize each compartment's states to a different membrane potential, you will want to change proc custominit() to
Code: Select all
proc custominit() { local i
for i = 0, needcustominit.count()-1 {
forsec needcustominit.o(i).all { // iterate over all sections of this cell
for (x,0) { // iterate over internal nodes
v = f() // f() returns the desired initial potential
}
}
}
finitialize()
}
To save some CPU time during initialization, you can comment out proc init()'s
finitialize(v_init)
At this point you should verify that you're getting a "type B" initialization. Try this on a small net with not more than two or three cells. Verify that initialization forces the voltage-gated states to the steady state values appropriate for their compartment's membrane potential.
Now you're ready to introduce the perturbation of membrane potential. This merely involves inserting another loop into proc custominit(), right after the call to finitialize()--
Code: Select all
for i = 0, needcustominit.count()-1 {
forsec needcustominit.o(i).all { // iterate over all sections of this cell
for (x,0) { // iterate over internal nodes
v = f() // f() returns the desired initial potential
}
}
}
Finally you must verify that you're getting what you expect to get.