Analysis and design of hybrid ventilation and cooling in buildings