Description of problem
Hi Marcel and others!
In the NeuronGroup object the equation for voltage is explicitly user defined. eg:
dv/dt = (gl*(El-v) - g_na*(m*m*m)*h*(v-ENa) - g_kd*(n*n*n*n)*(v-EK) + I)/C
I : amp
C : farad
dm/dt = .....
But in the SpatialNeuron this equation is implicit, and ‘Im’, and ‘(point currents)’ Cm Ri, and the morphology are the the user defined quantities. Obviously this is kind of the point, the user wants Brian to manage all the spatial stuff like intra-cellular resistivity and capacitance etc in the voltage equation.
** Given the shift from an explicit to an implicit voltage equation I was wondering if it would be possible to just ‘officially’ confirm the exact generic equation that is being used to evolve the voltage as a function of these user defined parameterss by listing that equation in the documentation for the SpatialNeuron. **
Perhaps the answer is obvious; the reason for the request is just to ease the hurdle of understanding what is happening in the leap from ‘explicit’ to ‘implicit’ management of the voltages.
Hi @MartinS. Our documentation for multicompartmental simulations is unfortunately not very detailed, and this kind of information would certainly be helpful to include. Regarding the equations, here is the rough outline: Starting from a definition of the membrane current like this:
I_m = g_L(E_L-v) + g_{Na}m^3h(E_{Na}-v)+g_Kn^4(E_K-v)
We separate the equation into two parts, one independent of v and the other a factor of v:
I_m = \underbrace{g_L E_L + g_{Na} m^3 h E_{Na} + g_K n^4 E_K}_{I_0} + \underbrace{(-g_L -g_{Na} m^3 h - g_K n^4)}_{g_\text{total}} v
The differential equation for the membrane potential of a compartment v_i can then be expressed as
C_m\frac{dv_i}{dt} = \left(I_0 + g_\text{total} v_i + \frac{v_{i-1} -v_i}{r_{i-1\rightarrow i}a_i} + \frac{v_{i+1} -v_i}{r_{i\rightarrow i+1}a_i}\right)
where r is the resistance between the two neighbouring compartments, and a_i is the surface membrane of the compartment. The last part for the current between the compartments is only correct for a cable where each of the compartments connects to two other compartments, at branching points there would be additional terms (and end points would have only one term).
Hope that makes things a bit clearer!
1 Like
Marcel, Absolutely perfect, thanks for the time you spent on this. A few students here appreciate being able to refer to these equations.
As a less important aside, I wonder if there is any plan to implement an external electrical stimulus function. It would fit well with the multi-compartmental framework and is relatively straightforward. The user provides the external voltage for each compartment that they obtain from assumptions or FEM models for example. Brian then uses these values to calculate, for each compartment, the local second spatial derivative of voltage parallel to the neurite; this combined with with local compartment values for capacitance and internal resistance gives the local (point current) for each compartment.