Hardware & DMFEATURED STUDYDefault on Stage-1 ALPAO 64×64 (MEMS Unchanged)Empirical |F(k,f)|² Dispersion Calibration1 ms Boxcar-Diff Ripple: 5.3 nm → 0.9 nm (14 ms)CUDA @ 8 kHz tick: 98.3 μs p50 (10.2 kHz)CPU vs CUDA Parity: 0.000 μm

Coupled 2D circular-rim flexural+membrane facesheet PDE (dyn_mode = "plate") for the Stage-1 ALPAO 64×64 magnetic DM in cacaosim—with synchronized side-by-side 20 kHz video against SCExAO lab measurements (LepICSaBL-E), running at 98 μs p50 on CUDA with exact 0.000 μm CPU–CUDA parity while leaving the Stage-2 50×50 MEMS DM on independent RC dynamics.

Referenced Simulation Reports

No matching simulation reports staged locally yet.

ALPAO 64×64 Magnetic DM Spatiotemporal Facesheet Dynamics (dyn_mode = "plate")

Key Takeaway: Direct 3D Fourier system identification (|F(k, f)|²) on the SCExAO 20 kHz measurement video (LepICSaBL-E) reveals the exact physics of the ALPAO 64×64 magnetic facesheet: a 1,000 Hz actuator foundation resonance (which naturally falls inside the 1,000 Hz temporal null of LepICSaBL-E's consecutive 1 ms exposure differences, explaining why fine k = 6–10 c/pup ripples dominate over low-k sloshing), combined membrane+flexural dispersion (c_m = 14.0 m/s, β = 0.0085 m²/s), localized voice-coil force excitation (plate_drive = "force"), a free circular rim (rim_bc = "free"), viscous decay γ₀ = 195 s⁻¹ (τ = 5.1 ms), and exact 1 ms consecutive-exposure boxcar differencing. Implementing this calibrated model in cacaosim's single-SM CUDA shared-memory kernel reproduces the in-phase t = +2.2 ms bullseye, expanding dispersive rings, rim reflections, and crisp t = +11.5 ms upper-right conjugate caustic at 98 μs p50 per 8 kHz (4× oversampled) tick (10.2 kHz, 0.000e+00 μm CPU–CUDA parity, only +9% overhead in the full ao3k_scexao.bench optical bench)—and is now the default for Stage-1 [dm.ao3k] in ao3k_scexao.bench.


1. Synchronized 20 kHz Video: Actual SCExAO Measurement vs. cacaosim Simulation

Both halves advance in exact 50 μs lockstep (20 kHz, synchronized at poke onset t = 0.00 ms) for a ~1 μm peak surface poke at actuator (19, 42), processed with the exact 1.0 ms consecutive-exposure boxcar difference (mean(t - 1 ms .. t) - mean(t - 2 ms .. t - 1 ms)) matching LepICSaBL-E:

Side-by-Side 20 kHz ALPAO 64x64 DM Poke: Actual SCExAO Measurement (Left, LepICSaBL-E) vs cacaosim Coupled Plate PDE (Right) — 396 synchronized 50 μs frames @ 10 fps · Download MP4

Synchronized Side-by-Side Key Frames (t = +0.5 ms to +11.5 ms)

Synchronized Actual SCExAO Measurement vs cacaosim Plate PDE Contact Sheet
Synchronized Actual SCExAO Measurement vs cacaosim Plate PDE Contact Sheet

Standalone cacaosim-Only 9-Timestamp Contact Sheet (t = +0.6 ms to +17.5 ms)

ALPAO 64x64 DM 20 kHz Single-Actuator Poke Contact Sheet
ALPAO 64x64 DM 20 kHz Single-Actuator Poke Contact Sheet
Post-Poke Δt Far-Ring Max |Δw₁ₘₛ| (18–36 act) Far-Ring RMS Δw₁ₘₛ
+ 0.5 ms 0.00 nm 0.00 nm
+ 1.5 ms 0.34 nm 0.03 nm
+ 2.5 ms 1.72 nm 0.48 nm
+ 3.5 ms 4.28 nm 1.37 nm
+ 4.5 ms 5.30 nm 1.51 nm
+ 6.0 ms 3.41 nm 1.07 nm
+ 8.0 ms 2.50 nm 0.82 nm
+10.0 ms 2.52 nm 0.62 nm
+14.0 ms 0.93 nm 0.21 nm
+18.0 ms 0.31 nm 0.11 nm

Key physical milestones matching across both halves:

  1. t = 0.0 → +2.0 ms: Saturated bright poke lasting 2.0 ms (triangular width of two consecutive 1 ms exposure averages) with 4-quadrant PyWFS diffraction cross flares; initial compression ring detaching around (19, 42).
  2. t = +2.1 → +4.1 ms: Large, bold black/white bullseye ring expanding around the poke while faster dispersive flexural arcs (f ≈ 1500–2700 Hz) sweep across the upper-right quadrant and reach the far circular rim.
  3. t = +6.5 → +8.5 ms: Broad diagonal wave fronts in the lower-left crossing reflected arcs from the free circular rim into checkerboard interference in the upper-right.
  4. t = +10.0 → +14.0 ms: Reflected waves refocus into the conjugate caustic in the upper-right quadrant (mirror of the lower-left poke) and decay cleanly into circular eigenmodes (τ = 5.1 ms).

(Note on bottom-row difference during t = 0.3–1.8 ms: in the actual SCExAO video, the bottom row is reconstructed from the saturated PyWFS measurement and exhibits a bright/dark + pyramid cross imprint; in cacaosim, the bottom row renders the exact ground-truth pupil-masked DM facesheet surface.)


2. Instantaneous DM Surface Shape w(x, y, t) vs. 1 ms Time Derivative Δw₁ₘₛ(x, y, t)

While the SCExAO measurement video (LepICSaBL-E) displays the 1 ms consecutive-exposure difference (a temporal high-pass / band-pass derivative with nulls at 1,000 and 2,000 Hz), the science and coronagraph optical beam sees the actual instantaneous DM surface shape w(x, y, t). Comparing both side-by-side in lockstep at 20 kHz reveals:

ALPAO 64x64 DM Instantaneous Surface Shape w(t) vs 1 ms Time Derivative — 396 synchronized 20 kHz frames @ 10 fps · Download MP4

Multi-Timestamp Comparison: DM Surface Shape (1×, 50×, w − w_DC) vs. 1 ms Derivative (50×)

ALPAO 64x64 DM Instantaneous Surface Shape w(t) vs 1 ms Derivative Contact Sheet
ALPAO 64x64 DM Instantaneous Surface Shape w(t) vs 1 ms Derivative Contact Sheet
Post-Poke Δt Peak Surface max |w(t)| Far-Ring Instantaneous Shape |w| (18–36 act) Far-Ring 1 ms Derivative |Δw₁ₘₛ| (18–36 act)
+ 0.25 ms 714.2 nm 0.10 nm (0.00 nm RMS) 0.00 nm (0.00 nm RMS)
+ 0.50 ms 564.7 nm 0.24 nm (0.00 nm RMS) 0.00 nm (0.00 nm RMS)
+ 1.00 ms 562.8 nm 0.14 nm (0.00 nm RMS) 0.00 nm (0.00 nm RMS)
+ 1.50 ms 557.8 nm 11.03 nm (0.76 nm RMS) 0.34 nm (0.03 nm RMS)
+ 2.20 ms 579.4 nm 20.88 nm (4.86 nm RMS) 1.43 nm (0.37 nm RMS)
+ 4.10 ms 570.6 nm 15.68 nm (4.62 nm RMS) 5.68 nm (1.48 nm RMS)
+ 7.10 ms 566.7 nm 10.68 nm (3.22 nm RMS) 2.69 nm (0.85 nm RMS)
+11.50 ms 563.8 nm 4.76 nm (1.27 nm RMS) 2.15 nm (0.43 nm RMS)
+16.00 ms 563.5 nm 1.73 nm (0.54 nm RMS) 0.51 nm (0.16 nm RMS)

3. Empirical System Identification & Physical Model

flowchart LR
    CMD1["Stage-1 Cmd dm01disp<br/>64×64 ALPAO Magnetic DM"] --> RC1["Voice-Coil Driver<br/>τ = 20 μs"]
    RC1 --> PDE["Coupled 2D Free-Rim Plate PDE<br/>dyn_mode = plate (3), drive = force<br/>f0 = 1000 Hz, c = 14.0 m/s, β = 0.0085"]
    PDE -->|"d_act_pos (VRAM)"| G1["16-Tap Sub-Pitch Gather<br/>(Physical 45% Facesheet Coupling)"]
    G1 --> BEAM["Optical Beam b_post_ao3k"]

    CMD2["Stage-2 Cmd dm02disp<br/>50×50 SCExAO MEMS DM"] --> RC2["Independent 1st-Order RC<br/>dyn_mode = rc (1), τ = 60 μs"]
    RC2 --> G2["16-Tap Gaussian Gather<br/>(Zero Facesheet Ripples)"]
    G2 --> BEAM2["Optical Beam b_post_scexao"]
    BEAM --> BEAM2

Governing Coupled 2D Flexural–Membrane PDE (dyn_mode = 3)

On the circular active actuator lattice Ω = { (ax, ay) : r ≤ 0.5 · min(nx, ny) + 0.5 } (a = 1.5 mm pitch, ~2 actuator guard ring outside the clear 60-actuator optical pupil), the facesheet displacement w(x, y, t) and velocity v = ∂w/∂t satisfy:

∂²w/∂t² + (2 γ₀ - 2 γ₂ a² ∇²) ∂w/∂t + (ω₀² - c_m² ∇² + β² ∇⁴) w = ω₀² u_f
ALPAO 64x64 Coupled Plate PDE Diagnostics: Wavefront Space-Time, Decay, Dispersion & Latency (2x2)
ALPAO 64x64 Coupled Plate PDE Diagnostics: Wavefront Space-Time, Decay, Dispersion & Latency (2x2)

4. Numerical Stability, Single-SM CUDA Architecture & Benchmarks

Exact Discrete CFL Sub-Stepping & Zero-Copy VRAM Handoff

Because the discrete 5-point Laplacian has maximum eigenvalue λ_max(−∇²_h) = 8, the exact discrete spectral upper bound on the 64×64 lattice is:

ω_max = sqrt(ω₀² + 8 (c_m/a)² + 64 (β/a²)²),    γ_max = γ₀ + 8 γ₂
nsub  = ceil(max(dt · ω_max / 1.15,  dt · γ_max / 0.45))

With the calibrated ALPAO DM3228 stiffness (ω_max = 40,600 rad/s), symplectic velocity-first Verlet requires only nsub = 2 sub-steps at 20 kHz (dt = 50 μs), nsub = 18 at 2 kHz (dt = 500 μs), and nsub = 5 at 8 kHz (4× oversampling)—cutting GPU latency substantially compared to stiffer initial estimates while maintaining a 1.74× CFL stability margin and zero numerical dissipation.

On CUDA (cacaosim_dm_cuda.cu), all nsub sub-steps execute inside a single cooperative SM block (1,024 threads × 4 actuators/thread) holding s_w, s_v, s_e, s_lap, and s_mask in 69,632 B of dynamic __shared__ memory (cudaFuncSetAttribute), with precomputed coordinates (zero integer divisions in the inner loop), Jacobi-symmetric Laplacians, and only 2 __syncthreads() per substep. Subframe-averaged actuator positions write directly to d_act_pos in VRAM and feed kernel_dm_gather_opd without a host round-trip—achieving bit-exact 0.000e+00 μm CPU–CUDA parity.

Measured Latency (Standalone DM Kernel & Full ao3k_scexao.bench, OMP_NUM_THREADS=4, RTX PRO 6000)

Compute Pipeline CPU (4 threads) CUDA (NVIDIA RTX PRO 6000)
DM 20×20 RC → 128×128 OPD 28.5 μs (35.05 kHz) 12.6 μs (p50 13.2 μs, 79.33 kHz)
DM 50×50 MEMS (dyn_mode=rc) → 256×256 OPD 191.3 μs (5.23 kHz) 25.4 μs (p50 25.6 μs, 39.32 kHz)
DM 64×64 ALPAO (dyn_mode=plate, dt=125 μs / 4× ovs, nsub=5) → 256×256 OPD 242.9 μs (4.12 kHz) 98.4 μs (p50 98.3 μs, 10.17 kHz)
Full ao3k_scexao.bench (4× ovs = 8 kHz ticks, 2 DMs, 2× 16-pt PyWFS, Lyot coro, LLOWFS, 7 PSF cams) — ao3k=rc vs. ao3k=plate — 2,346 μs (426 Hz) → 2,564 μs (390 Hz, +9.3%)

(In lockstep --fast-calib RM calibration, cacaosim_dm_step_static_plate() solves the exact SPD continuous-facesheet static equilibrium (ω₀² - c_m² ∇² + β² ∇⁴) w = ω₀² u via zero-allocation Conjugate Gradient in ~0.2 ms per poke so static calibration matches the dynamic plate PDE's exact t → ∞ response.)


5. Configuration Reference (.bench, FPS, TUI & options_schema.json)

All parameters are exposed identically across .bench INI files, milk-fpsexec-cacaosim-dmsim FPS parameters, cacaosim-CTRL TUI inspector, and the Simulator Options Reference:

.bench Key Default Unit Physical Meaning
dyn_mode "rc" (1) enum "instant" (0), "rc" (1), "osc" (2), or "plate" (3, ALPAO 64×64 opt-in)
tau_us 20.0 μs 1st-order voice-coil current driver RC pre-filter time constant
f0_hz 1000.0 Hz Elastic actuator foundation natural frequency f₀ = ω₀ / 2π
act_pitch_mm 1.5 mm Physical inter-actuator spacing a (ALPAO DM3228 = 1.5 mm)
wave_c 14.0 m/s Facesheet membrane tension wave speed c_m
bend_beta 0.0085 m²/s Kirchhoff–Love flexural dispersion coefficient β = sqrt(D / ρh)
damp_g0 195.0 s⁻¹ Viscous modal decay rate γ₀ (τ_damp = 1/γ₀ = 5.1 ms)
damp_g2 1.5 pitch²/s Kelvin–Voigt Laplacian damping γ₂ (suppresses high-k grain)
plate_drive "force" enum "force" (1, physical voice-coil force) or "disp" (0, diagonal DC w = u)
rim_bc "free" enum "free" (1, Neumann edge) or "clamped" (0, Dirichlet bezel)

Default ao3k_scexao.bench Configuration (ALPAO 64×64 = Plate, MEMS 50×50 = RC)

[dm.ao3k]
nact_x       = 64
nact_y       = 64
if_coupling  = 0.08       # sub-pitch gather; plate PDE supplies 45% physical facesheet coupling
dyn_mode     = "plate"
tau_us       = 20.0
f0_hz        = 1000.0
act_pitch_mm = 1.5
wave_c       = 14.0
bend_beta    = 0.0085
damp_g0      = 195.0
damp_g2      = 1.5
plate_drive  = "force"
rim_bc       = "free"

[dm.scexao]
nact_x       = 50
nact_y       = 50
if_coupling  = 0.20
dyn_mode     = "rc"       # 50x50 MEMS DM remains independent high-speed RC
tau_us       = 60.0

Reproducibility & GitHub Provenance

All video frames, side-by-side comparisons, contact sheets, Hovmöller wave plots, dispersion curves, and latency benchmarks on this page are produced directly from compiled cacaosim binaries:

cd ~/src/cacao-work && source env.sh

# 1. Build cacaosim with CUDA support & verify 100% unit + integration tests (0.000 um GPU parity)
./scripts/build-all.sh --only cacaosim
ctest --test-dir ../cacaosim/_build --output-on-failure

# 2. Run 20 kHz single-actuator poke simulation (ALPAO 64x64 plate DM + 160x160 NIR PyWFS)
../cacaosim/_build/cacaosim-dm-poke-sim --outdir _work/dm_ripple_demo

# 3. Render standalone 20 kHz MP4 & compile Technical Report + synchronized side-by-side video
"${PYTHON_BIN}" ./scripts/build-dm-dynamics-report.py --rerun-sim

# 4. Stage & deploy to Firebase Hosting (omit --build-only to deploy live)
./scripts/publish-ao-report.sh --build-only _work/dm_dynamics_report

Machine-Readable Artifacts

Additional Diagnostic Figures

Simulated 64x64 ALPAO DM (dyn_mode=plate) 20 kHz Single-Actuator Poke — 1 ms Diff (Video) · Download MP4

Telemetry & Data Files

FileFormatSize
dm_dynamics_metrics.jsonJSON7.87 KB
ripple_metrics.jsonJSON1.93 KB