Add a VClamp of a specific form.

NMODL and the Channel Builder.
Post Reply
cassiehu
Posts: 35
Joined: Tue Sep 06, 2022 10:41 am

Add a VClamp of a specific form.

Post by cassiehu »

Hi, I am here looking for help again.
What I want to do is add a particular VClamp which is a function of a parameter. The details are shown in the following code.

Code: Select all

v(t)=1/(1+exp(-6.5(x(t)-1)))
x is a variable changing with time(or we can understand that it is a practical physical parameter that we can measure based on a physical model). Then I link the voltage with this variable to set the VClamp input of my NEURON model. I know that this might not be consistant with true biological theory. It is just an experiment assumption I want to make. I have checked the source code of built-in VClamp.mod from GitHub. But it is a little difficult for me to understand, it seemed that there are much more parameters to be needed than this model. So I want to ask that what should I write in a mod file to insert this VClamp.
In addition, x can be regarded as a constant in a small period of time. What I mean is that the running of NEURON model is repeated again and again, but in every time of simulation, x can be given a certain value or a constant value. Therefore, I think x can be in PARAMETER module of mod file, right?
Looking forward to your reply very much! Thank you for your patience and help again.
cassiehu
Posts: 35
Joined: Tue Sep 06, 2022 10:41 am

Re: Add a VClamp of a specific form.

Post by cassiehu »

Is this right? I do not know what should I do with current i, it seemed that it does not have to appear in the .mod.

Code: Select all

COMMENT
An event-driven voltage source that delivers an electrode voltage which is changing with x.
Arrival of an event with value x instantaneously perturbs the voltage by 1/(1+exp(-k*(x-1))) mV.

Developed by HKX based on IClamp.
ENDCOMMENT

NEURON {
        POINT_PROCESS VClamp
        RANGE k,x,i,dur
        ELECTRODE_CURRENT i
}

UNITS {
        (nA) = (nanoamp)
        (mV) = (millivolt)
	(uS) = (microsiemens)
}

PARAMETER {
        x
        dur (ms) < 0, 1e9 >
}

ASSIGNED {
        v (mV)
}

INITIAL {
        v=0
}

BREAKPOINT {
        if (t < dur && t > 0) {
        v = 1/(1+exp(-k*(x-1)))
        } else {
        v = 0
        }
}

ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Add a VClamp of a specific form.

Post by ted »

It's almost never a good idea to tinker with NMODL files. The best way to do what you propose is to fill a pair of vectors with a series of t, f(t) values and then use Vector.play to use these vectors to drive the time course of an SEClamp's v variable. See the Programmer's Reference for documentation of the SEClamp class and the Vector class.
cassiehu
Posts: 35
Joined: Tue Sep 06, 2022 10:41 am

Re: Add a VClamp of a specific form.

Post by cassiehu »

OK. I have read the content of SEClamp in Programmer's guide. And I basically understand how to use it. Thank you very much!
Post Reply