Rate modulation in dams and ruin problems