Current implementation of HHGate and HHGate2D enforces interpolation tables for obtaining the steady-state values of the parameters for gate dynamics (m_inf, m_tau, etc.).
However, this can produce numerical inaccuracies depending on the formula for the state variable. For example, in Maex and deSchutter 1998, the KC channel depends on both voltage and [Ca2+]. The equations are more sensitive to [Ca2+].
The default 3000 divisions for the Ca2+ dimension of the 2D interpolation tables produces quite a bit of error compared to other simulators directly evaluating the formula.
Changing this to 10000 improves the results, but not good enough. When the cell spikes, soon the interpolation based implementation goes out of sync with exact evaluation.
[Ca2+] with 3000 divisions, only CaHVA, KCa (KC), CaPool, and leak conductance are present
[Ca2+] with 10000 divisions:
A switch to go between lookup tables and exact evaluation may help such cases.
In addition, the minimum and maximum values now depend on what the user decides/some reasonable defaults. However, for formulae are agnostic of realistic ranges. This results in hard to find bugs in simulation (the Maex and de Schutter 98 model is an example, where the [Ca2+] can hit 5 mM, and I was originally setting the upper limit to 2 mM). It will help to provide a warning message for the user whenever the boundaries of the interpolation table are hit.
Current implementation of
HHGate
andHHGate2D
enforces interpolation tables for obtaining the steady-state values of the parameters for gate dynamics (m_inf, m_tau, etc.). However, this can produce numerical inaccuracies depending on the formula for the state variable. For example, in Maex and deSchutter 1998, the KC channel depends on both voltage and [Ca2+]. The equations are more sensitive to [Ca2+]. The default 3000 divisions for the Ca2+ dimension of the 2D interpolation tables produces quite a bit of error compared to other simulators directly evaluating the formula. Changing this to 10000 improves the results, but not good enough. When the cell spikes, soon the interpolation based implementation goes out of sync with exact evaluation. [Ca2+] with 3000 divisions, only CaHVA, KCa (KC), CaPool, and leak conductance are present[Ca2+] with 10000 divisions: