# stateupdaters package

Module for transforming model equations into “abstract code” that can be then be further translated into executable code by the `codegen` module.

Exported members: `ExplicitStateUpdater`, `StateUpdateMethod`, `euler`, `exact`, `exponential_euler`, `gsl_rk2`, `gsl_rk4`, `gsl_rk8pd`, `gsl_rkck`, `gsl_rkf45`, `heun`, `independent`, `linear`, `milstein`, `rk2`, `rk4`

## `GSL` module

Module containg the StateUpdateMethod for integration using the ODE solver provided in the GNU Scientific Library (GSL)

Exported members: `gsl_rk2`, `gsl_rk4`, `gsl_rk8pd`, `gsl_rkck`, `gsl_rkf45`

Classes

`GSLContainer`(method_options, integrator[, ...]) | Class that contains information (equation- or integrator-related) required for later code generation

`GSLStateUpdater`(integrator) | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

Objects

`gsl_rk2` | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

`gsl_rk4` | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

`gsl_rk8pd` | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

`gsl_rkck` | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

`gsl_rkf45` | A statupdater that rewrites the differential equations so that the GSL generator knows how to write the code in the target language.

## `base` module

This module defines the `StateUpdateMethod` class that acts as a base class for all stateupdaters and allows to register stateupdaters so that it is able to return a suitable stateupdater object for a given set of equations. This is used for example in `NeuronGroup` when no state updater is given explicitly.

Exported members: `StateUpdateMethod`

Classes

`StateUpdateMethod`() |

`UnsupportedEquationsException` |

Functions

`extract_method_options`(method_options, ...) | Helper function to check `method_options` against options understood by this state updater, and setting default values for all unspecified options.

## `exact` module

Exact integration for linear equations.

Exported members: `exact`, `independent`, `linear`

Classes

`IndependentStateUpdater`() | A state update for equations that do not depend on other state variables, i.e. 1-dimensional differential equations.

`LinearStateUpdater`() | A state updater for linear equations.

Functions

`get_linear_system`(eqs, variables) | Convert equations into a linear system using sympy.

Objects

`exact` | A state updater for linear equations.

`independent` | A state update for equations that do not depend on other state variables, i.e. 1-dimensional differential equations.

`linear` | A state updater for linear equations.

## `explicit` module

Numerical integration functions.

Exported members: `ExplicitStateUpdater`, `euler`, `heun`, `milstein`, `rk2`, `rk4`

Classes

`ExplicitStateUpdater`(description[, ...]) | An object that can be used for defining state updaters via a simple description (see below).

Functions

`diagonal_noise`(equations, variables) | Checks whether we deal with diagonal noise, i.e. one independent noise variable per variable.

`split_expression`(expr) | Split an expression into a part containing the function `f` and another one containing the function `g`.

Objects

`euler` | Forward Euler state updater

`heun` | Stochastic Heun method (for multiplicative Stratonovic SDEs with non-diagonal diffusion matrix)

`milstein` | Derivative-free Milstein method

`rk2` | Second order Runge-Kutta method (midpoint method)

`rk4` | Classical Runge-Kutta method (RK4)

## `exponential_euler` module

Exported members: `exponential_euler`

Classes

`ExponentialEulerStateUpdater`() | A state updater for conditionally linear equations, i.e. equations where each variable only depends linearly on itself (but possibly non-linearly on other variables).

Functions

`get_conditionally_linear_system`(eqs[, variables]) | Convert equations into a linear system using sympy.

Objects

`exponential_euler` | A state updater for conditionally linear equations, i.e. equations where each variable only depends linearly on itself (but possibly non-linearly on other variables).