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
Ienters 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 anddt).- 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 samedt), or a custom callable stepperf(derivative, x, dt, *args) -> x_new.
- Raises:
ValueError – If
frequencyis negative orsolveris not a supported name.
Methods
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).