// Presets for the phase-space slide: conservative and damped springs, then // the driven presets of the previous slide (their x0 is not used here, since // the orbits start from a set of displacements; see js/orbits.js). Values are // in the sliders' physical units (see driven-presets.js). import { DRIVEN_PRESETS } from './driven-presets.js'; const strip = ({ x0, ...rest }) => rest; const free = (freq, alpha, delta) => ({ freq, alpha, delta, F: 0, drive: 220 }); // the lab's starting settings: a double well, undamped, driven at 490 Hz export const PHASE_DEFAULT = { freq: -220, alpha: 2e7, delta: 0, F: 5.6e4, drive: 490 }; export const PHASE_PRESETS = [ { name: 'Double well, undamped drive', params: PHASE_DEFAULT }, // closed curves of constant energy { group: 'Conservative', name: 'Linear spring', params: free(220, 0, 0) }, { group: 'Conservative', name: 'Hardening spring', params: free(220, 3e7, 0) }, // barrier at sqrt((2 pi 220)^2 / 3e7) = 0.25: orbits from farther out escape { group: 'Conservative', name: 'Softening spring', params: free(220, -3e7, 0) }, // wells at +/-0.31: orbits within one well, and around both { group: 'Conservative', name: 'Double well', params: free(-220, 2e7, 0) }, // delta = 60: the swing shrinks by e in 1/30 s, about 7 turns of the spiral { group: 'Damped', name: 'Hardening spring', params: free(220, 3e7, 60) }, // which well each start ends up in { group: 'Damped', name: 'Double well', params: free(-220, 2e7, 60) }, // the driven presets, without x0; the hardening pair's two presets differ // only in x0, so one is enough here (both steady swings appear) ...DRIVEN_PRESETS .filter((pr) => pr.name !== 'Two steady states: large') .map((pr) => ({ group: `Driven: ${(pr.group ?? 'default').toLowerCase()}`, name: pr.name === 'Two steady states: small' ? 'Two steady states' : pr.name, params: strip(pr.params), })), ];