Runtime control of membrane resistance/capacitance

Particularly useful chunks of hoc and/or NMODL code. May be pedestrian or stunningly brilliant, may make you gasp or bring tears to your eyes, but always makes you think "I wish I had written that; I'm sure going to steal it."
Post Reply
delarue
Posts: 8
Joined: Tue Jun 24, 2008 12:53 pm

Runtime control of membrane resistance/capacitance

Post 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?
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Runtime control of membrane resistance/capacitance

Post 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.
Post Reply