# Halcyon engineering bench — model 1.0.0

This is an executable reduced apparatus simulation in SI units. It forecasts synthetic measurements under specified assumptions. It is **not** a calibrated digital twin, a SU(2) circuit implementation, a three-dimensional electromagnetic calculation, or a prediction of inertia reduction. All editable defaults are design assumptions, not measured component specifications.

Open `engineering.html`. The default experiment injects no mass change. Change a scenario or a parameter, run the experiment, and download the complete inputs, simulated data, fits and optional repeated-run study. The recorded field and illustrative nudge remain available in the navigation. Nothing in this model derives a mass change from the recorded Q trajectory.

## What is implemented

- A stable horizontal damped mode with an electrostatic actuator, support motion and optical displacement-readout abstraction.
- A passive one-port driven microwave resonator, scalar RF leakage and steady-state heat conduction.
- Exact frequency-domain mechanical response; synthetic noisy complex measurements at 41 frequencies; nonlinear weighted fitting of mass, net stiffness and damping.
- A time-domain force pulse using the exact linear state-transition matrix and exact thermal process covariance, plus sampled white readout noise.
- Independent reference/active measurements, local statistical covariance, an explicit gain-calibration uncertainty budget, deterministic seeded Monte Carlo repetitions, and JSON/CSV export.
- Refusal of unstable, out-of-band and large-motion settings instead of returning plausible-looking numbers outside the model's domain.

## Mechanics and electrostatics

For relative horizontal displacement about equilibrium:

    m x'' + c x' + k x = F_drive - m y'' + F_thermal
    H(omega) = x/F = 1 / (k - m omega² + i c omega)

The specimen is assumed grounded. Identical ideal opposed electrodes have area A, center gap d, and potentials Vb + v and Vb - v. Linearizing the constant-voltage capacitor forces about x = v = 0 gives:

    F_drive = 2 epsilon0 A Vb v / d²
    k_electrical = 2 epsilon0 A Vb² / d³
    k = k_suspension (1 + injected_stiffness_change + tempco DeltaT) - k_electrical

The electrical force gradient destabilizes the centered position, hence the minus sign. Fringing, patch potentials, finite specimen charging, higher-order displacement terms and v²-dependent stiffness modulation are omitted. Requiring v <= 0.1 Vb and predicted swept displacement <= 0.02 d bounds the linearization domain, but is not a certified accuracy tolerance. These omitted terms must be characterized before claiming small physical effects.

The prepared state's effective mass and damping are fixed during a run:

    m = m0 (1 + injected_mass_change)
    c = c0 (1 + injected_damping_change)

The mass parameter describes the measured mode. It does not change the static gravitational mass or imply levitation. Changing a state mid-run or introducing frequency-dependent inertia requires a different equation of motion.

The default 10 g, 0.2 N/m suspension would correspond to a small-angle pendulum length near 0.49 m before electrical softening. The electrode layout and specimen material are not specified by that equivalence.

## Microwave path

Device-plane power is P = 1 mW × 10^((source_dBm - attenuation_dB)/10). A specified fraction leaks toward the specimen; the remainder drives a linear cavity. In the near-resonant rotating-wave model:

    kappa = 2 pi linewidth_Hz
    kappa_ext = coupling_fraction kappa
    kappa_int = kappa - kappa_ext
    n = kappa_ext P_cavity / [hbar omega_c ((kappa/2)² + Delta²)]
    P_abs = kappa_int hbar omega_c n
    P_specimen = heat_fraction P_abs + (1 - reflectivity) P_leak
    DeltaT = P_specimen / thermal_conductance
    F_radiation = (1 + reflectivity) P_leak / speed_of_light

The force assumes all specified leakage intercepts the specimen in the measurement direction. It is an assumed propagation path, not a calculated radiation pattern. The constant force shifts the equilibrium by F_radiation/k; it does not enter the AC susceptibility as a mass change. Both reference and active states use the same microwave settings. Changing microwave power changes this budget and stiffness through the assumed heat path; it does not automatically generate an active/reference inertia difference.

Heat conduction is steady-state only. The circuit's thermal occupation, transmon nonlinearities, flux controls, quasiparticles, cryostat design and magnetic near-field forces are not modeled. The microwave frequency is not a force-drive frequency: the mechanical sweep is 0.15–2 Hz.

## Noise and acquisition

One-sided power spectral densities (per Hz) are used. For classical viscous damping at mechanical temperature T:

    S_F,thermal = 4 k_B T c
    S_x = readout_gain² |H|² [S_F,thermal + (m omega² base_ASD)²] + readout_ASD²
    Var(each measured quadrature) = S_x / integration_time

The quadrature formula assumes ideal steady-state narrowband demodulation. The integration must span at least ten amplitude-decay times (20 m/c); this is a conservative validity check, not an exact finite-window correction. Every tone is assumed to have settled; the displayed integration total excludes settling time. It does not simulate a finite-duration lock-in window, detector transfer function or acquisition transients. The PSDs are known to the fitting routine in this simulation; a real instrument must estimate them independently. Structural damping requires a different thermal-noise spectrum.

The support-noise and coherent-support controls apply to the frequency sweep. Coherent support motion is in phase with each force tone and contributes m omega² y to the force. The isolated pulse does not contain support vibration. Its caption and exports make this distinction explicit.

For the pulse, the deterministic state transition is exp(A dt), A = [[0,1],[-k/m,-c/m]]. The thermal process covariance is:

    P_eq = diag(k_B T / k, k_B T / m)
    Q_dt = P_eq - exp(A dt) P_eq exp(A dt)^T

This preserves equipartition for the unforced thermal oscillator. The initial thermal state is drawn from P_eq. The 0.25 s constant force pulse is exactly aligned to dt = 0.005 s. Sampled readout noise has variance readout_ASD²/(2 dt), corresponding to an ideal flat spectrum with Nyquist cutoff. The reference pulse curve is noise-free; the active curve includes thermal motion, and the gray trace includes readout noise. Motion in the apparatus illustration is exaggerated and its suspension geometry is schematic.

## Fitting and honest uncertainty

The fitter minimizes weighted residuals in complex displacement, not its noisy reciprocal. It estimates m, k and c using an analytic Jacobian and damped Gauss–Newton steps. Local covariance is the inverse Fisher/normal matrix evaluated at the fit, using the supplied measurement noise. A fit must converge and have reduced chi-squared below 2 in each state before the UI accepts its simple oscillator interpretation. That cutoff is a diagnostic choice, not evidence of new physics.

The reported mass change is m_active_fit/m_reference_fit - 1. Statistical uncertainty propagates independent state-fit variances. The extra calibration term assumes independent per-state fractional force and displacement-gain uncertainties:

    sigma_cal = mass_ratio sqrt(2 (u_force² + u_readout²))
    sigma_total = sqrt(sigma_stat² + sigma_cal²)

The displayed approximate 95% interval is change ± 1.96 sigma_total. This is a first-order uncertainty budget, not a full nuisance-parameter posterior. Common calibration errors may cancel between states; drifting ones may not. Correlated or non-Gaussian errors need a richer model.

The +2% force-error scenario intentionally demonstrates non-identifiability: multiplying actual force by g makes the apparent m, k and c each scale as 1/g. The fit can be excellent and the mass estimate wrong. The mass injection scenario is separate: its value is selected explicitly, never predicted from microwave settings.

Repeated studies vary only measurement noise, keeping injected effects and gain biases fixed. They report mean, spread, bias against the planted mass change, statistical interval coverage, rejected fits and detection fraction with binomial Wilson intervals. Calibration priors widen the detection interval but are not randomly sampled across these repetitions. A biased calibration challenge is expected to have poor coverage of the true mass change.

## Validation and reproducibility

Run from the website repository:

    node node_modules/vitest/vitest.mjs run tests/halcyon-engineering.test.js tests/halcyon-response.test.js
    node scripts/halcyon-engineering-validate.mjs

Tests compare the time-domain solver with an independent analytic pulse solution, check thermal equipartition and cavity power balance, recover separately planted mechanical parameters, expose the known gain degeneracy, check seed reproducibility and Monte Carlo statistical coverage, and reject unsupported settings. The no-injection fixtures paired with nonzero injections ensure the recovery tests fail if injection mechanisms are removed.

The validation script writes its report to stdout, or to an optional path supplied as its first argument. Downloaded JSON retains parameter units/provenance, software version, seeds, model assumptions, all synthetic measurements, both fit covariance matrices, pulse traces and any completed repeated-run study. CSV exports retain the run's parameters in comment lines.

## What needs hardware-specific work next

Replace assumptions with actual geometry, capacitance derivatives, mechanical transfer functions, noise spectra, device-plane power calibration and thermal characterization. Supply the gauge encoding and interaction Hamiltonian before adding a circuit-state-dependent mass term. Then add circuit and 3D EM/thermal solvers and calibrate the reduced model against them. Passing these numerical checks establishes implementation consistency, not correspondence to an unbuilt apparatus.

References: [Blais et al., Circuit Quantum Electrodynamics](https://arxiv.org/abs/2005.12667) for the circuit context; [Saulson, Thermal noise in mechanical experiments](https://doi.org/10.1103/PhysRevD.42.2437) for the importance of the mechanical loss model. The formulas and approximations actually used here are stated above and implemented in `engineering-model.js`.
