Operator Calculus, Co.
Browse Studio documentation
On this page

These operators share the coordinate mapping and timing controls documented on Stimulus Operators. Most entries use add_stimulus_operator(ctx, field, opts) with the operator-specific type shown below.

Chladni 🧩

add_stimulus_operator(ctx, field, opts)

Generate Chladni nodal-line patterns from rectangular plate modes. This is useful for standing-pattern visualizations, nodal masks, and plate-vibration-inspired forcing.

Method Signature

add_stimulus_operator(ctx, field, [options]) -> operator

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_chladni".

Mathematical Formulation

The underlying plate mode uses an antisymmetrized combination:

f(u,v)=cosâĄâ€‰âŖ(mĪ€uLx)cosâĄâ€‰âŖ(nĪ€vLy)−ÎŧcosâĄâ€‰âŖ(nĪ€uLx)cosâĄâ€‰âŖ(mĪ€vLy)f(u, v) = \cos\!\left(\frac{m\pi u}{L_x}\right)\cos\!\left(\frac{n\pi v}{L_y}\right) - \mu \cos\!\left(\frac{n\pi u}{L_x}\right)\cos\!\left(\frac{m\pi v}{L_y}\right)

and the operator writes a Gaussian band around the nodal set f(u,v)=0f(u,v)=0 with width line_width.

Parameters

Parameter Type Default Description
type string — Must be "stimulus_chladni"
mode_x integer 3 Plate mode number along local U
mode_y integer 5 Plate mode number along local V
plate_width double 2.0 Plate width LxL_x
plate_height double 2.0 Plate height LyL_y
mix double 1.0 Blend factor for the swapped mode pair
line_width double 0.18 Gaussian width around the nodal set

Plus shared coordinate mapping and timing parameters (amplitude, omega, phase, time_offset, rotation, scale_by_dt).

Examples

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_chladni",
    amplitude = 0.5,
    mode_x = 3,
    mode_y = 5
})

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_chladni",
    amplitude = 0.4,
    plate_width = 3.0,
    plate_height = 2.0,
    line_width = 0.1
})

Laplace-Beltrami 🧭

add_stimulus_operator(ctx, field, opts)

Generate analytic Laplace-Beltrami eigenmodes on a rectangle, flat torus, or cylinder. This is useful for modal demos on simple manifolds and geometry-aware basis functions.

Method Signature

add_stimulus_operator(ctx, field, [options]) -> operator

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_laplace_beltrami".

Mathematical Formulation

The operator evaluates an eigenfunction ÎĻm,n(u,v;M)\Phi_{m,n}(u,v; M) on the selected manifold manifold:

  • rectangle: centered Dirichlet sine modes
  • flat_torus: periodic complex phases
  • cylinder: periodic in uu, Dirichlet in vv

and injects

u(x,t)=A ÎĻm,n(u,v;M) ei(âˆ’Ī‰t+Ī•)u(\mathbf{x}, t) = A\,\Phi_{m,n}(u,v; M)\,e^{i(-\omega t + \phi)}

Parameters

Parameter Type Default Description
type string — Must be "stimulus_laplace_beltrami"
manifold enum "rectangle" rectangle, flat_torus, cylinder
mode_u integer 2 Eigenmode index along local U
mode_v integer 3 Eigenmode index along local V
extent_u double 2.0 Chart extent or period along local U
extent_v double 2.0 Chart extent or period along local V

Plus shared coordinate mapping and timing parameters (amplitude, omega, phase, time_offset, rotation, scale_by_dt).

Examples

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_laplace_beltrami",
    amplitude = 0.35,
    manifold = "flat_torus",
    mode_u = 2,
    mode_v = 3
})

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_laplace_beltrami",
    manifold = "cylinder",
    extent_u = 4.0,
    extent_v = 2.0
})

Wave Modes 🌊

add_stimulus_operator(ctx, field, opts)

Generate fixed-boundary standing-wave modes of the wave equation on a rectangular domain. This is useful for cavity eigenmodes, membrane/string demos, and modal initial conditions.

Method Signature

add_stimulus_operator(ctx, field, [options]) -> operator

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_wave_modes".

Mathematical Formulation

For rank-2 fields, the mode shape is

ÎĻm,n(u,v)=sinâĄâ€‰âŖ(mĪ€(uLu+12))sinâĄâ€‰âŖ(nĪ€(vLv+12))\Phi_{m,n}(u,v) = \sin\!\left(m\pi\left(\frac{u}{L_u} + \frac{1}{2}\right)\right) \sin\!\left(n\pi\left(\frac{v}{L_v} + \frac{1}{2}\right)\right)

with modal frequency

Ήm,n=cĪ€(mLu)2+(nLv)2\omega_{m,n} = c\pi\sqrt{\left(\frac{m}{L_u}\right)^2 + \left(\frac{n}{L_v}\right)^2}

and injected field A ÎĻm,n(u,v)ei(âˆ’Ī‰m,n(t+t0)+Ī•)A\,\Phi_{m,n}(u,v)e^{i(-\omega_{m,n}(t+t_0)+\phi)}.

Parameters

Parameter Type Default Description
type string — Must be "stimulus_wave_modes"
mode_u integer 2 Standing-mode index along local U
mode_v integer 3 Standing-mode index along local V
extent_u double 2.0 Domain extent along local U
extent_v double 2.0 Domain extent along local V
wave_speed double 1.0 Wave speed used to derive the modal frequency

Plus shared coordinate mapping and timing parameters (amplitude, phase, time_offset, rotation, scale_by_dt).

Examples

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_wave_modes",
    amplitude = 0.45,
    mode_u = 2,
    mode_v = 3,
    wave_speed = 1.1
})

ooc.add_stimulus_operator(ctx, field, {
    type = "stimulus_wave_modes",
    extent_u = 4.0,
    extent_v = 2.0,
    mode_u = 1,
    mode_v = 1
})