1. A method for optimizing a cost of electric power generation in a smart site energy management model, comprising the steps of: providing a cost function ζ that models a smart building-grid energy system of a plurality of buildings on a site interconnected with electric power grid energy resources and constraints due to a building model, an electric grid model, and a building-grid interface model, wherein decision variables for each of the building model, the electric grid model, and the building-grid interface model are box-constrained; and minimizing said cost function subject to the building model constraints, the electric grid model constraints, and building-grid interface model constraints, wherein the building model includes a plurality of buildings, one or more gas turbines and generators as on-site sources for electricity power, electric chillers, pumps and thermal energy storage tanks, wherein waste heat in exhaust gas from the gas turbines is used to generate steam in one or more heat recovery steam generator (HRSG) units, steam from the HRSG units drives one or more absorption chillers to generate cooling, one or more steam turbines to drive additional electricity generators, or provides heating needs for the plurality of buildings, the electric grid includes one or more loads and is modeled as an undirected graph G=(N, E), where N and E denote sets of electric nodes and branches, respectively, wherein each branch has an origin terminal and a destination terminal, each terminal is connected to an electric node, a voltage at node n 1 is a complex number defined by its magnitude and angle, and a power flow at terminal t 1 is a complex number defined by its real and imaginary parts, and the building-grid interface model constrains a building cooling load to be satisfied by chiller operations at all times, and an electricity load to be satisfied by on-site generation and the electric grid.