Dynamic optimization for minimal HVAC demand with latent heat storage, heat recovery, natural ventilation, and solar shadings