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.
Chladni 🧩
Section titled “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
Section titled “Method Signature”add_stimulus_operator(ctx, field, [options]) -> operatorReturns: Operator handle (userdata)
Note: Requires type = "stimulus_chladni".
Mathematical Formulation
Section titled “Mathematical Formulation”The underlying plate mode uses an antisymmetrized combination:
and the operator writes a Gaussian band around the nodal set with width line_width.
Parameters
Section titled “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 |
plate_height | double | 2.0 | Plate height |
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
Section titled “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 🧭
Section titled “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
Section titled “Method Signature”add_stimulus_operator(ctx, field, [options]) -> operatorReturns: Operator handle (userdata)
Note: Requires type = "stimulus_laplace_beltrami".
Mathematical Formulation
Section titled “Mathematical Formulation”The operator evaluates an eigenfunction on the selected manifold manifold:
- rectangle: centered Dirichlet sine modes
- flat_torus: periodic complex phases
- cylinder: periodic in , Dirichlet in
and injects
Parameters
Section titled “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
Section titled “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 🌊
Section titled “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
Section titled “Method Signature”add_stimulus_operator(ctx, field, [options]) -> operatorReturns: Operator handle (userdata)
Note: Requires type = "stimulus_wave_modes".
Mathematical Formulation
Section titled “Mathematical Formulation”For rank-2 fields, the mode shape is
with modal frequency
and injected field .
Parameters
Section titled “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
Section titled “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})