pyeeg.simulate.Phasor

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

One-dimensional phase oscillator with sinusoidal readout.

The phase \(\phi\) evolves according to \(\dot{\phi} = \omega + I\) where \(\omega = 2 \pi f\), and the readout is \(\sin(\phi)\).

Parameters:
  • 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), "euler-maruyama" or "em" (aliases of "euler": with noise the scheme is Euler-Maruyama), "rk4" (classical fourth-order Runge-Kutta), 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

Phasor.read_out()

Return the scalar readout of the oscillator.

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

Simulate the oscillator and return its phase and readout.

Phasor.step([I, noise])

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