Page 1 of 1

Runtime control of membrane resistance/capacitance

Posted: Wed Jul 16, 2014 10:53 am
by delarue
Hello,
Is there any way to change membrane resistance/capacitance values during run time? My simple thinking was to add a condition

if (t >= time_of_interest) then
change membrane resistance
end

With my custom NMODL mechanisms I can do that by just adding the condition to MOD file, but what about HOC?

Re: Runtime control of membrane resistance/capacitance

Posted: Wed Jul 16, 2014 1:37 pm
by ted
See the very last item in the Hot tips section of the Forum, called
How to change parameters during a simulation

This

Code: Select all

if (t >= time_of_interest) then
   change membrane resistance
end
won't work because it isn't integrated into the standard run system's main computational loop. Even if it were, it would not work with adaptive integration.
With my custom NMODL mechanisms I can do that by just adding the condition to MOD file
This also will not work with adaptive integration; events would be necessary to make it compatible with adaptive integration.

Changing capacitance violates conservation of charge unless you also change membrane potential in the affected segment(s). Specifically: if the new cm in a particular segment is k * the old cm, v in that segment must be changed to v/k.