Description of problem
I’m wondering how the diffusion current is calculated in the multi-compartmental neurons. There’s not much in the documentation about it. I ask this because I assumed that diffusion current shouldn’t impact the voltage trace for SpatialNeuron
s with n=1
segment. Similarly, the value of Ri
argument must be irrelevant. But the simple code below shows otherwise.
Minimal code to reproduce problem
The following script defines and simulates a neuron governed by a leakage current and an external current I
. In addition, two auxiliary functions are defined:
-
make_n_run(scale = 1, shape='sphere', L=1, Ri_scale=1)
: Makes a morphology of typeSoma
ifshape= 'sphere'
otherwise, a single compartmentalCylinder
. By default, the area of both objects is1 * meter**2
. Yet, it is possible to scale the diameter of both objects by a factor ofscale
. In addition,Ri_scale
can scale the axial resistance. Yet, I guess that it should not be relevant for the single-compartmental object created here. -
plotter(neuron, mon)
: Plots,v, I, Im
during the course of simulation.
import brian2 as b2
from brian2 import Soma, Cylinder, Section
from brian2.units import *
import matplotlib.pyplot as plt
from brian2tools import *
import numpy as np
from brian2.units.constants import faraday_constant as F
from brian2.units.constants import gas_constant as R
El = -84*mV
gl = 30* nsiemens/(1*meter**2)
Ri = 0.4*metre/siemens # axial resistance
Cm = 1.4*pF/meter**2
test_eq = """
Im = gl * (El - v) + I: amp/meter**2
I : amp/meter**2
"""
def make_n_run(scale = 1, shape='sphere', L=1, Ri_scale=1):
"""
Scales diamter by a factor of `scale`. Also one can select the shape.
"""
b2.start_scope()
if shape=='sphere':
morpho = Soma(diameter=scale*np.sqrt(1/np.pi)*meter) # area scaled by sqrt(scale)
else:
morpho = Cylinder(diameter=scale/(np.pi*L)*meter, length=L*meter, n=1) # area scaled by scale
neuron = b2.SpatialNeuron(morphology=morpho,
model= test_eq,
Cm=Cm,
Ri=Ri*Ri_scale, # irrelevent for single compartments or not?
method='exponential_euler',
)
neuron.v = El
neuron.I = 0*mA/meter**2
mon = b2.StateMonitor(neuron, ['v', 'I', 'Im'], record=True)
b2.run(2*ms)
neuron.I = 0.3*nA/meter**2
b2.run(2*ms)
neuron.I = 0*amp/meter**2
b2.run(3*ms)
return neuron, mon
def plotter(neuron, mon):
fig, axs = plt.subplots(3,1, figsize=(8,8))
for i in range(0,mon.v.shape[0]):
axs[0].plot(mon.t,mon.Im[i], 'k',
alpha=(i+1.)/mon.v.shape[0],label=i, )
axs[1].plot(mon.t,mon.I[i], 'r', alpha=(i+1.)/mon.v.shape[0],label=i, )
axs[2].plot(mon.t, mon.v[i], 'b', alpha=(i+1.)/mon.v.shape[0],label=i, )
axs[0].set_title('Im [Amp/m^2]')
axs[1].set_title('I [Amp/m^2]')
axs[2].set_title('v [volt]')
# originally was desigend for a REAL multicompartmental neuron
for ax in axs:
ax.legend(ncol=6)
print(neuron.Im[0], neuron.Im[-1]) # for reference
Using these functions we can look at the following cases:
- large soma (
scale = 1e6
) - small soma (
scale = 1e-4
) - thick axon (
scale = 1e7, shape='cylinder'
) - thin axon (
scale = 1e-7, shape='cylinder'
) - large soma with high axial resistivity (
scale = 1e6, Ri_scale=1e8
) - small soma with high axial resistivity (
scale = 1e-4, Ri_scale=1e8
) - thick axon with high axial resistivity(
scale = 1e7, shape='cylinder', Ri_scale=1e4
) - thin axon with high axial resistivity(
scale = 1e-7, shape='cylinder', Ri_scale=1e4
)
with the following commands:
neuron, mon= make_n_run(*suitable_args)
plotter(neuron, mon)
What you have aready tried
Turned out that once the axial resistance is not high (case 1-4), the results are sensitive to the object’s diameter, yet in different manners. While the voltage trace of larger somas (or tiny axons) are independent of the diameter, small somas (or huge axons) exhibit some diameter-dependent response:
small soma
large axon
whereas for large soma, small axon, or high enough axial resistivity, all configurations converge to the following output:
large axon with high axial resistivity
Note that the figure above coincides with a point neuron implementation – where there’s no propagation.
So my question is:
Why do the voltage traces (blue lines on the lower panels) depend on the diameter? Given that the equations are expressed in terms of current density, I expect all morphologies, independent of size or shape, to exhibit the behavior of a point neuron.
Thanks for sharing your thoughts. A reference link would also suffice.
Arash