Page 1 of 1

How to set non-uniform v_init

Posted: Sat Mar 12, 2011 10:16 am
by Keivan
I'm trying to build a model with nonuniform v_init. I mean dendrites of model should have 2 mV higher resting membrane potential than the soma. Is it possible to do this?

Re: How to set non-uniform v_init

Posted: Sun Mar 13, 2011 11:48 am
by ted
Keivan wrote:I'm trying to build a model with nonuniform v_init. I mean dendrites of model should have 2 mV higher resting membrane potential than the soma. Is it possible to do this?
Yes. But if you want to know how, you must first be very precise about what you are asking for.
I'm trying to build a model with nonuniform v_init. I mean dendrites of model should have 2 mV higher resting membrane potential than the soma.
Please tell me if I understand. You want the following to be true:
at rest, if soma membrane potential is vsoma, the membrane potential in the dendrites should be vsoma + 2.

Re: How to set non-uniform v_init

Posted: Sun Mar 13, 2011 4:54 pm
by Keivan
yes. This is a question about initialization of the model. Density of hyperpolarization activated channels in dendrites are larger than soma. This may cause distal dendrites have a higher resting membrane potential (RMP). At the moment, it takes 200ms to reach asteady state. I'm looking for a way to initialize the model so each region have its own RMP from the begining.

actually I want to use a sigmoid function to have a nonuniform RMP. and I'm using multirun fitter to find the correct RMP(begin) and RMP(end).

How to initialize to steady state

Posted: Sun Mar 13, 2011 9:43 pm
by ted
Keivan wrote:At the moment, it takes 200ms to reach asteady state. I'm looking for a way to initialize the model so each region have its own RMP from the begining.
So you have a model with nonuniform membrane properties, and you want to initialize it to steady state--that is, you want the model to be at steady state when t = 0.

We call this "initialization to steady state." Here's how to do it.

1. Put the following code into a file called custominit.hoc

Code: Select all

INITDUR = 200 // # ms to reach steady state

proc init() { local temp
  finitialize(v_init)
  t = -2*INITDUR // jump to a time "before" 0
  temp = cvode.active()
  if (temp != 0) { // if cvode is on, turn it off
    cvode.active(0)
    dt = 0.025
  }
  while (t < -INITDUR) {
    fadvance()
  }
  if (temp != 0) { cvode.active(1) } // turn cvode back on if necessary
  t = 0
  if (cvode.active()) {
    cvode.re_init()
  } else {
    fcurrent()
  }
  frecord_init()
}
2. In your own program, insert the following line
load_file("custominit.hoc")
AFTER your load_file("nrngui.hoc") statement.

When you run a simulation, your model will automatically be in steady state starting at t = 0.

Re: How to set non-uniform v_init

Posted: Mon Mar 14, 2011 3:02 am
by Keivan
Thank you Ted. Your code is actually helpful. But, I'm curious about a way to deal with membrane voltage like other range variables. I want to know how I can assign a value for membrane voltage for each region of the membrane (before start of the simulation). Also, I want a fast method; because I work with multirun fitter. Consider I change parameters during fitting process which alter the steady state. Actually, I want RMP to be one of my parameters I can change during fitting process.

Re: How to set non-uniform v_init

Posted: Mon Mar 14, 2011 9:33 am
by ted
You're asking for the impossible. Any change of channel densities or the voltage-dependence of gating variables will also change resting potential. In a model that has nonuniform membrane properties, any change of length or diameter will also change resting potential. Furthermore, in any model that has nonuniform membrane potential, axial current (current between adjacent compartments) will be nonzero at at least one location in the model. In any of these cases there is only one way to determine the membrane potential at which the net ionic current cancels out the axial current from adjacent sections, and that is to run a simulation and wait while the system approaches a new steady state--assuming that the model even has a steady state, and is not spontaneously active.

Re: How to set non-uniform v_init

Posted: Mon Mar 14, 2011 4:24 pm
by Keivan
I agree with what you said and your answer really helped me in some of my experiments. But still, I'm asking myself: maybe you do not understand my question? please let me explain more. consider the model is in the steady state and has a nonuniform RMP. I just want to save these values of RMP and load them next time I load the model. I want to save that 200 ms it takes to reach a steady state. (and maybe it do not work as I expect because there are many other parameters should be initialized as well). I just want to know how to do this and try it. at least in the computational world we are free to try things and play with them.

Re: How to set non-uniform v_init

Posted: Mon Mar 14, 2011 5:29 pm
by ted
I suppose that, once your model has reached its steady state, you could build a Vector that contains all of the membrane potentials

Code: Select all

objref allvm
allvm = new Vector()
forall for (x,0) allvm.append(v(x))
then write this vector to a file for future use. When you want to restore all the membrane potentials to these values, you could use an FInitializeHandler to call a proc like this:

Code: Select all

proc vrestore() { local ii
  ii = 0
  forall for (x,0) {
    v(x) = allvm.x[ii]
    ii+=1
  }
  finitialize()
  fcurrent()
}
But if any of the model parameters were changed, the cell will not be in its steady state.

Re: How to set non-uniform v_init

Posted: Tue Mar 15, 2011 5:19 am
by Keivan
Thank you very much ted. :)