Dynamics

Base class

class dynamicalab.dynamics.BaseDynamics[source]

Base class for all dynamics processes. All dynamics have the __call__ method implemented.

Example

import networkx as nx
import dynamicalab.drawing as draw
import matplotlib.pyplot as plt

G = nx.erdos_renyi_graph(20,0.1)
T = np.arange(0,100)
dynamics = Dynamics()
X = dynamics(G, T)

X is a numpy array of shape (len(T), N).

__call__(G, T, x0=None)[source]

Generates a sequence of states for each time

Params

G : nx.Graph
Graph structure
T : list
List of times.
x0 : np.array(N) : (default=None)
Initial state of each node. The node index should match the node index in x0. If x0==None, the initial state is build using self.best_x0 method.

Returns

np.array(len(T), N) : Numpy array of activities

Available dynamics

All of the following dynamics inherit from BaseDynamics and have the same general usage as above.

SISDynamics Markovian discrete time Suceptible-infected-suceptible process on networks.
ThetaModelDynamics Theta model, or Ermentrout–Kopell canonical model, is a biological neuron model.
BernoulliDynamics Random binary dynamics with probability p of being active.