I implemented a mechanism that uses longitudinal diffusion. It works great but I have a question I couldnt' find an answer to (this forum, the neuron book): how does the LONGITUDINAL_DIFFUSION statement handle diffusion across borders of compartments ? In particular, I would like to understand what exactly happens if two compartments have different diameters. The flux term of the LONGITUDINAL_DIFFUSION statement includes the area of the cross-section of the current compartment. Thus, maybe the internal mechanism automatically uses the smaller of the fluxes at the border of the two compartments? Or do I have to handle this myself, i.e. somehow find out if a particular segment borders on a segment that is in a different compartment?

thanks for any hints

ueli

## longitudinal diffusion and compartments of varying diameter

of the adjacent compartments. For many annuli this can result geometrical

nonsense since the tubes of course do not match up. If you want to

see the arithmetic going on, take a look at nrn/src/nrnoc/ldifus.c

with regard to the calculation of pld->a and pld->b.

The volume of a compartment is the cross sectional area at the

center of a compartment multiplied by the compartment lenght.

The distance between the centers of adjacent compartments is the

average of the two compartment lenghts.