Skip to content
Oakfield Operator Calculus Function Reference Site

Stimulus: Beam & Wavelet Families

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 a pure Gaussian envelope without carrier oscillation. Models localized pulses, initial conditions, and smooth spatial masks.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_gaussian_pulse".

1D:

u(x,t)=Aexp((xx0vt)22σ2)u(x, t) = A \cdot \exp\left(-\frac{(x - x_0 - v \cdot t)^2}{2\sigma^2}\right)

2D separable:

u(x,y,t)=Aexp((xx0vxt)22σx2(yy0vyt)22σy2)u(x, y, t) = A \cdot \exp\left(-\frac{(x - x_0 - v_x t)^2}{2\sigma_x^2} - \frac{(y - y_0 - v_y t)^2}{2\sigma_y^2}\right)
ParameterTypeDefaultRangeDescription
typestring Must be "stimulus_gaussian_pulse"
amplitudedouble unboundedPeak amplitude (required)
center_x, center_ydouble 0.0unbounded1D/2D center position
sigma_x, sigma_ydouble 1.0>01D/2D standard deviations
velocity_x, velocity_ydouble 0.0unbounded1D/2D velocities
time_offsetdouble 0.0unboundedTemporal shift
rotationdouble 0.0unboundedComplex phase rotation

Plus timing parameters.

-- Static 1D Gaussian
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gaussian_pulse",
coord_center_x = 128,
sigma_x = 30,
amplitude = 1.0
})
-- Moving pulse
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gaussian_pulse",
coord_center_x = 0,
sigma_x = 10,
amplitude = 0.5,
velocity_x = 2.0
})
-- 2D elliptical Gaussian
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gaussian_pulse",
amplitude = 0.8,
coord_mode = "separable",
coord_center_x = 128,
coord_center_y = 128,
sigma_x = 20,
sigma_y = 40
})

add_stimulus_operator(ctx, field, opts)

Generate a Gaussian-windowed sinusoid (Gabor function). Optimal for joint time-frequency localization and models neural receptive fields.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_gabor".

1D:

u(x,t)=Aexp((xx0vt)22σ2)sin(k(xx0)ωt+ϕ)u(x, t) = A \cdot \exp\left(-\frac{(x - x_0 - vt)^2}{2\sigma^2}\right) \cdot \sin(k(x - x_0) - \omega t + \phi)

2D with envelope rotation:

u(x,y,t)=Aexp(x22σx2y22σy2)sin(kxx+kyyωt+ϕ)u(x, y, t) = A \cdot \exp\left(-\frac{x'^2}{2\sigma_x^2} - \frac{y'^2}{2\sigma_y^2}\right) \cdot \sin(k_x x' + k_y y' - \omega t + \phi)

where (x,y)(x', y') are coordinates rotated by envelope_angle.

ParameterTypeDefaultRangeDescription
typestring Must be "stimulus_gabor"
amplitudedouble unboundedPeak amplitude (required)
wavenumberdouble unboundedCarrier wavenumber
omegadouble 0.0unboundedCarrier frequency
phasedouble 0.0unboundedCarrier phase
center_x, center_ydouble 0.0unbounded1D/2D center
sigma_x, sigma_ydouble 1.0>01D/2D envelope widths
velocity_x, velocity_ydouble 0.0unbounded1D/2D velocities
envelope_angledouble 0.0unboundedEnvelope rotation (radians)
rotationdouble 0.0unboundedComplex output rotation
time_offsetdouble 0.0unboundedTemporal shift

Plus timing parameters.

-- 1D Gabor wavelet
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gabor",
amplitude = 0.4,
sigma_x = 12.0,
wavenumber = 0.5
})
-- Moving Gabor pulse
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gabor",
amplitude = 0.2,
omega = 0.5,
rotation = 0.3,
coord_center_x = 64,
sigma_x = 20,
velocity_x = 1.0
})
-- 2D oriented Gabor (receptive field model)
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_gabor",
amplitude = 0.5,
coord_mode = "separable",
coord_center_x = 128,
coord_center_y = 128,
sigma_x = 15,
sigma_y = 30,
wavenumber = 0.3,
envelope_angle = math.pi / 4
})

add_stimulus_operator(ctx, field, opts)

Generate a multi-scale Morlet wavelet packet field: a superposition of Gaussian-windowed complex sinusoids at geometrically-spaced spatial scales. Supports drifting center position, orientation control, and explicit coordinate mapping.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_morlet_field".

Each scale ss contributes a complex Morlet atom at effective time τ=t+time_offset\tau = t + \text{time\_offset}:

ψs(x,τ)=exp ⁣(ur2+vr22σs2)exp ⁣(i(ksurωτ+ϕ))\psi_s(\mathbf{x}, \tau) = \exp\!\left(-\frac{u_r^2 + v_r^2}{2\sigma_s^2}\right)\cdot \exp\!\left(i\left(k_s u_r - \omega \tau + \phi\right)\right)

where rotated local coordinates are

[urvr]=Rθ(τ)([uv][cu+vuτcv+vvτ]),θ(τ)=orientation+orientation_rateτ.\begin{bmatrix}u_r\\v_r\end{bmatrix} = R_{\theta(\tau)} \left(\begin{bmatrix}u\\v\end{bmatrix} -\begin{bmatrix}c_u + v_u\tau\\c_v + v_v\tau\end{bmatrix}\right), \quad \theta(\tau)=\text{orientation}+\text{orientation\_rate}\cdot\tau.

with per-scale definitions:

  • ks=k0γksk_s = k_0 \cdot \gamma_k^s (base_wavenumber × scale_growths^s)
  • σs=σ0γσs\sigma_s = \sigma_0 \cdot \gamma_\sigma^s (sigma_base × sigma_growths^s)

When zero_mean = true, the implementation subtracts the standard Morlet correction from the real carrier term only:

 ⁣[ei(ksurωτ+ϕ)]cos ⁣(ksurωτ+ϕ)exp ⁣((σsks)22)\Re\!\left[e^{i\left(k_su_r-\omega\tau+\phi\right)}\right] \rightarrow \cos\!\left(k_su_r-\omega\tau+\phi\right) - \exp\!\left(-\frac{(\sigma_s k_s)^2}{2}\right)

The injected write is normalized by scale count:

Δu(x,t)=ASs=0S1ψs(0)(x,t)\Delta u(\mathbf{x}, t) = \frac{A}{\sqrt{S}}\sum_{s=0}^{S-1}\psi_s^{(0)}(\mathbf{x}, t)

For real fields, only [Δu]\Re[\Delta u] is added. For complex fields, both real and imaginary parts are added, then rotation is applied.

ParameterTypeDefaultRangeDescription
typestring Must be "stimulus_morlet_field"
amplitudedouble 0.0unboundedOverall amplitude (0.0 writes nothing)
scalesinteger 41..64Number of Morlet scales SS (clamped to 64)
base_wavenumberdouble 1.0unboundedCarrier wavenumber at scale 0 (rad/unit)
scale_growthdouble 2.0nonzeroGeometric growth of carrier wavenumber γk\gamma_k (absolute value used; zero falls back to default)
sigma_basedouble 0.75(0, 8]Gaussian envelope width at scale 0
sigma_growthdouble 1.5nonzeroGeometric growth of envelope width γσ\gamma_\sigma (absolute value used; zero falls back to default)
center_udouble 0.0unboundedWavelet center along local u coordinate
center_vdouble 0.0unboundedWavelet center along local v coordinate
velocity_udouble 0.0unboundedCenter drift velocity along u (units/s)
velocity_vdouble 0.0unboundedCenter drift velocity along v (units/s)
orientationdouble 0.0unboundedWavelet orientation angle (radians)
orientation_ratedouble 0.0unboundedOrientation drift rate (rad/s)
omegadouble 0.0unboundedTemporal angular frequency (rad/s)
phasedouble 0.0unboundedGlobal phase offset (radians)
time_offsetdouble 0.0unboundedAdditional time shift
rotationdouble 0.0unboundedComplex phase rotation on output (radians)
zero_meanboolean trueApply Morlet zero-mean correction
scale_by_dtboolean falseScale writes by dt
use_wavevectorboolean falseEvaluate in (kx,ky) wavevector frame (also auto-enabled if nonzero kx or ky is provided)
kx, kydouble 0.0unboundedWavevector components; if wavevector mode is active and both are zero, runtime uses (1, 0)

Plus coordinate mapping parameters (coord_mode, coord_axis, coord_combine, coord_angle, origin_x/y, spacing_x/y, coord_center_x/y, coord_velocity_x/y, spiral params).

-- Basic 5-scale Morlet wavelet field
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_morlet_field",
amplitude = 0.8,
scales = 5,
base_wavenumber = 1.2,
sigma_base = 0.75
})
-- Oriented and drifting Morlet
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_morlet_field",
amplitude = 0.6,
scales = 4,
base_wavenumber = 1.0,
orientation = math.pi / 4,
velocity_u = 0.5
})
-- Slowly rotating wavelet field
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_morlet_field",
amplitude = 0.5,
scales = 6,
base_wavenumber = 0.8,
scale_growth = 1.8,
sigma_base = 0.9,
orientation_rate = 0.15
})
-- High-sigma broad envelope with temporal oscillation
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_morlet_field",
amplitude = 0.4,
scales = 3,
base_wavenumber = 2.0,
sigma_base = 1.5,
sigma_growth = 1.2,
omega = 0.5
})

add_stimulus_operator(ctx, field, opts)

Generate a multi-scale steerable wavelet stimulus using Simoncelli or Riesz wavelet families. Provides direction-selective, multi-resolution spatial structure with controllable angular bandwidth and orientation.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_steerable_wavelet".

Each scale ss contributes a steerable filter response at orientation α\alpha:

Simoncelli family (raised cosine in log-polar frequency):

Hs(k,θ)=L(k/ks)B(θα)nH_s(k, \theta) = L(k/k_s) \cdot B(\theta - \alpha)^n

Riesz family (order-nn Riesz transform):

Hs(n)(k,θ)=L(k/ks)einθH_s^{(n)}(k, \theta) = L(k/k_s) \cdot e^{in\theta}

where:

  • L()L(\cdot) is the log-radius Gaussian with bandwidth radial_bandwidth
  • B()nB(\cdot)^n is the angular envelope raised to order
  • ks=k0γsk_s = k_0 \cdot \gamma^s is the per-scale wavenumber
  • α=orientation+orientation_ratet\alpha = \text{orientation} + \text{orientation\_rate} \cdot t

The spatial-domain output is the sum over SS scales:

u(x,t)=As=0S1F1 ⁣[Hsf^](x)u(\mathbf{x}, t) = A \sum_{s=0}^{S-1} \mathcal{F}^{-1}\!\left[H_s \cdot \hat{f}\right](\mathbf{x})

evaluated at each pixel by direct synthesis (not via FFT).

ParameterTypeDefaultRangeDescription
typestring Must be "stimulus_steerable_wavelet"
amplitudedouble unboundedOverall amplitude (required)
wavelet_familyenum "simoncelli"see belowSteerable wavelet family
orderinteger 1≥1Steering order (angular harmonic)
scalesinteger 4≥1Number of radial scales SS
base_wavenumberdouble 1.0unboundedBase radial wavenumber at scale 0 (rad/unit)
scale_growthdouble 2.0(0, 8]Geometric growth factor between scales
radial_bandwidthdouble 0.65[0.05, 4]Log-radius Gaussian bandwidth
angular_sharpnessdouble 1.0[0.1, 16]Angular envelope sharpness
orientationdouble 0.0unboundedSteering orientation angle (radians)
orientation_ratedouble 0.0unboundedAngular steering drift rate (rad/s)
omegadouble 0.0unboundedTemporal angular frequency (rad/s)
phasedouble 0.0unboundedGlobal phase offset across scales (radians)
time_offsetdouble 0.0unboundedAdditional time shift
rotationdouble 0.0unboundedComplex phase rotation on output (radians)
scale_by_dtboolean falseScale writes by dt
use_wavevectorboolean falseEvaluate in (kx,ky) wavevector frame
kx, kydouble 0.0unboundedWavevector components (when use_wavevector = true)

Wavelet family options: simoncelli, riesz

Plus coordinate mapping parameters.

-- Basic Simoncelli steerable wavelet
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_steerable_wavelet",
amplitude = 0.7,
wavelet_family = "simoncelli",
scales = 4,
order = 2
})
-- Riesz family with high steering order
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_steerable_wavelet",
amplitude = 0.6,
wavelet_family = "riesz",
order = 3,
scales = 5,
orientation = math.pi / 6
})
-- Slowly rotating steerable wavelet
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_steerable_wavelet",
amplitude = 0.5,
wavelet_family = "simoncelli",
scales = 4,
order = 2,
orientation_rate = 0.2,
angular_sharpness = 2.0
})
-- Narrow-band single-scale Riesz
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_steerable_wavelet",
amplitude = 0.4,
wavelet_family = "riesz",
scales = 1,
base_wavenumber = 1.5,
radial_bandwidth = 0.3,
order = 4
})

add_stimulus_operator(ctx, field, opts)

Inject a diffusing Gaussian heat kernel whose width grows over time according to the heat equation. This is useful for thermal diffusion demos, broadening pulses, and soft sources that spread as the simulation advances.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_heat_kernel".

The kernel broadens over time as

σeff(t)2=σ02+2Dmax(t+t0,0)\sigma_{\mathrm{eff}}(t)^2 = \sigma_0^2 + 2D \max(t + t_0, 0)

and the injected profile is

u(x,t)=Aexp ⁣(xc(t)22σeff(t)2)u(\mathbf{x}, t) = A \exp\!\left(-\frac{|\mathbf{x} - \mathbf{c}(t)|^2}{2\sigma_{\mathrm{eff}}(t)^2}\right)

with optional mass preservation multiplying by σ0/σeff(t)\sigma_0 / \sigma_{\mathrm{eff}}(t).

ParameterTypeDefaultDescription
typestring Must be "stimulus_heat_kernel"
diffusivitydouble 0.0Heat diffusivity controlling spread rate
sigma_xdouble 1.0Initial width along X/local U
sigma_ydouble 1.0Initial width along Y/local V
preserve_massboolean falsePreserve integrated mass as the kernel broadens

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

-- Diffusing thermal packet
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_heat_kernel",
amplitude = 0.5,
diffusivity = 0.15,
sigma_x = 8.0
})
-- Mass-preserving anisotropic spread
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_heat_kernel",
amplitude = 0.4,
diffusivity = 0.08,
sigma_x = 4.0,
sigma_y = 12.0,
preserve_mass = true
})

add_stimulus_operator(ctx, field, opts)

Generate an optical vortex beam with a phase singularity and topological charge. This is useful for orbital-angular-momentum demos, dark-core beam patterns, and rotational phase structure.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_optical_vortex".

In a local beam frame,

u(x,t)=Aρleρ2/2ei(lθωt+ϕ)u(\mathbf{x}, t) = A\,\rho^{|l|} e^{-\rho^2/2} e^{i(l\theta - \omega t + \phi)}

where ll is the integer charge, ρ\rho is the normalized radial coordinate set by waist_x and waist_y, and θ\theta is the local polar angle.

ParameterTypeDefaultDescription
typestring Must be "stimulus_optical_vortex"
chargeinteger 1Topological charge controlling phase winding
waist_xdouble 0.75Beam waist along local U
waist_ydouble 0.75Beam waist along local V
center_u, center_vdouble 0.0Beam center in the local frame
velocity_u, velocity_vdouble 0.0Beam-center drift velocity
orientationdouble 0.0Beam orientation angle
orientation_ratedouble 0.0Beam orientation drift rate

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_optical_vortex",
amplitude = 0.6,
charge = 1,
waist_x = 0.8
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_optical_vortex",
amplitude = 0.4,
charge = 2,
orientation = math.pi / 6
})

add_stimulus_operator(ctx, field, opts)

Generate a finite-energy separable Airy beam with configurable apodization and carrier tilt. This is useful for self-bending beam demos and accelerating-wave patterns.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_airy_beam".

The beam uses separable Airy envelopes with finite-energy tapers:

u(x,t)=AAi ⁣(usu)Ai ⁣(vsv)exp ⁣(auusu+avvsv)ei(kuu+kvvωt+ϕ)u(\mathbf{x}, t) = A\,\mathrm{Ai}\!\left(\frac{u}{s_u}\right)\mathrm{Ai}\!\left(\frac{v}{s_v}\right) \exp\!\left(a_u \frac{u}{s_u} + a_v \frac{v}{s_v}\right) e^{i(k_u u + k_v v - \omega t + \phi)}

where scale_u/v set su,svs_u, s_v and apodization_u/v set au,ava_u, a_v.

ParameterTypeDefaultDescription
typestring Must be "stimulus_airy_beam"
scale_u, scale_vdouble 0.45Airy scaling along the local frame axes
apodization_u, apodization_vdouble 0.12Finite-energy taper along each local axis
center_u, center_vdouble 0.0Beam center in the local frame
velocity_u, velocity_vdouble 0.0Beam-center drift velocity
orientationdouble 0.0Beam orientation angle
orientation_ratedouble 0.0Beam orientation drift rate
carrier_u, carrier_vdouble 0.0Carrier tilt applied along the local axes

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_airy_beam",
amplitude = 0.5,
scale_u = 0.4,
apodization_u = 0.12
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_airy_beam",
amplitude = 0.35,
carrier_u = 2.0,
carrier_v = -1.0,
orientation = math.pi / 8
})

add_stimulus_operator(ctx, field, opts)

Generate a Fresnel-style zone plate with quadratic radial phase and Gaussian aperture. This is useful for diffraction-inspired rings, focusing masks, and radial chirp patterns.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_zone_plate".

In the local plate frame,

u(x,t)=Aexp ⁣(12[(uau)2+(vav)2])ei(κρ2ωt+ϕ)u(\mathbf{x}, t) = A \exp\!\left(-\frac{1}{2}\left[\left(\frac{u}{a_u}\right)^2 + \left(\frac{v}{a_v}\right)^2\right]\right) e^{i(\kappa \rho^2 - \omega t + \phi)}

where κ\kappa is radial_chirp and ρ2=(u/su)2+(v/sv)2\rho^2 = (u/s_u)^2 + (v/s_v)^2.

ParameterTypeDefaultDescription
typestring Must be "stimulus_zone_plate"
radial_chirpdouble 18.0Quadratic radial chirp controlling ring spacing
scale_u, scale_vdouble 1.0Radial scaling along the local frame
aperture_u, aperture_vdouble 1.6Gaussian aperture width along the local axes
center_u, center_vdouble 0.0Plate center in the local frame
velocity_u, velocity_vdouble 0.0Plate-center drift velocity
orientationdouble 0.0Plate orientation angle
orientation_ratedouble 0.0Plate orientation drift rate

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_zone_plate",
amplitude = 0.7,
radial_chirp = 24.0,
aperture_u = 1.3
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_zone_plate",
amplitude = 0.5,
scale_u = 0.75,
scale_v = 1.25,
orientation = math.pi / 6
})

add_stimulus_operator(ctx, field, opts)

Generate an integer-order cylindrical Bessel beam with configurable radial wavenumber. This is useful for non-diffracting beam demos, cylindrical modes, and ringed phase fronts.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_bessel_beam".

In the local beam frame,

u(x,t)=AJn(krρ)ei(nθωt+ϕ)u(\mathbf{x}, t) = A\,J_n(k_r \rho)\,e^{i(n\theta - \omega t + \phi)}

where order sets the integer nn, radial_wavenumber sets krk_r, and ρ\rho is the scaled radial coordinate.

ParameterTypeDefaultDescription
typestring Must be "stimulus_bessel_beam"
orderinteger 0Cylindrical Bessel order
radial_wavenumberdouble 8.0Radial wavenumber applied to Jn(krρ)J_n(k_r \rho)
scale_u, scale_vdouble 1.0Radial scaling along the local frame axes
center_u, center_vdouble 0.0Beam center in the local frame
velocity_u, velocity_vdouble 0.0Beam-center drift velocity
orientationdouble 0.0Beam orientation angle
orientation_ratedouble 0.0Beam orientation drift rate

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_bessel_beam",
amplitude = 0.5,
order = 0,
radial_wavenumber = 10.0
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_bessel_beam",
amplitude = 0.35,
order = 2,
orientation_rate = 0.1
})

add_stimulus_operator(ctx, field, opts)

Generate separable Hermite-Gaussian transverse modes inside a Gaussian envelope. This is useful for cavity-mode demos, paraxial beam families, and mode-superposition studies.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_hermite_gaussian_beam".

u(x,t)=AHm ⁣(2uwu)Hn ⁣(2vwv)exp ⁣(u2wu2v2wv2)ei(kuu+kvvωt+ϕ)u(\mathbf{x}, t) = A\,H_m\!\left(\frac{\sqrt{2}\,u}{w_u}\right) H_n\!\left(\frac{\sqrt{2}\,v}{w_v}\right) \exp\!\left(-\frac{u^2}{w_u^2} - \frac{v^2}{w_v^2}\right) e^{i(k_u u + k_v v - \omega t + \phi)}

where mode_u/v set the Hermite indices and waist_u/v set the beam waists.

ParameterTypeDefaultDescription
typestring Must be "stimulus_hermite_gaussian_beam"
mode_u, mode_vinteger 0Hermite mode indices along the local axes
waist_u, waist_vdouble 0.75Beam waist along the local axes
center_u, center_vdouble 0.0Beam center in the local frame
velocity_u, velocity_vdouble 0.0Beam-center drift velocity
orientationdouble 0.0Beam orientation angle
orientation_ratedouble 0.0Beam orientation drift rate
carrier_u, carrier_vdouble 0.0Carrier tilt along the local axes

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_hermite_gaussian_beam",
amplitude = 0.6,
mode_u = 1,
mode_v = 0,
waist_u = 0.75
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_hermite_gaussian_beam",
amplitude = 0.45,
mode_u = 2,
mode_v = 1,
carrier_u = 1.5
})

add_stimulus_operator(ctx, field, opts)

Generate a Gaussian-envelope traveling wave packet with configurable carrier and drift. This is useful for localized transport, dispersive-packet demos, and moving coherent structures.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_traveling_wave_packet".

The packet envelope is

G(u,v)=exp ⁣(12[(uσu)2+(vσv)2])G(u, v) = \exp\!\left(-\frac{1}{2}\left[\left(\frac{u}{\sigma_u}\right)^2 + \left(\frac{v}{\sigma_v}\right)^2\right]\right)

and the injected field is

u(x,t)=AG(u,v)ei(kuu+kvvωt+ϕ)u(\mathbf{x}, t) = A\,G(u,v)\,e^{i(k_u u + k_v v - \omega t + \phi)}

with the packet center drifting through the local frame over time.

ParameterTypeDefaultDescription
typestring Must be "stimulus_traveling_wave_packet"
sigma_u, sigma_vdouble 0.75Packet width along the local axes
center_u, center_vdouble 0.0Packet center in the local frame
velocity_u, velocity_vdouble 0.0Packet-center drift velocity
orientationdouble 0.0Packet orientation angle
orientation_ratedouble 0.0Packet orientation drift rate
carrier_u, carrier_vdouble 0.0Carrier wavenumber along the local axes

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_traveling_wave_packet",
amplitude = 0.6,
sigma_u = 0.7,
carrier_u = 3.6,
velocity_u = 0.12
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_traveling_wave_packet",
amplitude = 0.4,
sigma_v = 1.2,
carrier_v = 2.0,
orientation = math.pi / 4
})

add_stimulus_operator(ctx, field, opts)

Generate a regularized cylindrical wave radiating from a moving point source. This is useful for 2D wave-emitter demos, soft singular sources, and outgoing radial phase fronts.

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

Returns: Operator handle (userdata)

Note: Requires type = "stimulus_cylindrical_wave_emitter".

With softened radius

ra=ρ2+a2r_a = \sqrt{\rho^2 + a^2}

the emitted field is

u(x,t)=Aeαraraei(krraωt+ϕ)u(\mathbf{x}, t) = A \frac{e^{-\alpha r_a}}{\sqrt{r_a}} e^{i(k_r r_a - \omega t + \phi)}

where softening_radius supplies aa, attenuation supplies α\alpha, and radial_wavenumber supplies krk_r.

ParameterTypeDefaultDescription
typestring Must be "stimulus_cylindrical_wave_emitter"
radial_wavenumberdouble 8.0Radial wavenumber of the outgoing phase front
attenuationdouble 0.0Exponential attenuation factor
softening_radiusdouble 0.1Core radius used to regularize the source singularity
center_u, center_vdouble 0.0Emitter center in the local frame
velocity_u, velocity_vdouble 0.0Emitter-center drift velocity

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

ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_cylindrical_wave_emitter",
amplitude = 0.7,
radial_wavenumber = 9.0,
attenuation = 0.2
})
ooc.add_stimulus_operator(ctx, field, {
type = "stimulus_cylindrical_wave_emitter",
amplitude = 0.4,
softening_radius = 0.2,
velocity_u = 0.05
})