A structured, generalized modeling and simulation software is described that enables development and analysis of control algorithms and systems and pre- diction of thermal performance and energy use in buildings. The basis for this tool is the state-space technique, which casts differential and algebraic equations describing the system into a vector-matrix form. An automated building modeling capability generates detailed and simplified models directly from building plans by using a library of construction element models (walls, floors, etc.). A closed-loop system simulation can be generated by interconnect- ing the building model with other component models selected from a library of HVAC equipment, con- trols, internal load schedules, and weather data. Theoretical considerations for the modeling method- ologies implemented in GEMS are discussed. GEMS analysis results from an application are presented.