System module (tmrc.system)¶
Provides classes for defining dynamical systems of various types, and methods for generating simulation data of these systems.
-
class
tmrc.system.DriftDiffusionSystem(driftdiffusion, domain)¶ The drift diffusion system class
Implements a dynamical system whose movement is defined by generic drift and diffuion terms. Both drift and diffusion may be location and time-dependent.
-
domain¶ an array containing the limits of the system’s domain
Type: np.array
-
dimension¶ dimension of the system’s state space
Type: int
-
drift(np.array)¶ evaluates the drift term
-
diffusion(np.array)¶ evaluates the diffusion term
-
generateTrajectory(t, dt, r0)¶ computes a single trajectory (including the steps) using the Euler-Maruyama scheme
-
generateBurst(t, dt, r0, showprogress=True)¶ computes multiple trajectories (outputting only the end points) using the Euler-Maruyama scheme
-
generateTestPoints(n, dist='uniform')¶ samples the domain of the system
-
generateBurst(t, dt, r0, t0, showprogress=True) Computes in parallel multiple trajectories (outputting only the end points) using the Euler-Maruyama integration scheme.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – array containing the starting points
- t0 (float) – start time
- showprogress=True (bool) – flag for progress bar
Returns: rout – array containing the end points of the trajectories
Return type: np.array
-
generatePointclouds(t, dt, r0, t0, M, showprogress=True)¶ Computes the endpoints of multiple parallel trajectories for each starting point in the array r0 using the Euler-Maruyama integration scheme. Implemented as wrapper for generateBurst.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – array containing the starting points
- t0 (float) – starting time
- M (int) – number of simulations per starting point
- showprogress=True (bool) – flag for progress bar
Returns: pointclouds – 3D array containing pointcloud data (npoints x M x dim-array)
Return type: np.array
-
generateTrajectory(t, dt, r0, t0, showprogress=True) Computes a single trajectory (including the steps) using the Euler-Maruyama integration scheme.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – starting point
- t0 (float) – starting time
- showprogress=True (bool) – flag for progress bar
Returns: rout – array containing the steps of the integration
Return type: np.array
-
-
class
tmrc.system.GradientSystem(potential, domain, beta)¶ The gradient system class
Implements a dynamical system whose movement is defined by a gradient drift (i.e. pointing in the negative direction of the gradient of a potential energy function) and temperature-scaled isotropic noise.
-
domain¶ an array containing the limits of the system’s domain
Type: np.array
-
dimension¶ dimension of the system’s state space
Type: int
-
beta¶ inverse temperature
Type: float
-
potential(np.array)¶ evaluates the potential energy function
-
gradPot(np.array)¶ evaluates the gradient of the potential energy function
-
generateTrajectory(t, dt, r0)¶ computes a single trajectory (including the steps) using the Euler-Maruyama scheme
-
generateBurst(t, dt, r0, showprogress=True)¶ computes multiple trajectories (outputting only the end points) using the Euler-Maruyama scheme
-
generateTestPoints(n, dist='uniform')¶ samples the domain of the system
-
generateBurst(t, dt, r0, showprogress=True) Computes in parallel multiple trajectories (outputting only the end points) using the Euler-Maruyama integration scheme.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – array containing the starting points
- showprogress=True (bool) – flag for progress bar
Returns: rout – array containing the end points of the trajectories
Return type: np.array
-
generatePointclouds(t, dt, r0, M, showprogress=True)¶ Computes the endpoints of multiple parallel trajectories for each starting point in the array r0 using the Euler-Maruyama integration scheme. Implemented as wrapper for generateBurst.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – array containing the starting points
- M (int) – number of simulations per starting point
- showprogress=True (bool) – flag for progress bar
Returns: pointclouds – 3D array containing pointcloud data (npoints x M x dim-array)
Return type: np.array
-
generateTrajectory(t, dt, r0, showprogress=True) Computes a single trajectory (including the steps) using the Euler-Maruyama integration scheme.
Parameters: - t (float) – end time. Method integrates the system from 0 to t
- dt (float) – time step length of the integration
- r0 (np.array) – starting point
- showprogress=True (bool) – flag for progress bar
Returns: rout – array containing the steps of the integration
Return type: np.array
-
-
class
tmrc.system.System(domain)¶ Parent class for defining stochastic dynamical systems.
Only initializes some basic properties of a dynamical system. Other important properties depend on the specific kind of system.
-
domain¶ an array containing the limits of the system’s domain
Type: np.array
-
dimension¶ dimension of the system’s state space
Type: int
-
generateTestPoints(n, dist='uniform')¶ samples the domain of the system
-
generateTestpoints(n, dist='uniform')¶ Generates samples of the system’s state space
Parameters: - n (int) – number of points to generate
- dist='uniform' (string) – method of distribution the points. Can be either ‘uniform’ or ‘grid’
Returns: rsamp – array containing the generated sampling points
Return type: np.array
-