How to set non-uniform v_init
How to set non-uniform v_init
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?
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: How to set non-uniform v_init
Yes. But if you want to know how, you must first be very precise about what you are asking for.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?
Please tell me if I understand. You want the following to be true: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.
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
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).
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).
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
How to initialize to steady state
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.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.
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()
}
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
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.
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: How to set non-uniform v_init
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
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.
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: How to set non-uniform v_init
I suppose that, once your model has reached its steady state, you could build a Vector that contains all of the membrane potentialsthen 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:But if any of the model parameters were changed, the cell will not be in its steady state.
Code: Select all
objref allvm
allvm = new Vector()
forall for (x,0) allvm.append(v(x))
Code: Select all
proc vrestore() { local ii
ii = 0
forall for (x,0) {
v(x) = allvm.x[ii]
ii+=1
}
finitialize()
fcurrent()
}
Re: How to set non-uniform v_init
Thank you very much ted. :)