Page 1 of 1

Assignments in time and time-dependent functions

Posted: Wed Feb 16, 2022 6:40 pm
by duytanph
Hello, I'd like to ask if two separate functionalities are supported in RxD:
(1) Assignment of a variable by an explicit algebraic equation (rather than a derivative) at every timestep
(2) Assignment of a variable (or rate) by a time-dependent function

To illustrate, I have a snippet of code that accomplishes this in NMODL:

Code: Select all

BREAKPOINT {
  SOLVE states METHOD cnexp
}

DERIVATIVE states {
  E = E0*exp(-t/tau_in)
  Ve = (kcat*E*S)/((1+H/Ka)*(Km + S + S*S/Ki))
  S' = alpha*S0*exp(-delta*(t)) - Ve
  H' = Ve - beta*H
}
(Equations are from Varfolomeev et al. 2020, Kinetic modeling of dynamic processes in the cholinergic synapse)

From above, there are 3 species: E, S, and H.

Ve is an intermediate variable that is calculated at every timestep in order to calculate S' and H', which is a function of the concentrations of the 3 species at the current timestep (and other constant parameters).

E is assigned a value based on exponential decay at every timestep (i.e., not a differential equation).

S' is the derivative of S which contains a time-dependent function -- another exponential decay.

My question is essentially asking if there is an equivalent way in RxD to:
(i) refer to the time variable (like 't' in NMODL) in assignments as in the "E" variable.
(ii) create assignment definitions that are explicitly algebraic (ie, not a derivative) as in the "Ve" variable.
(iii) create assignments including external functions such as exp().

Thank you, and I appreciate any assistance on this matter.

Re: Assignments in time and time-dependent functions

Posted: Thu Feb 17, 2022 12:33 am
by ted
If you're interested in simulating anything more than "single shot synaptic activations" of the kind illustrated in figs 1-3 and 7 of V. et al., you'll probably want to use NMODL to implement an event-driven synaptic mechanism that can respond to a series of two or more presynaptic spikes.

Re: Assignments in time and time-dependent functions

Posted: Sat Apr 02, 2022 5:35 pm
by ramcdougal
Unfortunately rxd doesn't directly support expressions that depend on time.

Algebraic expressions should just work. (There's an example of this in the documentation linked below.)

For math functions, you'll want to use rxdmath see the rxdmath discussion in the documentation