Skip to content
Oakfield Operator Calculus Function Reference Site

Stimulus: Modal Sources

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.

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.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_chladni".

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.

ParameterTypeDefaultDescription
typestring Must be "stimulus_chladni"
mode_xinteger 3Plate mode number along local U
mode_yinteger 5Plate mode number along local V
plate_widthdouble 2.0Plate width LxL_x
plate_heightdouble 2.0Plate height LyL_y
mixdouble 1.0Blend factor for the swapped mode pair
line_widthdouble 0.18Gaussian width around the nodal set

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

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
})

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.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_laplace_beltrami".

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)}
ParameterTypeDefaultDescription
typestring Must be "stimulus_laplace_beltrami"
manifoldenum "rectangle"rectangle, flat_torus, cylinder
mode_uinteger 2Eigenmode index along local U
mode_vinteger 3Eigenmode index along local V
extent_udouble 2.0Chart extent or period along local U
extent_vdouble 2.0Chart extent or period along local V

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

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
})

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.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_wave_modes".

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)}.

ParameterTypeDefaultDescription
typestring Must be "stimulus_wave_modes"
mode_uinteger 2Standing-mode index along local U
mode_vinteger 3Standing-mode index along local V
extent_udouble 2.0Domain extent along local U
extent_vdouble 2.0Domain extent along local V
wave_speeddouble 1.0Wave speed used to derive the modal frequency

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

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
})