ContinuousStateBase#

class graph_tool.dynamics.ContinuousStateBase(g, make_state, params, t0=0, s=None, stype='double')[git][source]#

Bases: object

Base state for continuous-time dynamics. This class is not meant to be instantiated directly.

Methods

copy()

Return a copy of the state.

get_diff(dt)

Returns the current time derivative for all the nodes.

get_state()

Returns the internal VertexPropertyMap with the current state.

solve(t, *args, **kwargs)

Integrate the system up to time t.

solve_euler(t[, dt])

Integrate the system up to time t using a simple Euler's method (Euler-Maruyama for the noise terms) with step size dt.

copy()[git][source]#

Return a copy of the state.

get_diff(dt)[git][source]#

Returns the current time derivative for all the nodes. The parameter dt is the time interval in consideration, which is used only if the ODE has a stochastic component: if dt > 0, the noise term of each node is sampled with variance \(1/\mathrm{dt}\), so that the increment over the interval has variance proportional to dt, and if dt == 0 the noise term is omitted.

The returned array is a view of an internal buffer, which is overwritten by the next call.

Parallel implementation.

If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.

get_state()[git][source]#

Returns the internal VertexPropertyMap with the current state.

solve(t, *args, **kwargs)[git][source]#

Integrate the system up to time t. The remaining parameters are passed to scipy.integrate.solve_ivp(). This solver is not suitable for stochastic ODEs, since the noise terms are omitted.

solve_euler(t, dt=0.001)[git][source]#

Integrate the system up to time t using a simple Euler’s method (Euler-Maruyama for the noise terms) with step size dt. This solver is suitable for stochastic ODEs.

If the interval is not a multiple of dt, the step size is reduced to the nearest value that divides it evenly, so that the integration ends exactly at time t.