Page 1 of 1

Explaination of PROCEDURES block in mod files

Posted: Wed Apr 13, 2011 4:57 am
by Linf
Hi NEURON Forum,

I am working on explaining how a particular '.mod' file is structured and works to a colleague.

I have written the following, with the help of a document from Hines, but get stuck when I get to describing the procedures block and how the "rates(v)" relates to that in the DERIVATIVES block. What does this rates(v) statement do? I presume it has some reference to the fact that the gating variables have voltage-dependent rates attached to it, but what does it play in the setting of the procedure and derivatives block?

Any corrections and/or additions to what I have written would be most useful :) also feel free to comment on my grammar!

Thanks,

Linford


****** (EXTRACT FROM) THE DOCUMENT THUS FAR ********
...

Each block of code within the file has its own title, for example the STATE- block, which has a functional and defining meaning, as well as a particular role in describing the said mechanism. Indeed, the block

Code: Select all

STATE {n l} 
describes variables which are unknowns in differential and algebraic equations specified within the file, and are to be calculated by the file. These variables are calculated via the ``SOLVE'' command within the BREAKPOINT- block. In our case, the state variables are $n$ and $l$, which correspond to the open probability state of the activation and inactivation gates of the A-channel, respectively. We can therefore envisage that the file will also contain differential equations describing the voltage-dependency of these functions using voltage dependent rate constants.

The BREAKPOINT block is the main computational block in the model; any states are integrated by the SOLVE- command. The BREAKPOINT block in our file contains the statements

Code: Select all

	gka = gkabar*n*l
	ik = gka*(v-ek)
which specifies that all currents are set by these formulas at the end of this block; namely, when a new timestep is computed, the new values of the $I_K$ (the total transmembrane potassium current) and $g_{kA}$ (the A-conductance) are defined and set by these statements.

The BREAKPOINT block contains state variables $n$ and $l$, which are to be solved within this block, but the definition and solution of which are yet unknown. These features are described in the DERIVATIVES and PROCEDURES blocks.

Statements, such as the voltage-dependent states of activation and inactivation gates, are governed by differential equations. The DERIVATIVE block is used to assign values to the derivatives of such states. In this file, the block looks as follows:

Code: Select all

DERIVATIVE states { 
        rates(v)
        n' = (ninf - n)/taun
        l' = (linf - l)/taul
These equations are integrated from old values of the states at time $t$, to their new values at time $t+Dt$, via the SOLVE statement in the BREAKPOINT block. Because the block is used to assign values to the derivatives of states, it must have some reference to the unknown functions $ninf$, $linf$, $taun$ and $taul$. These functions - steady-state and time-constant dependency of the A-channel gates - are referred to by the rates(v) command. This command is further defined in the PROCEDURES block.

Re: Explaination of PROCEDURES block in mod files

Posted: Wed Apr 13, 2011 5:29 pm
by ted
The "document" is probably this:
http://www.neuron.yale.edu/neuron/stati ... Statements
Please note that block names are all singular, not plural.
What does this rates(v) statement do?
It's a procedure call. Causes execution of the code in the rates() procedure. The code in rates() computes the values of intermediate variables ninf, taun, linf, and taul, which are used by subsequent statements in the DERIVATIVE block. Updates them to be consistent with the value of v at the current time.

Re: Explaination of PROCEDURES block in mod files

Posted: Thu Apr 14, 2011 4:14 am
by Linf
Thank you Ted, most helpful!