A Python package for simulating and analyzing coupled oscillator systems. ResOSc computes normal modes, forced oscillation response with damping, and optimizes observables for detecting system dynamics.
- Normal Mode Analysis — Eigenvalue decomposition to find normal frequencies and mode shapes
- Forced Oscillation Response — Complex amplitude response curves with damping
- Observable Optimization — Find optimal sensor weights to maximize detection sensitivity across all modes
- Visualization — Plots of mode shapes, amplitude response, and coupling heatmaps
pip install numpy scipy matplotlibThen clone the repository and import the package:
from ResOSc import CoupledSystemfrom ResOSc.system import CoupledSystem
# Define a 3-oscillator system
sys = CoupledSystem(n=3)
sys.set_masses([1.0, 1.0, 1.0])
sys.set_springs(wall=[1.0, 1.0], coupling=[0.5, 0.5])
sys.set_damping(0.01)
# Solve for normal modes
sys.build_H()
sys.solve()
# Compute amplitudes over a frequency range
sys.compute_forces()
sys.compute_amplitudes(omega_range=(0, 3), n_points=1000)| Module | Description |
|---|---|
system |
Core CoupledSystem class — masses, springs, damping, eigenvalue solver |
modes |
Mode shape visualization (stem plots and heatmaps) |
observables |
Observable analysis, coupling matrices, and sensor optimization |
montecarlo |
Monte Carlo and Metropolis searches over array configurations |
physical |
Physical (SI) sensitivity pipeline — noise, strain PSD, SNR, horizon distance |
plotting |
Amplitude response curves with LaTeX-rendered labels |
ResOSc/physical.py turns an array design into a detector forecast through a
chain of stages, each a strict compression of the previous one:
{m_i, k_trap_i, q_i, (w_i)} → {f_n, v_n, mu_n, Gamma_n} → T(f), S_O^th, S_O^ro → S_h(f) → rho → d_max
- Hardware. N levitated discs: masses
m_i, trap stiffnessesk_trap_i, damping linewidthsgamma_i(Hz), optional chargesq_igiving Coulomb coupling springsk_ij ∝ q_i q_j / d_ij^3between every pair (long-range tails included). Masses, traps, and charges are the design variables. - Modal decomposition. The generalized eigenproblem
K v = ω² M vdecouples the array into N damped oscillators — frequenciesf_n, unit-norm shapesv_n, modal massesmu_n, linewidthsGamma_n— each responding through a Lorentzian susceptibilitychi_n(f)with resonant gainQ_n = f_n / Gamma_n. Design variables enter the chain only here. - Signal coupling. A gravitational-wave strain
hdisplaces each trap equilibrium byh·L, equivalent to forcesF_i = k_trap_i · L · h; the modal drive is the overlapB_n = v_nᵀ β. - Observable. One scalar
O(t) = Σ w_i x_i(t)with modal weightsN_n = (Vᵀw)_nand transfer functionT(f) = Σ N_n B_n chi_n(f)(meters per unit strain). Readout A (cavity) fixesw = g/|g|in hardware; Readout B (imaging) leaveswfree in software. - Noise budget. Thermal noise (fluctuation–dissipation theorem) is a
force, filtered by the same
|chi_n|²as the signal — resonantly peaked. Readout shot noise is imprecision added after the mechanics — flat (Readout B) or cavity-pole shaped (Readout A). - Strain-referred sensitivity.
S_h(f) = (S_O^th + S_O^ro) / |T(f)|². Near each resonance the|chi_n|²cancels between signal and thermal noise, giving flat, weight-independent thermal buckets whose usable width is set by the thermal/readout crossover. - Source model. Planetary-mass primordial-black-hole (PBH) binaries
(chirp mass 1e-4–1e-2 M☉) inspiral through 10–300 kHz with
|h̃(f)|² = A² f^(-7/3)up to the ISCO cutoff — the natural source for high-Q levitated arrays. - Matched-filter SNR → horizon distance.
ρ² = 4∫ |h̃|²/S_h dfaccumulates every sensitivity bucket under the source envelope; sinceρ ∝ 1/r, the horizon distanced_max = r_ref · ρ(r_ref)/8is the radius within which the source is detectable (rate ∝d_max³). The dark-matter channel reuses the same machinery with a flat impulse template (min_impulse).
The full derivation with equation references lives in
ResOSc_notes_and_findings.tex (§ "The Physical Sensitivity Chain") and the
companion note noise_function_notes.pdf.
- NumPy
- SciPy
- LAPACK
- Matplotlib
See ResOSc_demo.ipynb for worked examples and visualizations.