Dynamic current leads to runaway values

Hi. The problem is not due to the current, if you remove the current you see the same behaviour. The current as such is correct if you want to model an excitatory conductance. That it depends on the voltage isn’t a problem, that’s the case of all currents (in your model, the Na, K, and leak currents depend on the voltage as well). The confusing thing is maybe that you multiply the conductance directly by v, but this should be read as multiplying it by (v - E_exc) where E_exc = 0*mV. Having said all that, the real problem is that your currents have the wrong sign. You’ll have to add a minus in front of g_Na, g_K, g_leak, and I, or use e.g. (E_Na - v) instead of (v - E_Na).

Also note that the euler method is not adapted to these kind of equations, at least unless you use very short time steps. We generally recommend using exponential_euler and probably also a smaller time step, e.g. with defaultclock.dt = 0.01*ms. Also, have a look at this discussion why it would be better to reformulate some of your alpha_.../beta_... equations with the exprel function.

Finally, I think your model uses the parameters of Hodgkin & Huxley’s :squid: axon, make sure this is appropriate for what you are trying to model :grinning: .

2 Likes