pyeeg.simulate.HopfOscillator

class pyeeg.simulate.HopfOscillator(a=0.01, frequency=10.0, dt=0.001, seed=42, solver='euler')

Two-dimensional Stuart-Landau (Hopf normal-form) oscillator.

The state (x, y) evolves according to

\[\dot{x} = (a - r^2) x - \omega y + I, \quad \dot{y} = (a - r^2) y + \omega x\]

with \(r^2 = x^2 + y^2\) and \(\omega = 2 \pi f\). The input I enters the \(x\) equation only. For \(a > 0\) the origin is unstable and the oscillator converges to a limit cycle of radius \(\sqrt{a}\) at frequency \(f\) (in continuous time; the radius of the discrete limit cycle depends on the integration scheme and dt).

Parameters:
  • a (float) – The bifurcation parameter. Positive values yield a stable limit cycle, negative values a damped oscillator.

  • frequency (float) – The oscillation frequency in Hz. Must be non-negative.

  • dt (float) – The integration time step in seconds.

  • seed (int) – The random seed used to initialise the node’s random number generator.

  • solver (str or callable) – Integration scheme used by step(): "euler" (explicit Euler, the default and historical behaviour), "euler-maruyama" or "em" (aliases of "euler": with noise the scheme is Euler-Maruyama), "rk4" (classical fourth-order Runge-Kutta, far more accurate for the same dt), or a custom callable stepper f(derivative, x, dt, *args) -> x_new.

Raises:

ValueError – If frequency is negative or solver is not a supported name.

Methods

HopfOscillator.read_out()

Return the scalar readout of the oscillator.

HopfOscillator.simulate([x0, tmax, noise, I])

Simulate the oscillator and return its states and readout.

HopfOscillator.step([I, noise])

Advance the oscillator by one integration step (the configured solver).