Heun

experimental.network_dynamics.solvers.Heun()

Heun’s method (improved Euler).

Two-stage method with predictor-corrector structure. For SDEs: Stochastic Heun method.

Note: Uses coupling assumption that coupling is slow relative to dt, so we can reuse the same coupling for both stages.

Methods

Name Description
step Heun integration step with predictor-corrector.

step

experimental.network_dynamics.solvers.Heun.step(
    dynamics_fn,
    t,
    state,
    dt,
    params,
    noise_sample=0.0,
)

Heun integration step with predictor-corrector.

Args: dynamics_fn: Dynamics function (t, state, params) -> (derivatives, auxiliaries) Same coupling used for both evaluations t: Current time state: Current state [n_states, n_nodes] dt: Time step params: Parameters noise_sample: Pre-scaled noise increment

Returns: Tuple of (next_state, auxiliaries): - next_state: Next state [n_states, n_nodes] - auxiliaries: Auxiliary variables from FIRST evaluation [n_auxiliaries, n_nodes] (represents valid state at current time t)