A total energy demand optimization method for the passive design of a building