We present a model equation describing the behavior of a density oscillator and a set of experiments to test the model. The system consists of a cup containing salty water with an orifice in its base, partially submerged in an outer vessel filled with fresh water. Such a setup produces an oscillatory flow of water through the orifice. The density oscillator is an oscillatory system that shares common features with more complex systems with a stable limit cycle. Although a Rayleigh equation has been used as a model equation for these systems, we propose a different approach based on the integration of the hydrodynamic equations on a streamline. The model reproduces the experimental oscillation and predicts the period as a function of the physical parameters. Phase resetting curves observed in experiments under external biphasic excitation can be reproduced by the model.