define continuous-updates on these variables, through differential equations

Equations are defined by multiline strings.

An Equation is a set of single lines in a string:

dx/dt=f:unit (differential equation)

x=f:unit (subexpression)

x:unit (parameter)

The equations may be defined on multiple lines (no explicit line continuation with \ is necessary).
Comments using # may also be included. Subunits are not allowed, i.e., one must write volt, not mV. This is
to make it clear that the values are internally always saved in the basic units, so no confusion can arise when getting
the values out of a NeuronGroup and discarding the units. Compound units are of course allowed as well (e.g. farad/meter**2).
There are also three special “units” that can be used: 1 denotes a dimensionless floating point variable,
boolean and integer denote dimensionless variables of the respective kind.

Some special variables are defined: t, dt (time) and xi (white noise).
Variable names starting with an underscore and a couple of other names that have special meanings under certain
circumstances (e.g. names ending in _pre or _post) are forbidden.

For stochastic equations with several xi values it is now necessary to make clear whether they correspond to the same
or different noise instantiations. To make this distinction, an arbitrary suffix can be used, e.g. using xi_1 several times
refers to the same variable, xi_2 (or xi_inh, xi_alpha, etc.) refers to another. An error will be raised if
you use more than one plain xi. Note that noise is always independent across neurons, you can only work around this
restriction by defining your noise variable as a shared parameter and update it using a user-defined function (e.g. with a custom_operation),
or create a group that models the noise and link to its variable (see Linked variables).

A flag is a keyword in parentheses at the end of the line, which
qualifies the equations. There are several keywords:

event-driven

this is only used in Synapses, and means that the differential equation should be updated
only at the times of events. This implies that the equation is taken out of the continuous
state update, and instead a event-based state update statement is generated and inserted into
event codes (pre and post).
This can only qualify differential equations of synapses. Currently, only one-dimensional
linear equations can be handled (see below).

unless refractory

this means the variable is not updated during the refractory period.
This can only qualify differential equations of neuron groups.

constant

this means the parameter will not be changed during a run. This allows
optimizations in state updaters. This can only qualify parameters.

shared

this means that a parameter or subexpression is not neuron-/synapse-specific
but rather a single value for the whole NeuronGroup or Synapses. A shared
subexpression can only refer to other shared variables.

Equations allow for the specification of values in the strings, but do this by simple
string replacement, e.g. you can do:

eqs=Equations('dx/dt = x/tau : volt',tau=10*ms)

but this is exactly equivalent to:

eqs=Equations('dx/dt = x/(10*ms) : volt')

The Equations object does some basic syntax checking and will raise an error if two equations defining
the same variable are combined. It does not however do unit checking, checking for unknown identifiers or
incorrect flags – all this will be done during the instantiation of a NeuronGroup or Synapses object.

Equations defining neuronal or synaptic equations can contain references to
external parameters or functions. These references are looked up at the time
that the simulation is run. If you don’t specify where to look them up, it
will look in the Python local/global namespace (i.e. the block of code where
you call run()). If you want to override this, you can specify an explicit
“namespace”. This is a Python dictionary with keys being variable names as
they appear in the equations, and values being the desired value of that
variable. This namespace can be specified either in the creation of the group
or when you can the run() function using the namespace keyword argument.

The following three examples show the different ways of providing external
variable values, all having the same effect in this case: