ContinuousStateBase#
- class graph_tool.dynamics.ContinuousStateBase(g, make_state, params, t0=0, s=None, stype='double')[git][source]#
Bases:
objectBase 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.
Returns the internal
VertexPropertyMapwith the current state.solve(t, *args, **kwargs)Integrate the system up to time
t.solve_euler(t[, dt])Integrate the system up to time
tusing a simple Euler's method (Euler-Maruyama for the noise terms) with step sizedt.- get_diff(dt)[git][source]#
Returns the current time derivative for all the nodes. The parameter
dtis the time interval in consideration, which is used only if the ODE has a stochastic component: ifdt > 0, the noise term of each node is sampled with variance \(1/\mathrm{dt}\), so that the increment over the interval has variance proportional todt, and ifdt == 0the 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
VertexPropertyMapwith the current state.
- solve(t, *args, **kwargs)[git][source]#
Integrate the system up to time
t. The remaining parameters are passed toscipy.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
tusing a simple Euler’s method (Euler-Maruyama for the noise terms) with step sizedt. 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 timet.