StuartLandauStep#

class brainmass.StuartLandauStep(in_size, a=0.25, w=0.2, noise_x=None, noise_y=None, init_x=Uniform(low=0, high=0.05), init_y=Uniform(low=0, high=0.05), method='exp_euler')#

Stuart–Landau oscillator (Hopf normal form).

Implements the real two-dimensional Stuart–Landau equations that describe dynamics near a supercritical Hopf bifurcation:

\[\dot x = (a - r^2)\,x - \omega\,y + I_x(t),\quad r^2 = x^2 + y^2,\]
\[\dot y = (a - r^2)\,y + \omega\,x + I_y(t),\]

where \(a\) controls the bifurcation (for \(a>0\) the system exhibits a stable limit cycle) and \(\omega\) is the angular frequency.

Parameters:
  • in_size (int | Sequence[int] | integer | Sequence[integer]) – Spatial shape of the node/population. Can be an int or a tuple of int. All parameters are broadcastable to this shape.

  • a (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Bifurcation parameter (dimensionless). Default is 0.25.

  • w (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Angular frequency \(\omega\) (dimensionless). Default is 0.2.

  • noise_x (Noise) – Additive noise process for the x component. If provided, called at each update and added to x_inp. Default is None.

  • noise_y (Noise) – Additive noise process for the y component. If provided, called at each update and added to y_inp. Default is None.

  • init_x (Callable) – Parameter for the state x. Default is braintools.init.Uniform(0, 0.05).

  • init_y (Callable) – Parameter for the state y. Default is braintools.init.Uniform(0, 0.05).

  • method (str) – Time stepping method. One of 'exp_euler' (default; uses brainstate.nn.exp_euler_step) or any supported by braintools.quad (e.g., 'rk4', 'midpoint', 'heun', 'euler').

Return type:

Any

x#

State container for the real component x (dimensionless). Shape equals (batch?,) + in_size after init_state.

Type:

brainstate.HiddenState

y#

State container for the imaginary component y (dimensionless). Shape equals (batch?,) + in_size after init_state.

Type:

brainstate.HiddenState

Notes

  • Time derivatives returned by dx() and dy() carry unit 1/ms to be consistent with explicit (exponential) Euler integration for a step size with unit ms.

  • Integration, state initialization, and noise handling are implemented in the base class XY_Oscillator.

  • Implementation detail: verify the cross-coupling term in dy() matches the intended normal form (the standard form uses + w * x).

dx(x, y, x_ext)[source]#

Right-hand side for the x component.

Parameters:
  • x (array-like) – Current value of x (dimensionless).

  • y (array-like) – Current value of y (dimensionless), broadcastable to x.

  • x_ext (array-like or scalar) – External input to x (includes noise if enabled).

Returns:

Time derivative dx/dt with unit 1/ms.

Return type:

array-like

dy(y, x, y_ext)[source]#

Right-hand side for the y component.

Parameters:
  • y (array-like) – Current value of y (dimensionless).

  • x (array-like) – Current value of x (dimensionless), broadcastable to y.

  • y_ext (array-like or scalar) – External input to y (includes noise if enabled).

Returns:

Time derivative dy/dt with unit 1/ms.

Return type:

array-like