A gas bubble in water obeys the Rayleigh-Plesset equation, here in its compressible Keller-Miksis form: R R'' + 3/2 R'^2 = (p_B - p_inf(t))/rho with p_B = p_g (R0^3 - h^3)^k/(R^3 - h^3)^k + p_v - 2 sigma/R - 4 mu R'/R and a sound-speed correction (c = 1482 m/s). The drive is p_inf = p0 - p_a sin(2 pi f t); the gas is polytropic with a van der Waals hard core h = R0/8.54.
Why it matters: when the liquid pressure drops the bubble swells to ~10 R0, then the inertia of the liquid slams it shut in about a microsecond. The gas is squeezed to enormous pressure; this is the mechanism behind ultrasonic cleaning, erosion of propellers, spillways and pumps, and single-bubble sonoluminescence.
Simplifications: the bubble stays perfectly spherical (no wall jet, no shape instability), the gas is uniform and polytropic (no heat conduction, mass diffusion, vapour exchange or chemistry), the liquid is weakly compressible. The temperature shown is the adiabatic upper bound; real peaks are far lower. Above wall speed ~ c the model is only indicative (flagged on screen). The picture is magnified: radii are drawn relative to the largest radius of the cycle with a scale bar. Pressure amplitude, radius and frequency presets are illustrative.
Checks: Rayleigh collapse time 0.91468 R0 sqrt(rho/dp), Minnaert resonance, exact energy conservation, viscous damping rate 2 mu/(rho R0^2), and Keller-Miksis to Rayleigh-Plesset limit. Independent educational model of cavitation physics.
Running numerical checks...