longitudinal_diffusion caching?
Posted: Fri Nov 28, 2008 4:01 pm
I was experimenting with longitudinal_diffusion and the results were not quite as I expected: I'd create a section of length 10, put some stuff on the left side, and then it would diffuse across a certain rate. If now I change the length of the section and rerun it, my substance diffuses across the exact same percentage of the section. I have only been able to get around this by exiting NEURON and rerunning my code with the new length as my initial length. Am I doing something wrong, or does longitudinal_diffusion keep track of the lengths when it was first run, and if so, how do I delete this cached information? Thanks!
A simple example of a code that demonstrates this behavior follows:
difftest.hoc:
where diffusion was accomplished via diff.mod:
A simple example of a code that demonstrates this behavior follows:
difftest.hoc:
Code: Select all
// initial setup
{
NUMSEGS=10
LENGTH=10
PRINTEVERY=100
create stick
}
proc go() {
access stick
// specify L, nseg
nseg=NUMSEGS
L=LENGTH
// insert diffusion
insert diff
// initial substance in left only
finitialize()
z_diff(0)=9
// run it
{
for i=1, 10 {
// print from interior of stick
for(x) {
if (abs(x-.5)!=.5) printf("%.4f ", z_diff(x))
}
printf("\n")
for j=1, PRINTEVERY {fadvance()}
}
}
}
print "Set LENGTH then type 'go()'"
Code: Select all
NEURON {
SUFFIX diff
}
BREAKPOINT {
SOLVE state METHOD sparse
}
STATE {
z (1)
}
KINETIC state {
COMPARTMENT 1 {z}
LONGITUDINAL_DIFFUSION 1 {z}
~z << (0)
}