The MAX IV storage rings, currently under construction in Lund, Sweden, will use third harmonic cavities operated passively to lengthen the bunches and alleviate collective instabilities. These cavities are an essential ingredient in the MAX IV design concept and are required for achieving the final design goals in terms of stored current, beam emittance, and beam lifetime-such performance challenges are in fact common to all recent ultralow emittance storage ring designs and harmonic cavities are currently under consideration in several laboratories. In this paper, we report on parametric studies comparing different harmonic cavity settings in terms of the resulting bunch length, peak bunch density, and incoherent synchrotron frequency spread for the MAX IV 3 GeV ring. The equilibrium longitudinal bunch density distribution was calculated by establishing a self-consistent equation for the bunch form factor, describing the bunch shape. The calculations are fully self-consistent in the sense that not only the amplitude but also the phase of the waves excited by the beam in the harmonic cavity were assumed to be a function of the bunch shape, which allowed us to explore a wide parameter range not restricted to the region close to the conditions for which the first and second derivatives of the total rf voltage are zero at the synchronous phase. Our results indicate that up to a factor 5 increase in rms bunch length is achievable with a purely passive system for the MAX IV 3 GeV ring while keeping a relatively large harmonic cavity detuning, thus limiting the unavoidable Robinson antidamping rate from the fundamental mode of a passively operated harmonic cavity to values below the synchrotron radiation damping rate. The paper is complemented by results of measurements performed in the MAX III storage ring, which showed good agreement with calculations following the fully self-consistent approach.