Defines a set of integration methods for both deterministic and stochastic differential equations.
will be consistent with Monitor periods corresponding to any of [4096, 2048, 1024, 512, 256, 128] Hz
# TODO: error analysis
The Integrator class is a base class for the integration methods...
[1] (1, 2, 3) Kloeden and Platen, Springer 1995, Numerical solution of stochastic differential equations.
[2] Riccardo Mannella, Integration of Stochastic Differential Equations on a Computer, Int J. of Modern Physics C 13(9): 1177–1194, 2002.
[3] R. Mannella and V. Palleschi, Fast and precise algorithm for computer simulation of stochastic differential equations, Phys. Rev. A 40: 3381, 1989.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.
Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
The IntegratorStochastic class is a base class for the stochastic integration methods. It derives from the Integrator abstract base class.
We consider a stochastic differential equation has the generic form:
\[\dot{X}_i(t) = dX_i(\vec{X}) + g_i(\vec{X}) \xi(t)\]where we assume that the stochastic process \(\xi\) is a Gaussian forcing. In the deterministic case, \(g(X)\) would be zero. The full algorithm, for one external stochastic forcing which is additive, is:
\[X_i(t) = X_i(0) + g_i(X) Z_1(t) + dX_i t + Z_2(t) dX_{i,k} g_k(X) + 0.5 dX_{i,jk} g_j(X) g_k(X) Z_3(t) + 0.5 t^2 dX_{i,j} dX_j\]where \(Z_1\), \(Z_2\) and \(Z_3\) are Gaussian variables, assuming the Einstein notation and defining:
\[dX_{i,j} = \frac{\partial dX_i}{\partial X_j}\]
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.
It is a simple example of a predictor-corrector method. It is also known as modified trapezoidal method, which uses the Euler method as its predictor. And it is also a implicit integration scheme.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
It is a simple example of a predictor-corrector method. It is also known as modified trapezoidal method, which uses the Euler method as its predictor.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
It is the simplest difference methods for the initial value problem. The recursive structure of Euler scheme, which evaluates approximate values to the Ito process at the discretization instants only, is the key to its successful implementation.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
It is the simplest difference methods for the initial value problem. The recursive structure of Euler scheme, which evaluates approximate values to the Ito process at the discretization instants only, is the key to its successful implementation.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Ones of the simplest time discrete approximations of an Ito process is Euler-Maruyama approximation, that satisfies the scalar stochastic differential equation (From [1], page 305):
in our case, \(noise = Z_1\)
cf. Equations 1.3 and 1.13, pages 305 and 306 respectively.
The Runge-Kutta method is a standard procedure with most one-step methods.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
The classical 4th order Runge-Kutta method is an explicit method. The 4th order Runge-Kutta methods are the most commonly used, representing a good compromise between accuracy and computational effort.
From [1], pages 289-290, cf. Equation 2.8
The Identity integrator does not apply any scheme to the provided dfun, only returning its results.
This allows the model to determine its stepping scheme directly, and may be used for difference equations and cellular automata.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
A stochastic variant of the Identity integrator. Together with time delays, this allows for MVAR models.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Provides a base class for integrators using SciPy’s ode class.
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
bounded_state_variable_indices : tvb.simulator.integrators.Integrator.bounded_state_variable_indices = NArray(label=”indices of the state variables to be bounded by the integrators within the boundaries in the boundaries’ values array”, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
state_variable_boundaries : tvb.simulator.integrators.Integrator.state_variable_boundaries = NArray(label=’The boundary values of the state variables’, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_indices : tvb.simulator.integrators.Integrator.clamped_state_variable_indices = NArray(label=’indices of the state variables to be clamped by the integrators to the values in the clamped_values array’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
clamped_state_variable_values : tvb.simulator.integrators.Integrator.clamped_state_variable_values = NArray(label=’The values of the state variables which are clamped ‘, dtype=float64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)