Dimensions for calcium dependent gating variable

Hi, I don’t know if this is considered a Brian question or not.

I am trying to write a calcium concentration equation:
The gating variable of m_s is dependent on the calcium concentration.

\begin{align} \frac{d[Ca]}{dt} &= -\frac{\gamma}{ZF} I_{CaH}-K_{Ca} ([Ca]-[Ca_0]) \hspace{1cm} & (Eq. 1)\\ m_{\infty}([Ca]) &= \frac{[Ca]^H}{C_{50}^H + [Ca]^H} & (Eq.2)\\ \frac{dm_s}{dt} &= (m_{\infty}-m_s)/\tau_s \\ I_s &= g_s m_s (v-E_K) \\ \end{align}

where \gamma=30000 /cm, F is faraday constant, [Ca_0]=0.01umol, K_{Ca}=0.4/ms,
Hill coefficient, H=4.6, C_{50}=0.35umol.

What I wrote:

from brian2.units.constants import faraday_constant as faraday_const
iCah  = gcahbar*m_Cah*(v-eCa) :amp #  gcanbar[mS], v[mV], iCah[uA]
dc_Ca/dt = -iCah*30000/cm/(2*faraday_const)- 0.4/ms*(c_Ca - 0.01*umol) : mol  # !??
Gcan = (c_Ca/mol)**4.6 :1
Gcan50= 0.01**4.6:1
minf_Sk = Gcan/(Gcan + Gcan50) :1
dm_Sk/dt = (minf_Sk - m_Sk) / (4.0*ms) :1
iSk = gskbar*m_Sk*(v-eK) :amp

the units in dc_Ca/dt is: uA*1/cm/(columb*mol) - 1/ms (mol - umol)

The problem is the dimension of equations 1 and 2.

nconsistent units in differential equation defining variable c_Ca:
Expression "(((- iCah) * 30000) / cm) / (2 * faraday_const) - (0.4 / ms) * (c_Ca - (0.01 * umol))" uses inconsistent units ("(((- iCah) * 30000) / cm) / (2 * faraday_const)" has unit m^-1 s^-1 mol; "(0.4 / ms) * (c_Ca - (0.01 * umol))" has unit kat)

Thanks for any guide.

Without being an expert in this, I think there are two issues:
First, you are using “mol”, i.e. a dimensionless value for “number of particles”, whereas you probably want to use “molar”, i.e. particles per volume or concentration. The symbol for this is “M”, so e.g. µM corresponds to “umolar” in Brian. Note that somewhat counterintuitively, you will have to use “mmolar” not “molar” as the definition of the unit in equations after the colon. This is what corresponds to the “base unit” and gets internally represented as the value “1” (in the same way as volt, amp, meter, …), because “molar” is defined as “per litre” not per “cubic meter”.

Then, are you sure that gamma is given per length? If it were given per volume, things would work out I think. If we look at the units of the first term in the [Ca] definition, we get

\left[\frac{\gamma}{F}I_{CaH} \right] = \frac{\mathrm{m}^{-3}}{\mathrm{s}\cdot\mathrm{A}\cdot\mathrm{mol}^{-1}}\mathrm{A} = \frac{mol}{\mathrm{m}^3\cdot \mathrm{s}} = \frac{\mathrm{M}}{\mathrm{s}}

So this term is a change of concentration over time which is exactly what we need for the RHS of a differential equation of a concentration and is consistent with the second term.

Thank you Marcel, it helped.
\gamma is the ratio of surface area to volume, considering the dimension of current uA/cm2 match the required dimension.
Here is the revised piece of code:

    # Ca Concentration ----------------------------------------------
    dc_Ca/dt = -iCah*3000/(2*96485)/(uA)*(molar/second)- 0.4/ms*(c_Ca - 0.00001*mmolar) : mmolar

    # SK Current (Ca-dependent)
    minf_Sk = c_Ca**4.6/(c_Ca**4.6 + Gcan50) :1
    tau_m_Sk = (76*ms-72*ms*c_Ca/mmolar/5) * int(c_Ca/mmolar < 5.) + 4*ms * int(c_Ca/mmolar >= 5) :second
    # tau_m_Sk = 4.0*ms:second
    dm_Sk/dt = (minf_Sk - m_Sk) / tau_m_Sk :1
    iSk = gskbar*m_Sk*(vg-eK) :amp


which I think seems like the results in Fujita 2012, J Comput Neurosci.

Note: There is some mismatched between parameters in the paper and the code in modeldb. I used modeldb parameters.

2 Likes

Current per surface area makes perfect sense, the equations look good to me. Also agree that the results seem to match. Thanks for sharing!

1 Like