| 1 |
""" |
| 2 |
A cylinder plus two branches, with diameters according to Rall's formula |
| 3 |
""" |
| 4 |
from brian2 import * |
| 5 |
|
| 6 |
defaultclock.dt = 0.01*ms |
| 7 |
|
| 8 |
# Passive channels |
| 9 |
gL = 1e-4*siemens/cm**2 |
| 10 |
EL = -70*mV |
| 11 |
|
| 12 |
# Morphology |
| 13 |
diameter = 1*um |
| 14 |
length = 300*um |
| 15 |
Cm = 1*uF/cm**2 |
| 16 |
Ri = 150*ohm*cm |
| 17 |
N = 500 |
| 18 |
rm = 1 / (gL * pi * diameter) # membrane resistance per unit length |
| 19 |
ra = (4 * Ri)/(pi * diameter**2) # axial resistance per unit length |
| 20 |
la = sqrt(rm / ra) # space length |
| 21 |
morpho = Cylinder(diameter=diameter, length=length, n=N) |
| 22 |
d1 = 0.5*um |
| 23 |
L1 = 200*um |
| 24 |
rm = 1 / (gL * pi * d1) # membrane resistance per unit length |
| 25 |
ra = (4 * Ri) / (pi * d1**2) # axial resistance per unit length |
| 26 |
l1 = sqrt(rm / ra) # space length |
| 27 |
morpho.L = Cylinder(diameter=d1, length=L1, n=N) |
| 28 |
d2 = (diameter**1.5 - d1**1.5)**(1. / 1.5) |
| 29 |
rm = 1/(gL * pi * d2) # membrane resistance per unit length |
| 30 |
ra = (4 * Ri) / (pi * d2**2) # axial resistance per unit length |
| 31 |
l2 = sqrt(rm / ra) # space length |
| 32 |
L2 = (L1 / l1) * l2 |
| 33 |
morpho.R = Cylinder(diameter=d2, length=L2, n=N) |
| 34 |
|
| 35 |
eqs=''' |
| 36 |
Im = gL * (EL-v) : amp/meter**2 |
| 37 |
I : amp (point current) |
| 38 |
''' |
| 39 |
|
| 40 |
neuron = SpatialNeuron(morphology=morpho, model=eqs, Cm=Cm, Ri=Ri, |
| 41 |
method='exponential_euler') |
| 42 |
neuron.v = EL |
| 43 |
|
| 44 |
neuron.I[0] = 0.02*nA # injecting at the left end |
| 45 |
run(100*ms, report='text') |
| 46 |
|
| 47 |
plot(neuron.main.distance/um, neuron.main.v/mV, 'k') |
| 48 |
plot(neuron.L.distance/um, neuron.L.v/mV, 'k') |
| 49 |
plot(neuron.R.distance/um, neuron.R.v/mV, 'k') |
| 50 |
# Theory |
| 51 |
x = neuron.main.distance |
| 52 |
ra = la * 4 * Ri/(pi * diameter**2) |
| 53 |
l = length/la + L1/l1 |
| 54 |
theory = EL + ra*neuron.I[0]*cosh(l - x/la)/sinh(l) |
| 55 |
plot(x/um, theory/mV, 'r') |
| 56 |
x = neuron.L.distance |
| 57 |
theory = (EL+ra*neuron.I[0]*cosh(l - neuron.main.distance[-1]/la - |
| 58 |
(x - neuron.main.distance[-1])/l1)/sinh(l)) |
| 59 |
plot(x/um, theory/mV, 'r') |
| 60 |
x = neuron.R.distance |
| 61 |
theory = (EL+ra*neuron.I[0]*cosh(l - neuron.main.distance[-1]/la - |
| 62 |
(x - neuron.main.distance[-1])/l2)/sinh(l)) |
| 63 |
plot(x/um, theory/mV, 'r') |
| 64 |
xlabel('x (um)') |
| 65 |
ylabel('v (mV)') |
| 66 |
show() |