Modeling and control of complex building energy systems