1 Introduction

Distributed generation is gaining increasing interest in the energy sector owing to its economic, technical, and environmental benefits. As opposed to purchasing power exclusively from the grid, users can invest in on-site generation using technologies of their choice, such as wind, solar photovoltaics (PV) and storage. When integrated with combined heat and power (CHP) technology, a single energy source can simultaneously generate electricity and heat to meet heating and cooling demands (see Fig. 1). In other words, the process of generating electricity releases waste heat which CHP can capture to produce usable thermal energy, offsetting the consumption of extra fuel for this purpose. In this way, distributed generation systems achieve greater energy efficiency relative to that of conventional generators that separate electrical and thermal production (Kerr 2008). The use of renewable technologies and the efficiency gains of CHP lead to significant reduction in emissions, which promote the world’s initiative to reduce global pollution and meet climate change goals. Additionally, research shows that distributed generation systems offer energy savings and play a major role in reducing investments in transmission and distribution capacity (El-Khattam and Salama 2004; Gumerman et al. 2003). Benefits also include peak shaving, as well as improved system reliability and resiliency (Chiradeja and Ramakumar 2004). Our research informs the optimal design (i.e., size and mix) and dispatch of renewable technologies with combined heat and power to reduce costs for representative commercial buildings.

Fig. 1
figure 1

A notional distributed generation system with a collection of technologies (including thermal energy storage (TES)) available for electrical, heating, and cooling loads; the technologies highlighted in blue represent a baseline case without distributed resources. Dashed boxes on the right side of the image represent loads that depend on cooling dispatch decisions when an absorption chiller is available. Image adapted from: Anderson et al. (2021)

The National Renewable Energy Laboratory has developed REopt Lite, a model that helps energy planners assess the economic feasibility of using renewable energy technologies, combined heat and power, conventional generators, and storage (Anderson et al. 2021; Mishra et al. 2021). This model determines the system sizes and dispatch decisions, includes an option to assess grid resilience in case of an outage, and incorporates sophisticated pricing structures. For the purpose of this paper, we refer to this model as the original formulation (\(\bar{{\mathcal {R}}}\)). Ogunmodede et al. (2021) improve the performance of the mathematical formulation without CHP, but omit implementation details. Our model, which we term (\(\widehat{{\mathcal {R}}}\)), extends the reformulation in Ogunmodede et al. (2021) to include the option of CHP technologies and thermal energy storage. This involves the addition of: (i) fuel constraints, (ii) thermal production restrictions, (iii) storage operations, (iv) charging rates, (v) cold and hot thermal loads, (vi) load balancing and grid sales, and (vii) standby charges. We correspondingly provide implementation details.

In aggregate, the contributions of our paper are as follows: (i) the extension of an existing energy design and dispatch model (Ogunmodede et al. 2021) to accommodate combined heat and power technologies, (ii) an improvement in the tractability of this (and the Ogunmodede et al. (2021)) model through the use of appropriate data handling and data structures, and thorough reformulation; and, (iii) the presentation of managerial insights gained from solutions to realistic instances of this complicated system. The remainder of the paper is organized as follows: Section 2 reviews the relevant literature. Section 3 presents the notation and corresponding mathematical formulation. Section 4 provides the solution methodology we employ to increase tractability of the model. Section 5 describes the data we use and corresponding results, including performance characteristics and solution analysis. Finally, Section 6 concludes and proposes future work.

2 Literature review

Models that optimally determine design and dispatch simultaneously are NP-hard, and can consist of nonlinear functional forms (De Mel et al. 2020; Pruitt et al. 2014; Zakrzewski 2017) and/or integrality restrictions on (some of) the decision variables (Merkel et al. 2015). Problem simplifications, such as shortening the time horizon (Fuentes-Cortés and Flores-Tlacuahuac 2018; Gopalakrishnan and Kosanovic 2014, 2015), aggregating time periods (Oluleye et al. 2018), or scaling down the entire system (Adam et al. 2015; Merkel et al. 2015) might compromise the quality of the solution, even if the model itself becomes more tractable.

An increasing number of models in literature simultaneously address the design and dispatch problem. Specifically, there have been those that consider dispatching microgrids (Goodall et al. 2019; Scioletti et al. 2017; Zhao et al. 2014), concentrated solar power (Hamilton et al. 2020a, b), and oxidized fuel cells (Anyenya et al. 2018). Some optimization models incorporate combined heat and power. For example, Krug et al. (2020) provide a nonlinear model whose solution dispatches district heating networks, and Rong and Lahdelma (2007) weigh the cost of investing in such technologies against \(\hbox {CO}_2\) emissions in a multi-period stochastic optimization model. Literature demonstrates alternative solutions to design and dispatch with CHP using multi-objective optimization (Hollermann et al. 2020; Huster et al. 2019; Perera et al. 2017). Other models addressing simultaneous design and dispatch with combined heat and power tend to produce sub-optimal solutions to the monolith (Blackburn et al. 2019), or optimal solutions to a problem with reduced scope (Burer et al. 2003; Buoro et al. 2014; Pruitt et al. 2013b; Silvente et al. 2015; Weber et al. 2006). In particular, although Pruitt et al. (2013a, 2013b) make optimal design and dispatch decisions for a combined heat and power system, the pricing structure and operational details of the technologies are not as sophisticated as those we consider.

Fig. 2
figure 2

A categorical overview of the decision variables, objective function, and constraints that compose the REopt Lite optimization model, (\(\widehat{{\mathcal {R}}}\)), where SOC denotes state of charge

The Distributed Energy Resources-Customer Adoption Model (Der-Cam) is a mixed-integer linear program. Authors such as Siddiqui et al. (2005), Stadler et al. (2014), Braslavsky et al. (2015), and Mashayekh et al. (2017) report on its capabilities, which consist of generating an optimal design and dispatch strategy for a suite of technologies, subject to constraints on load shifting, peak shaving, power export agreements, and ancillary service markets. Some versions of this model consider detailed electrical distribution, but loads are not incorporated at a level as fine as hourly, the technologies are dispatched in a coarser manner, and the model lacks certain economic nuances, such as tiered monthly demand charges, minimum required utility payments, and offtake agreements. Desod (Bracco et al. 2016) optimizes an energy system with CHP for independent buildings, omitting connections to the utility for thermal energy. Dispatch is also on a coarser level, e.g., by considering “typical-day” loads. A shortened time horizon expedites solutions. Balmorel (Wiese et al. 2018) is an open-source model that considers thermal-producing and distributed energy generation (Karlsson and Meibom 2008; Koivisto et al. 2019; Nasution et al. 2019). Although the model possesses hourly fidelity, it fails to include resiliency and investment incentives. Connolly et al. (2010) and Ringkjøb et al. (2018) provide significant reviews of energy and electricity system analysis.

3 Mathematical formulation

We introduce the monolith mixed-integer linear programming formulation of our design and dispatch problem, (\(\widehat{{\mathcal {R}}}\)). This model is an extension of that given in Ogunmodede et al. (2021), which we term (\({\mathcal {R}}\)), and introduces combined heat and power into the system. Figure 2 summarizes the variables, objectives, and constraints of the monolith, which seeks design and dispatch decisions for a system of distributed energy resources that minimizes the cost of capital, operations and maintenance (O&M), fuel and utility costs, net of production incentives and energy exports. Constraints ensure that: (i) system sizing and fuel consumption fall within user-specified limits, (ii) production and load balance in each time period, and (iii) production incentives, utility charges, and other policy structures are accurately accounted for.

This section presents contributions to the model that involve additional or significantly altered constraints. We provide first notation used for these additions, in alphabetic order, and categorized as: (i) indices and sets, (ii) parameters, and (iii) variables. We state for ease of exposition the objective function, and then give the sets of constraints that were significantly modified from (\({\mathcal {R}}\)). Finally, we point to the appendix for the remainder, which we include for completeness. Our naming convention represents sets using calligraphic capital letters, parameters employing lower-case letters, and variables invoking upper-case letters. Subscripts denote indices, whereas superscripts and other “decorations” represent similar constructs with the same “stem.”

3.1 Sets and parameters

Sets

\({\mathcal {B}}\)

Storage systems

 

\({\mathcal {C}}\)

Technology classes

 

\({\mathcal {D}}\)

Time-of-use demand periods

 

\({\mathcal {E}}\)

Electrical time-of-use demand tiers

 

\({\mathcal {F}}\)

Fuel types

 

\({\mathcal {H}}\)

Time steps

 

\({\mathcal {M}}\)

Months of the year

 

\({\mathcal {N}}\)

Monthly peak demand tiers

 

\({\mathcal {T}}\)

Technologies

 

\({\mathcal {U}}\)

Total electrical energy pricing tiers

 

Subsets and indexed sets

\({{\mathcal {B}}^{\text {c}} \subseteq {\mathcal {B}}^{\text {th}}}\)

Cold thermal energy storage systems

 

\({{\mathcal {B}}^{\text {e}} \subseteq {\mathcal {B}}}\)

Electrical storage systems

 

\({{\mathcal {B}}^{\text {h}} \subseteq {\mathcal {B}}^{\text {th}}}\)

Hot thermal energy storage systems

 

\({{\mathcal {B}}^{\text {th}} \subseteq {\mathcal {B}}}\)

Thermal energy storage systems

 

\({\mathcal {H}}^{{\text {g}}} \subseteq {\mathcal {H}}\)

Time steps in which grid purchasing is available

 

\({\mathcal {H}}_m \subseteq {\mathcal {H}}\)

Time steps within a given month m

 

\({\mathcal {H}}_{d} \subseteq {\mathcal {H}}\)

Time steps within electrical power time-of-use demand tier d

 

\({\mathcal {K}}_{t} \subseteq {\mathcal {K}}\)

Subdivisions applied to technology t

 

\({\mathcal {K}}^{{\text {c}}} \subseteq {\mathcal {K}}\)

Capital cost subdivisions

 

\({\mathcal {S}}_{tk} \subseteq {\mathcal {S}}\)

Power rating segments from subdivision k applied to technology t

 

\({\mathcal {T}}_{b} \subseteq {\mathcal {T}}\)

Technologies that can charge storage system b

 

\({\mathcal {T}}_{c} \subseteq {\mathcal {T}}\)

Technologies in class c

 

\({\mathcal {T}}_{{\textit{f} }} \subseteq {\mathcal {T}} \)

Technologies that burn fuel type f

 

\({\mathcal {T}}_{v} \subseteq {\mathcal {T}}\)

Technologies that may access net-metering regime v

 

\({{\mathcal {T}}^{\text {ac}} \subseteq {\mathcal {T}}^{\text {cl}}}\)

Absorption chillers

 

\({{\mathcal {T}}^{\text {CHP}}\subseteq {\mathcal {T}}^{\text {f}}}\)

CHP technologies

 

\({{\mathcal {T}}^{\text {cl}} \subseteq {\mathcal {T}}}\)

Cooling technologies

 

\({{\mathcal {T}}^{\text {e}} \subseteq {\mathcal {T}}}\)

Electricity-producing technologies

 

\({{\mathcal {T}}^{\text {ec}} \subseteq {\mathcal {T}}^{\text {cl}}}\)

Electric chillers

 

\(\mathcal {T}^{\text {f}} \subseteq \mathcal {T}^{{\text {e}}} \)

Fuel-burning, electricity-producing technologies

 

\({{\mathcal {T}}^{\text {ht}} \subseteq {\mathcal {T}}}\)

Heating technologies

 

\({\mathcal {T}}^{\text {td}} \subseteq {\mathcal {T}}\)

Technologies that cannot turn down, i.e., PV and wind

 

\(\mathcal {U}^{{\text {p}}} \subseteq \mathcal {U}\)

Electrical energy purchase pricing tiers

 

\(\mathcal {U}^{{\text {s}}}_{t} \subseteq \mathcal {U}^{{\text {s}}}\)

Electrical energy sales pricing tiers accessible by technology t

 

\(\mathcal {U}^{{\text {sb}}} \subseteq \mathcal {U}^{{\text {s}}}\)

Electrical energy sales pricing tiers accessible by storage

 

Scaling parameters

\(\varGamma \)

Number of time periods within a day

[–]

\(\varDelta \)

Time step scaling

[h]

\(\varTheta \)

Peak load oversizing factor

[–]

M

Sufficiently large number

[various]

Parameters for costs and their functional forms

\(c^{\text {afc}}\)

Utility annual fixed charge

[$]

\(c^{\text {cb}}_{ts}\)

y-intercept of capital cost curve for technology t in segment s

[$]

\(c^{\text {cm}}_{ts}\)

Slope of capital cost curve for technology t in segment s

[$/kW]

\(c^{\text {e}}_{uh}\)

Export rate for energy in energy demand tier u in time step h

[$/kWh]

\(c^{\text {g}}_{uh}\)

Grid energy cost in energy demand tier u during time step h

[$/kWh]

\(c^{\text {kW}}_{b}\)

Capital cost of power capacity for storage system b

[$/kW]

\(c^{\text {kWh}}_{b}\)

Capital cost of energy capacity for storage system b

[$/kWh]

\(c^{\text {omb}}_{b}\)

Operation and maintenance cost of storage system b per unit of energy rating

[$/kWh]

\(c^{\text {omp}}_{t}\)

Operation and maintenance cost of technology t per unit of production

[$/kWh]

\(c^{\text {om}\sigma }_{t}\)

Operation and maintenance cost of technology t per unit of power rating, including standby charges

[$/kW]

\(c^{\text {r}}_{de}\)

Cost per unit peak demand in time-of-use demand period d and tier e

[$/kW]

\(c^{\text {rm}}_{mn}\)

Cost per unit peak demand in tier n during month m

[$/kW]

\(c^{\text {u}}_{{\textit{f} }}\)

Unit cost of fuel type f

[$/MMBTU]

Demand parameters

\({\delta ^{\text {c}}_h}\)

Cooling load in time step h

[kW]

\(\delta ^{\text {d}}_{h}\)

Electrical load in time step h

[kW]

\({{\bar{\delta }}}^{\text {gs}}_{u}\)

Maximum allowable sales in electrical energy demand tier u

[kWh]

\({\delta ^{\text {h}}_h}\)

Heating load in time step h

[kW]

\(\delta ^{\text {lp}}\)

Look-back proportion for ratchet charges

[fraction]

\({{\bar{\delta }}}^{\text {mt}}_{n}\)

Maximum monthly electrical power demand in peak pricing tier n

[kW]

\({{\bar{\delta }}}^{\text {t}}_{e}\)

Maximum power demand in time-of-use demand tier e

[kW]

\({{\bar{\delta }}}^{\text {tu}}_{u}\)

Maximum monthly electrical energy demand in tier u

[kWh]

Incentive parameters

\({\bar{\imath }}_{t}\)

Upper incentive limit for technology t

[$]

\(i^{\text {n}}_{v}\)

Net metering limits in net metering regime v

[kW]

\(i^{\text {r}}_{t}\)

Incentive rate for technology t

[$/kWh]

\({\bar{\imath }}^{\sigma }_{t}\)

Maximum power rating for obtaining production incentive for technology t

[kW]

Technology-specific time-series factor parameters

\(f^{\text {ed}}_{th}\)

Electrical power derate factor of technology t at time step h

[unitless]

\({f^{\text {fa}}_{th}}\)

Fuel burn ambient correction factor of technology t at time step h

[unitless]

\({f^{\text {ha}}_{th}}\)

Hot water ambient correction factor of technology t at time step h

[unitless]

\({f^{\text {ht}}_{th}}\)

Hot water thermal grade correction factor of technology t at time step h

[unitless]

\(f^{\text {p}}_{th}\)

Production factor of technology t during time step h

[unitless]

Technology-specific factor parameters

\(f^{\text {d}}_{t}\)

Derate factor for turbine technology t

[unitless]

\(f^{\text {l}}_{t}\)

Levelization factor of technology t

[fraction]

\(f^{\text {li}}_{t}\)

Levelization factor of production incentive for technology t

[fraction]

\(f^{{\text {pf}}}_{t}\)

Present worth factor for fuel for technology t

[unitless]

\(f^{\text {pi}}_{t}\)

Present worth factor for incentives for technology t

[unitless]

\( { f}^{{\text {\,\,td}}}_{\,t}\)

Minimum turn down for technology t

[unitless]

Generic factor parameters

\(f^{\text {e}}\)

Energy present worth factor

[unitless]

\(f^{\text {om}}\)

O&M present worth factor

[unitless]

\(f^{\text {tot}}\)

Tax rate factor for off-taker

[fraction]

\(f^{\text {tow}}\)

Tax rate factor for owner

[fraction]

Power rating and fuel limit parameters

\(b^{\text {fa}}_{{ f}}\)

Amount of available fuel for fuel type f

[MMBTU]

\({\bar{b}}^{\sigma }_{t}\)

Maximum power rating for technology t

[kW]

Efficiency parameters

\(\eta ^{\text {+}}_{bt}\)

Efficiency of charging storage system b using technology t

[fraction]

\(\eta ^{\text {-}}_{b}\)

Efficiency of discharging storage system b

[fraction]

\(\eta ^{\text {ac}}\)

Absorption chiller efficiency

[fraction]

\(\eta ^{\text {b}}\)

Boiler efficiency

[fraction]

\(\eta ^{\text {ec}}\)

Electric chiller efficiency

[fraction]

\(\eta ^{\text {g+}}\)

Efficiency of charging electrical storage using grid power

[fraction]

Storage parameters

\({\bar{w}}^{{\text {bkW}}}_{b}\)

Maximum power output of storage system b

[kW]

\({{ { w}}}^{{\text {bkW}}}_{\,b}\)

Minimum power output of storage system b

[kW]

\({\bar{w}}^{{\text {bkWh}}}_{b}\)

Maximum energy capacity of storage system b

[kWh]

\({ { w}}^{{\text {bkWh}}}_{\,b}\)

Minimum energy capacity of storage system b

[kWh]

\({w^{\text {d}}_{b}}\)

Decay rate of storage system b

[1/h]

\({ { w}}^{\text {mcp}}_{\,b}\)

Minimum percent state of charge of storage system b

[fraction]

\(w^{\text {0}}_{b}\)

Initial percent state of charge of storage system b

[fraction]

Fuel burn parameters

\(m^{\text {fb}}_{t}\)

y-intercept of the fuel rate curve for technology t

[MMBTU/h]

\({m^{\text {fbm}}_{t}}\)

Fuel burn rate y-intercept per unit size for technology t

[MMBTU/kWh]

\(m^{\text {fm}}_{t}\)

Slope of the fuel rate curve for technology t

[MMBTU/kWh]

CHP thermal performance parameters

\({k^{\text {te}}_{t}}\)

Thermal energy production of CHP technology t per unit electrical output

[unitless]

\({k^{\text {tp}}_{t}}\)

Thermal power production of CHP technology t per unit power rating

[unitless]

3.2 Variables

Boundary conditions

\(X^{\text {se}}_{b,0}\)

Initial state of charge for storage system b

[kWh]

Continuous variables

\(X^{\text {bkW}}_{b}\)

Power rating for storage system b

[kW]

\(X^{\text {bkWh}}_{b}\)

Energy rating for storage system b

[kWh]

\(X^{\text {de}}_{de}\)

Peak electrical power demand allocated to tier e and time-of-use demand period d

[kW]

\(X^{\text {dfs}}_{bh}\)

Power discharged from storage system b during time step h

[kW]

\(X^{\text {dn}}_{mn}\)

Peak electrical power demand allocated to tier n during month m

[kW]

\( X^{\text {f}}_{th}\)

Fuel burned by technology t in time step h

[MMBTU/h]

\({X^{\text {fb}}_{th}}\)

y-intercept of fuel burned by technology t in time step h

[MMBTU/h]

\(X^{\text {g}}_{uh}\)

Power purchased from the grid for electrical load in demand tier u during time step h

[kW]

\(X^{\text {gts}}_{h}\)

Electrical power delivered to storage by the grid in time step h

[kW]

\(X^{\text {mc}}\)

Annual utility minimum charge adder

[$]

\(X^{\text {pi}}_{t}\)

Production incentive collected for technology t

[$]

\(X^{\text {plb}}\)

Peak electrical demand during look back periods

[kW]

\(X^{\text {ptg}}_{tuh}\)

Exports from production to the grid by technology t in demand tier u during time step h

[kW]

\(X^{\text {pts}}_{bth}\)

Power from technology t used to charge storage system b during time step h

[kW]

\({X^{\text {ptw}}_{th}}\)

Thermal power from technology t sent to waste or curtailed during time step h

[kW]

\(X^{\text {rp}}_{th}\)

Rated production of technology t during time step h

[kW]

\(X^{\sigma }_{t}\)

Power rating of technology t

[kW]

\(X^{\sigma {\text {s}}}_{tks}\)

Power rating of technology t allocated to subdivision k, segment s

[kW]

\(X^{\text {se}}_{bh}\)

State of charge of storage system b at the end of time step h

[kWh]

\(X^{\text {stg}}_{uh}\)

Exports from storage to the grid in demand tier u during time step h

[kW]

\({X^{\text {tp}}_{th}}\)

Thermal production of technology t in time step h

[kW]

\({X^{\text {tpb}}_{th}}\)

y-intercept of thermal production of CHP technology t in time step h

[kW]

Binary variables

\(Z^{\sigma {\text {s}}}_{tks}\)

1 If technology t in subdivision k, segment s is chosen; 0 otherwise

[unitless]

\(Z^{\text {to}}_{th}\)

1 If technology t is operating in time step h; 0 otherwise

[unitless]

3.3 Objective function

$$ \begin{aligned} \begin{array}{ll} (\mathcal {{{\widehat{R}}}}) &{}\quad {\text {minimize}} \underbrace{\sum _{t \in \mathcal {T}, k \in \mathcal {K}^{{\text {c}}}, s \in \mathcal {S}_{tk}} \bigg (c^{\text {cm}}_{ts} \cdot X^{\sigma {\text {s}}}_{tks} + c^{\text {cb}}_{ts} \cdot Z^{\sigma {\text {s}}}_{tks} \bigg )}_{{\text {Generating Technology Capital Costs}}} \\ &{}\quad +\underbrace{\sum _{b \in \mathcal {B}} \bigg (c^{\text {kW}}_{b} \cdot X^{\text {bkW}}_{b} + \bigg (c^{\text {kWh}}_{b} + c^{\text {omb}}_{b}\bigg ) \cdot X^{\text {bkWh}}_{b}\bigg ) }_{{\text {Storage Capital Costs}}} \\ &{}\quad +(1-f^{\mathrm{tow}}) \cdot f^{\text {om}} \cdot \bigg ( \underbrace{\sum _{t \in \mathcal {T}} c_{t}^{{\text {om}}\sigma } \cdot X^{\sigma }_{t} }_{{\text {Fixed}\,\text {O}\,\, \& \,\,\text {M}\, \text {Costs}}} + \underbrace{\sum _{t \in \mathcal {T}^{{\text {f}}}, h \in \mathcal {H}} c^{\text {omp}}_{t} \cdot X^{\text {rp}}_{th} }_{{\text {Variable}\, \text {O}\,\, \& \,\,\text {M}\, \text {Costs}}} \bigg ) \\ &{}\quad +(1-f^{\text {tot}}) \cdot \underbrace{ \Delta \cdot \sum \limits _{{\textit{f} }\in \mathcal {F}} c^{\text {u}}_{{\textit{f} }} \cdot \sum \limits _{t \in \mathcal {T}_{{\textit{f} }}, h \in \mathcal {H}} f^{{\text {pf}}}_{t} \cdot X^{\text {f}}_{th} }_{{\text {Fuel Charges}}} \\ &{}\quad +(1-f^{\text {tot}}) \cdot f^{\text {e}} \cdot \Bigg (\underbrace{\Delta \cdot \sum _{u \in \mathcal {U}^{{\text {p}}}, h \in \mathcal {H}^{{\text {g}}}} c^{\text {g}}_{uh} \cdot X^{\text {g}}_{uh} }_{{\text {{Grid Energy Charges}}}} \\ &{}\quad +\underbrace{\sum _{d \in \mathcal {D}, e \in \mathcal {E}} c^{\text {r}}_{de} \cdot X^{\text {de}}_{de}}_{{\text {Time-of-Use Demand Charges}}} + \underbrace{\sum _{m \in \mathcal {M}, n \in \mathcal {N}} c^{\text {rm}}_{mn} \cdot X^{\text {dn}}_{mn}}_{{\text {Monthly Demand Charges}}} \\ &{}\quad +\underbrace{ c^{\text {afc}} + X^{\text {mc}}}_{{\text {Fixed Charges}}} \\ &{}\quad -\underbrace{\Delta \cdot \bigg ( \sum _{h \in \mathcal {H}^{{\text {g}}}} \bigg ( \sum _{u \in \mathcal {U}^{{\text {sb}}}} c^{\text {e}}_{uh} \cdot X^{\text {stg}}_{uh}+\sum \limits _{t \in \mathcal {T}, u \in \mathcal {U}^{{\text {s}}}_{t}} c^{\text {e}}_{uh} \cdot X^{\text {ptg}}_{tuh} \bigg ) \bigg )}_{{\text {Energy Export Payment}}}\Bigg ) \\ &{}\quad -( 1-f^{\text {tow}}) \cdot \underbrace{ \sum _{t \in \mathcal {T}} X^{\text {pi}}_{t}}_{{\text {Production Incentives}}} \end{array} \end{aligned}$$

The objective function is the same as that in (\({\mathcal {R}}\)) and minimizes energy life cycle cost, i.e., capital costs, O&M costs, and utility costs; it maximizes (by subtracting) payments for energy exports and other incentives.

3.4 Constraints

We mathematically present and describe the constraints that we modify from Ogunmodede et al. (2021) to account for combined heat and power. For ease of presentation, we exclude initial conditions and other minor exceptions.

3.4.1 Fuel constraints

$$\begin{aligned}&\Delta \cdot \sum \limits _{t \in \mathcal {T}_{{\textit{f} }}, h \in \mathcal {H}} X^{\text {f}}_{th} \le b^{\text {fa}}_{{\textit{f} }} \;\;\; \forall f \in \mathcal {F} \end{aligned}$$
(1a)
$$\begin{aligned}&X^{\text {f}}_{th} = m^{\text {fm}}_{t} \cdot f^{\text {p}}_{th} \cdot X^{\text {rp}}_{th} + m^{\text {fb}}_{t} \cdot Z^{\text {to}}_{th} \;\;\; \forall t \in \mathcal {T}^{\text {f}} {\setminus \mathcal {T}^{\text {CHP}}}, h \in \mathcal {H} \end{aligned}$$
(1b)
$$\begin{aligned}&{X^{{\text {f}}}_{th} = m^{\text {fm}}_{t} \cdot X^{\text {tp}}_{th} \;\;\; \forall t \in \mathcal {T}^{{\text {ht}}} \setminus \mathcal {T}^{CHP},\ h \in \mathcal {H}} \end{aligned}$$
(1c)
$$\begin{aligned}&{ X^{\text {f}}_{th} = f^{\text {fa}}_{th}\cdot \left( X^{\text {fb}}_{th} + f^{\text {p}}_{th} \cdot m^{{\text {fm}}}_{t} \cdot X^{\text {rp}}_{th} \right) \;\;\; \forall t \in \mathcal {T}^{CHP}, h \in \mathcal {H}} \end{aligned}$$
(1d)
$$\begin{aligned}&{ m^{\text {fbm}}_{t}\cdot X^{\sigma }_{t} - {\textit{M}} \cdot (1-Z^{\text {to}}_{th}) \le X^{\text {fb}}_{th} \;\;\;\forall t\in {\mathcal {T}}^{\text {CHP}},h\in {\mathcal {H}}} \end{aligned}$$
(1e)

Constraints (1) enforce the fuel requirements for the combustion-powered technologies in REopt Lite. Constraint (1a) limits the available quantity of each fuel type per annum; we assume that while multiple technologies (e.g., natural gas boilers and CHP systems) may share the same fuel type, each technology may burn at most one type of fuel. Constraint (1b) enforces both a fixed consumption rate per hour of operational time and a variable burn rate per unit of energy produced for each electric, non-CHP technology. Constraint (1c) applies logic similar to that in constraint (1b) for non-CHP heating technologies, but removes the fixed fuel consumption rate during operation. Constraint (1d) defines fuel consumption for CHP systems using both a per-operating-hour rate and a per-unit-production rate, but, unlike constraint (1b), the hourly burn rate is a decision variable; constraint (1e) sets this decision variable to a fixed proportion of the system’s power rating if it is operating, and to zero otherwise.

3.4.2 Thermal production constraints

$$\begin{aligned}&{X^{\text {tpb}}_{th} \le \min \left\{ k^{\text {tp}}_{t} \cdot X^{{\sigma }}_{t}, {\textit{M}} \cdot Z^{\text {to}}_{th}\right\} \;\;\;\forall t\in {\mathcal {T}}^{\text {CHP}}, h \in {\mathcal {H}} } \end{aligned}$$
(2a)
$$\begin{aligned}&{X^{\text {tpb}}_{th} \ge k^{\text {tp}}_{t} \cdot X^{{\sigma }}_{t} - {\textit{M}} \cdot (1-Z^{\text {to}}_{th}) \;\;\;\forall t\in {\mathcal {T}}^{\text {CHP}}, h \in {\mathcal {H}}} \end{aligned}$$
(2b)
$$\begin{aligned}&{f^{\text {ha}}_{th} \cdot f^{\text {ht}}_{th}\cdot \left( k^{\text {te}}_{t}\cdot f^{\text {p}}_{th}\cdot X^{\text {rp}}_{th} + X^{\text {tpb}}_{th}\right) = X^{\text {tp}}_{th} \;\;\;\forall t\in {\mathcal {T}}^{\text {CHP}},h \in {\mathcal {H}}} \end{aligned}$$
(2c)

Constraints (2a)–(2b) limit the fixed component of thermal production of CHP technology t in time step h to the product of the thermal power production per unit of power rating and the power rating itself if the technology is operating, and 0 if it is not. Constraint (2c) relates the thermal production of a CHP technology to its constituent components, where the relationship includes a term that is proportional to electrical power production in each time step.

3.4.3 Storage system constraints

Boundary Conditions and Size Limits

$$\begin{aligned}&X^{\text {se}}_{b,0} = w^{\text {0}}_b \cdot X^{\text {bkWh}}_{b} \;\;\; \forall b\in {\mathcal {B}} \end{aligned}$$
(3a)
$$\begin{aligned}&{\underline{{w}}}^{{\,\,\text {bkWh}}}_{\,\,b} \le X^{\text {bkWh}}_{b} \le {\bar{w}}^{{\text {bkWh}}}_b \;\;\; \forall b\in {\mathcal {B}}\end{aligned}$$
(3b)
$$\begin{aligned}&{\underline{{w}}}^{\,\,{\text {bkW}}}_{\,\,b} \le X^{\text {bkW}}_{b} \le {\bar{w}}^{{\text {bkW}}}_b \;\;\; \forall b\in {\mathcal {B}} \end{aligned}$$
(3c)

Constraint (3a) initializes a storage system’s state of charge using a fraction of its energy rating; constraints (3b) and (3c) limit the storage system size under the implicit assumption that a storage system’s power and energy ratings are independent. These constraints are identical to those given in (\({\mathcal {R}}\)), but work in conjunction with significantly modified storage constraints that directly follow.

Storage Operations

$$\begin{aligned}&X^{\text {pts}}_{bth} + \sum \limits _{u \in \mathcal {U}^{{\text {s}}}_t} X^{{\text {ptg}}}_{tuh} \le f^{\text {p}}_{th} \cdot f^{\text {l}}_{t} \cdot X^{\text {rp}}_{th} \;\;\; \forall b \in \mathcal {B}^{{{\text {e}}}},\ t \in \mathcal {T}^{{{\text {e}}}},\ h \in \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3d)
$$\begin{aligned}&X^{\text {pts}}_{bth} \le f^{\text {p}}_{th} \cdot f^{\text {l}}_{t} \cdot X^{\text {rp}}_{th} \;\;\; \forall b \in \mathcal {B}^{{{\text {e}}}},\ t \in \mathcal {T}^{{{\text {e}}}},\ h \in \mathcal {H} \setminus \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3e)
$$\begin{aligned}&{X^{\text {pts}}_{bth} \le f^{\text {p}}_{th} \cdot X^{\text {tp}}_{th} \;\;\; \forall b \in \mathcal {B}^{\text {th}},\ t\in \mathcal {T}_b \setminus \mathcal {T}^{{\text {CHP}}},\ h \in \mathcal {H}} \end{aligned}$$
(3f)
$$\begin{aligned}&{X^{\text {pts}}_{bth} + X^{{\text {ptw}}}_{th}\le X^{\text {tp}}_{th} \;\;\; \forall b \in \mathcal {B}^{\text {h}},\ t\in \mathcal {T}^{{\text {CHP}}},\ h \in \mathcal {H} } \end{aligned}$$
(3g)
$$\begin{aligned}&X^{{\text {se}}}_{bh} = X^{\text {se}}_{b,h-1} + \Delta \cdot \left( \sum \limits _{t \in \mathcal {T}^{{\text {e}}}} (\eta ^{\text {+}}_{bt} \cdot X^{\text {pts}}_{bth}) + \eta ^{\text {g+}}\cdot X^{\text {gts}}_{h} - X^{\text {dfs}}_{bh} / \eta ^{\text {-}}_{b} \right) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \forall b \in \mathcal {B}^{{{\text {e}}}},\ h \in \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3h)
$$\begin{aligned}&X^{\text {se}}_{bh} = X^{\text {se}}_{b,h-1} + \Delta \cdot \left( \sum \limits _{t \in \mathcal {T}^{{{\text {e}}}}} (\eta ^{\text {+}}_{bt} \cdot X^{\text {pts}}_{bth}) - X^{\text {dfs}}_{bh} / \eta ^{\text {-}}_{b} \right) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \forall b \in \mathcal {B}^{{{\text {e}}}},\ h \in \mathcal {H} \setminus \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3i)
$$\begin{aligned}&{X^{\text {se}}_{bh} = X^{\text {se}}_{b,h-1} + \Delta \cdot \left( \sum \limits _{t \in \mathcal {T}_{b}} \eta ^{\text {+}}_{bt} \cdot X^{\text {pts}}_{bth} - X^{\text {dfs}}_{bh}/\eta ^{\text {-}}_{b} - w^{\text {d}}_{b} \cdot X^{\text {se}}_{bh} \right) }\;\;\; \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad { \forall b\in {\mathcal {B}}^{{\text {th}}} ,h \in {\mathcal {H}} } \end{aligned}$$
(3j)
$$\begin{aligned}&X^{\text {se}}_{bh} \ge {\underline{{w}}}^{\,\,\text {mcp}}_{b} \cdot X^{\text {bkWh}}_{b} \;\;\; \forall b\in {\mathcal {B}}, h \in {\mathcal {H}} \end{aligned}$$
(3k)

Constraints (3d) and (3e) restrict the electrical power that charges storage and is exported to the grid (in the former case), or that charges storage only (in the latter case, when grid export is unavailable) from each technology in each time step relative to the amount of electricity produced. Constraint (3f) provides an analogous restriction to that of constraint (3e) for thermal production, and constraint (3g) provides the same restriction for the thermal production of CHP systems. Constraints (3h), (3i), and (3j) balance state of charge for each storage system and time period for three specific cases, respectively: (i) available grid-purchased electricity, (ii) lack of grid-purchased electricity, and (iii) thermal storage, in which we account for decay. Constraint (3k) ensures that minimum state-of-charge requirements are not violated.

Charging Rates

$$\begin{aligned}&X^{\text {bkW}}_{b} \ge \sum \limits _{t \in \mathcal {T}_b} X^{\text {pts}}_{bth} + X^{\text {gts}}_{h} + X^{\text {dfs}}_{bh} \;\;\; \forall b \in {\mathcal {B}}^{{{\text {e}}}}, h \in {\mathcal {H}}^{{\text {g}}} \end{aligned}$$
(3l)
$$\begin{aligned}&X^{\text {bkW}}_{b} \ge \sum \limits _{t \in \mathcal {T}_b} X^{\text {pts}}_{bth} + X^{\text {dfs}}_{bh} \;\;\; \forall b\in {\mathcal {B}}^{{\text {e}}}, h \in {\mathcal {H}} \setminus {\mathcal {H}}^{{\text {g}}} \end{aligned}$$
(3m)
$$\begin{aligned}&{X^{\text {bkW}}_{b} \ge \sum \limits _{t \in \mathcal {T}_b} X^{\text {pts}}_{bth} + X^{\text {dfs}}_{bh} \;\;\; \forall b\in {\mathcal {B}}^{{\text {th}}}, h \in {\mathcal {H}}} \end{aligned}$$
(3n)
$$\begin{aligned}&X^{\text {se}}_{bh} \le X^{\text {bkWh}}_{b} \;\;\; \forall b\in {\mathcal {B}}, h \in {\mathcal {H}} \end{aligned}$$
(3o)

Constraints (3l) and (3m) require that a battery’s power rating must meet or exceed its rate of charge or discharge; the latter constraint considers the case in which the grid is not available. Constraint (3n) reflects the power requirements for the thermal system. Constraint (3o) requires a storage system’s energy level to be at or below the corresponding rating.

Cold and hot thermal loads

$$\begin{aligned}&{\sum \limits _{t \in {\mathcal {T}}^{^\mathrm{cl}}} f^{\text {p}}_{th} \cdot X^{\text {tp}}_{th} + \sum \limits _{b \in {\mathcal {B}}^{^\mathrm{c}}} X^{\text {dfs}}_{bh} = \delta ^{\text {c}}_h \cdot \eta ^{\text {ec}} + \sum \limits _{b \in \mathcal {B}^{^{{\text {c}}}}, t \in {\mathcal {T}}^{^{\text {cl}}}} X^{\text {pts}}_{bth} \;\;\; \forall h \in {\mathcal {H}} } \end{aligned}$$
(4a)
$$\begin{aligned}&{\sum \limits _{t \in {\mathcal {T}}^{\text {CHP}}} X^{\text {tp}}_{th} + \sum \limits _{t \in {\mathcal {T}}^{^{\text {ht}}} \setminus {\mathcal {T}}^{{\text {CHP}}}} f^{\text {p}}_{th} \cdot X^{\text {tp}}_{th} + \sum \limits _{b \in {\mathcal {B}}^{^{\text {h}}}} X^{\text {dfs}}_{bh} = \delta ^{\text {h}}_h \cdot \eta ^{\text {b}}} \nonumber \\&\quad {+ \sum \limits _{t \in {\mathcal {T}}^{\text {CHP}} } X^{{\text {ptw}}}_{th} + \sum \limits _{b \in \mathcal {B}^{{\text {h}}}, t \in {\mathcal {T}}^{^{\text {ht}}}} X^{\text {pts}}_{bth} + \sum \limits _{t \in {\mathcal {T}}^{^{\text {ac}}}} X^{\text {tp}}_{th}/\eta ^{\text {ac}} \;\;\; \forall h \in {\mathcal {H}} } \end{aligned}$$
(4b)

Constraints (4a) and (4b) balance cold and hot thermal loads, respectively, by equating the power production and the power from storage with the sum of the demand, the power to storage, and, in the case of cold loads, from the absorption chillers as well. Here, for legacy reasons, we have scaled the power by the efficiency of the respective technology; based on our variable definitions, we could have equivalently adjusted these by a coefficient of performance.

3.4.4 Production constraints

$$\begin{aligned}&X^{{\text {rp}}}_{th} \le {\bar{b}}^\sigma _{t} \cdot Z^{{\text {to}}}_{th} \;\;\; \forall t \in \mathcal {T}, h \in \mathcal {H} \end{aligned}$$
(5a)
$$\begin{aligned}&\underline{\,{ f}}^{{\,\,\,\text {td}}}_{t} \cdot X^{\sigma }_{t} - X^{{\text {rp}}}_{th} \le {\bar{b}}^{\sigma }_{t} \cdot (1 - Z^{{\text {to}}}_{th}) \;\;\; \forall t \in \mathcal {T}, h \in \mathcal {H} \end{aligned}$$
(5b)
$$\begin{aligned}&{X^{{\text {tp}}}_{th} \le X^{\sigma }_{t} \;\;\; \forall t \in \mathcal {T} \setminus \mathcal {T}^{{\text {e}}}, h \in \mathcal {H}} \end{aligned}$$
(5c)

Constraint set (5) ensures that the rated production lies between a minimum turn-down threshold and a maximum system size; constraints (5a) and (5b) are copied from Ogunmodede et al. (2021), while constraint (5c) is new. Constraint (5a) restricts system power output to its rated capacity when the technology is operating, and to 0 otherwise. Constraint (5b) ensures a minimum power output while a technology is operating; otherwise, the constraint is dominated by simple bounds on production. Constraint (5c) ensures that the thermal production of non-CHP heating and cooling technologies does not exceed system size.

The remainder of the formulation largely mimics that of (\({\mathcal {R}}\)) given in Ogunmodede et al. (2021), and is provided in the appendix (along with additional notation).

4 Solution methodology

The mathematical formulation in Section 3 extends the model given in Ogunmodede et al. (2021) to incorporate combined heat and power, which entails the introduction of more technologies and the corresponding constraints to control them, including balancing multiple loads, i.e., cold thermal, hot thermal, and electrical. As such, instances of (\({\widehat{\mathcal {R}}}\)) are more difficult to solve. In order to improve tractability and to enable the model’s use in the web-based tool described in Mishra et al. (2021), we reformulate the model by: (i) introducing tailored data structures; (ii) efficiently handling data; and, (iii) reformulating with a more streamlined set of variables. The improvements are made relative to the implementation of the formulation given in Cutler et al. (2017), and which we term (\(\bar{{\mathcal {R}}}\)).

4.1 Introducing tailored data structures

Reducing the instantiation of parameters and variables through the judicious use of sets is critical to mitigating otherwise large instances who size would preclude them from being solved in a practical amount of time. Brown and Dell (2007) (§4) point towards small examples, while Klotz and Newman (2013b) explain theoretical and computational difficulties associated with large models. Formulation (\({\widehat{\mathcal {R}}}\)) employs subsets and indexed sets to ensure that only appropriate decision variables appear in the objective function and in the constraints, either as a sum and/or according to a constraint qualifier. This reduces the size of the model, both in terms of the number of variables and in terms of the number of constraints an instance contains.

For example, the set \(\mathcal {T}\) represents all available technologies; the subset \(\mathcal {T}^{{\text {e}}}\) contains only electricity producing technologies. Similarly, \(\mathcal {B}\) represents the set of storage systems; the subset \(\mathcal {B}^{{\text {e}}}\) contains only electrical energy storage systems. Constraint (3d) highlights the efficiency of using subsets to limit electrical power dispatched to charge storage and export to the grid for electricity-producing technologies and storage systems.

$$\begin{aligned}&X^{\text {pts}}_{bth} + \sum \limits _{u \in \,\,\mathcal {U}^{{\text {s}}}_t} X^{{\text {ptg}}}_{tuh} \le f^{\text {p}}_{th} \cdot f^{\text {l}}_{t} \cdot X^{\text {rp}}_{th} \;\;\; \forall b \in \mathcal {B}^{{\text {e}}},\ t \in \mathcal {T}^{{\text {e}}},\ h \in \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3d)

The original formulation used sets, rather than subsets, controlling the terms that appeared in the constraints using binary indicator parameters. Not only did this introduce unnecessary parameters, it induced more terms in the constraint, and an increased number of constraints overall.

A construct similar to subsets that also limits the number of variables and constraints appearing in a model instance is indexed sets that restrict the size of a set to relevant elements based on another set. Constraint (3f), reformulated from the original model, provides an example in which the set of technologies considered is restricted to those associated with storage, resulting in a qualifier \(\mathcal {T}_b\), rather than a constraint based on each element in the entire set of technologies, \(\mathcal {T}\):

$$\begin{aligned}&X^{\text {pts}}_{bth} \le f^{\text {p}}_{th} \cdot X^{\text {tp}}_{th} \;\;\; \forall b \in \mathcal {B}^{\text {th}},\ t\in \mathcal {T}_b \setminus \mathcal {T}^{{\text {CHP}}},\ h \in \mathcal {H} \end{aligned}$$
(3f)

Similar to the case in which subsets replace larger sets, the case in which indexed sets replace larger sets precludes the need for binary parameters, and reduces both the number of terms a constraint contains, and the number of constraints overall in a given formulation instance.

4.2 Efficiently handling data

Data used to populate (\({\widehat{\mathcal {R}}}\)) are drawn from myriad sources, including user-specified inputs, and had been introduced into the original model at disjoint stages during its development, resulting in (i) complex calculations to determine various parameter values; (ii) superfluous variables representing calculations consisting of both parameters and variables; and, (iii) arbitrarily high variable bounds, resulting in potential numerical stability issues (in the case of simple bounds, see Klotz and Newman (2013a)), and in weak linear programming relaxations (in the case of big-m values, see Camm et al. (1990)). In order to preclude variables with unnecessarily and arbitrarily high bounds, we reduce the values using physical limitations, appropriate for a given model instance.

Constraint (1a) provides an example of a simple variable bound on \(X^{\text {f}}_{th}\):

$$\begin{aligned}&\Delta \cdot \sum \limits _{t \in \mathcal {T}_{{\textit{f} }}, h \in \mathcal {H}} X^{\text {f}}_{th} \le b^{\text {fa}}_{{\textit{f} }} \;\;\; \forall f \in \mathcal {F} \end{aligned}$$
(1a)

The maximum fuel limit, \(b^{\text {fa}}_{{\textit{f} }}\), had been an arbitrarily large value by default in the original formulation. In order to reduce the size of the feasible region and to control the discrepancy in the orders of magnitude between the largest and smallest non-zero values in a problem instance (thus, reducing the potential for numerical stability issues), we suggest a reasonable default value based on physical attributes of the system:

$$\begin{aligned} b^{\text {fa}}_{{\textit{f} }}&= {\sum _{h \in \mathcal {H}}} f^{\text {fa}}_{th} \cdot m^{\text {fbm}}_t \cdot \bar{b}^{\sigma }_{t} +f^{\text {fa}}_{th} \cdot f^{P}_{th} \cdot m^{\text {fm}}_t \cdot \bar{b}^{\sigma }_{t} \;\;\; t \in \mathcal {T}^{\text {CHP}} \\ b^{\text {fa}}_{{\textit{f} }}&= \vert \mathcal {H} \vert \cdot m^{\text {fm}}_t \cdot \bar{b}^{\sigma }_{t} \;\;\; \forall t \in \mathcal {T}^{{\text {ht}}} \setminus \mathcal {T}^{{\text {CHP}}} \\ b^{\text {fa}}_{{\textit{f} }}&=\sum _{h \in \mathcal {H}} m^{\text {fm}}_{t} \cdot f^{\text {P}}_{th} \cdot \bar{b}^{\sigma }_{t} + m^{\text {fb}}_{t} \;\;\; \forall t \in \mathcal {T}^{{\textit{f} }} \setminus (\mathcal {T}^{{\text {ht}}} \cup \mathcal {T}^{{\text {CHP}}}) \end{aligned}$$

where the first constraint pertains to a CHP technology, the second to a boiler, and the third to a diesel generator, respectively.

An example that illustrates a reduction in big-m values follows. Constraint (7a) permits nonzero power ratings only for the selected technology and corresponding subdivision in each class:

$$\begin{aligned}&X^{\sigma }_{t} \le {M} \cdot \sum \limits _{s \in \mathcal {S}_{tk}} Z^{\sigma {\text {s}}}_{tks} \;\;\; \forall c \in \mathcal {C}, t \in \mathcal {T}_{c}, k \in \mathcal {K}_{t} \end{aligned}$$
(7a)

Here, the big-m value for the system size can be given by the product of the number of hours in a day and the peak hourly load, assuming there is no economic incentive for exporting energy greater than the peak hourly load; this quantity would conservatively meet daily load, i.e., in the absence of other technologies, including storage devices:

$$\begin{aligned} {M} = \bar{b}^{\sigma }_{t} = \max _{h \in \mathcal {H}} \{24 \cdot \delta ^{\text {d}}_{h}\} \end{aligned}$$

Table 1 highlights the list of values we tailor throughout formulation (\(\widehat{{\mathcal {R}}}\)).

Table 1 Tailored values, i.e., appropriately sized variable bounds and “big-m values,” where those above the dotted line represent explicit right-hand-side “b”-values, while those below represent coefficients on binary variables that are either traditional big-m values or are potential replacements for said values based on improvements to user-specified inputs

4.3 Reformulation with streamlined variables

Mixed-integer programs can assume a variety of mathematically equivalent formulations. However, some render instances that are more easily solved than others, in large part owing not to obvious theoretical characteristics, but to a practitioner’s understanding of a solver’s ability to exploit certain mathematical structures (Trick 2005). It is in this spirit that we examine (\(\bar{{\mathcal {R}}}\)) for possible improvements in the mathematical formulation. Specifically, in the original formulation, (\(\bar{{\mathcal {R}}}\)), a set \(j \in \mathcal {J}\) informed destinations for electrical power, e.g., site demand, storage, curtailment, or the grid, and determined the relevance of a technology for a particular constraint. Correspondingly, a decision variable, \(\hat{Y}^{{\text {rp}}}_{tjhsu}\), appearing in the original model represented the rated production of technology t at destination j during time step h in segment s from pricing tier u, in which elements t in the set \(\mathcal {T}\) represented all dispatchable technologies, including electricity from the grid. Separately, the decision variable \(\hat{Y}^{{\text {g}}}_{jheun}\) was defined as electrical power from the grid dispatched to destination j, in time step h, for demand bin e, in pricing tier u, and monthly peak demand tier n, and a constraint ensured that rated production by the utility was equal to grid purchases:

$$\begin{aligned} \sum _{s \in \mathcal {S}} \hat{Y}^{{\text {rp}}}_{tjhsu} = \sum _{e \in \mathcal {E}, n \in \mathcal {N}} \hat{Y}^{{\text {g}}}_{jheun} \;\;\; \forall j \in \mathcal {J}, u \in \mathcal {U}, h \in \mathcal {H}, t \in \mathcal {T}: t = {\text {`Grid'}} \end{aligned}$$

Formulation (\({\widehat{\mathcal {R}}}\)) assumes that electricity from the grid has unlimited availability, removing the need for the above-mentioned constraint. In turn, we note that we can eliminate sets \(\mathcal {U},\ \mathcal {S},\) and \(\mathcal {J}\) from a variable representing production for the following reasons, respectively: (i) grid purchases are represented by a separate decision variable, so we can excise the utility from the collection of technologies \(\mathcal {T}\), and we can remove the utility-specific pricing tier index u from rated production; (ii) the set of segments \(s \in \mathcal {S}\) is only utilized for system sizing decisions; and, (iii) the set of destinations is now informed solely by the technology type. This results in the transformation of the more complicated variable \(\hat{Y}^{{\text {rp}}}_{tjhsu}\) into the much simplified rated production variable, \(X^{\text {rp}}_{th}\), where the latter variable is related to system size as follows:

$$\begin{aligned}&X^{\sigma }_{t} \le \bar{b}^{\sigma }_{t} \cdot \sum \limits _{s \in \mathcal {S}_{tk}} Z^{\sigma {\text {s}}}_{tks} \;\;\; \forall c \in \mathcal {C}, t \in \mathcal {T}_{c}, k \in \mathcal {K}_{t} \end{aligned}$$
(7a)
$$\begin{aligned}&X^{\text {rp}}_{th} = X^{\sigma }_{t} \;\;\; \forall t \in \mathcal {T}^{\text {td}}, h \in \mathcal {H} \end{aligned}$$
(7b)
$$\begin{aligned}&X^{\text {rp}}_{th} \le f^{\text {ed}}_{th}\cdot X^{\sigma }_{t} \;\;\; \forall t \in \mathcal {T} \setminus \mathcal {T}^{\text {td}}, h \in \mathcal {H} \end{aligned}$$
(7c)

We replace the set of destinations \(\mathcal {J}\) with variables that represent power flows to the grid (\(X^{{\text {ptg}}}_{tuh}\)) and to storage (\(X^{\text {pts}}_{bth}\)). The relationships between these variables are enforced as follows:

$$\begin{aligned}&X^{\text {pts}}_{bth} + \sum \limits _{u \in \,\mathcal {U}^{{\text {s}}}_t} X^{{\text {ptg}}}_{tuh} \le f^{\text {p}}_{th} \cdot f^{\text {l}}_{t} \cdot X^{\text {rp}}_{th} \;\;\; \forall b \in \mathcal {B}^{{\text {e}}},\ t \in \mathcal {T}^{{\text {e}}},\ h \in \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3d)
$$\begin{aligned}&X^{\text {pts}}_{bth} \le f^{\text {p}}_{th} \cdot f^{\text {l}}_{t} \cdot X^{\text {rp}}_{th} \;\;\; \forall b \in \mathcal {B}^{{\text {e}}},\ t \in \mathcal {T}^{{\text {e}}},\ h \in \mathcal {H} \setminus \mathcal {H}^{{\text {g}}} \end{aligned}$$
(3e)

And to remove destination j from the original variable \(\hat{Y}^{{\text {g}}}_{jheun}\) containing it, we employ a decision variable for the flow of electricity from the grid to storage (\(X^{\text {gts}}_{h}\)):

$$\begin{aligned} \sum \limits _{u \in \mathcal {U}^{\text {p}}} X^{\text {g}}_{uh} \ge X^{\text {gts}}_{h} \;\;\; \forall h \in \mathcal {H}^{{\text {g}}} \end{aligned}$$
(8c)

Without the indices e and n, we enforce peak demand by billing period via constraints (11d) and (12d):

$$\begin{aligned}&\sum \limits _{n \in \mathcal {N}}X^{\text {dn}}_{mn} \ge \sum \limits _{u \in \mathcal {U}^{\text {p}} } X^{\text {g}}_{uh} \;\;\; \forall m \in \mathcal {M}, h \in \mathcal {H}_m \end{aligned}$$
(11d)
$$\begin{aligned}&\sum \limits _{e \in \mathcal {E}} X^{\text {de}}_{de} \ge \max _{h \in \mathcal {H}_{d}}\left\{ \sum \limits _{u \in \mathcal {U}^{\text {p}}} X^{\text {g}}_{uh}, \delta ^{\text {lp}} \cdot X^{\text {plb}} \right\} \;\;\; \forall d \in \mathcal {D} \end{aligned}$$
(12d)

Finally, constraints (8a) and (8b) balance load using the rated production and grid purchasing variables described above. Figure 3 provides a network flow representation of electrical load balancing under the reformulation, with PV and storage as the technologies, and a grid connection.

Fig. 3
figure 3

A network flow representation of electrical load balancing in the reformulated model, using a PV system and a battery as the on-site technologies

The revised formulation contains significantly fewer variables. In Fig. 3, the blue nodes represent sources and the red nodes represent destinations. While inflows and outflows are balanced for the technologies and utility, constraints (8a) and (8b) enforce flow balance for the node labeled “Site Load” in periods with utility connectivity and with an outage, respectively. Constraints (3d) and (3e) enforce nonnegative flows from PV to site load with and without a grid connection, respectively. Constraints (8c) and (8d) provide an analogous restriction on flows to site load from the utility and the battery, respectively.

One demonstration of the increased efficiency of our reformulation is the presence of at most one arc between each pair of nodes in Fig. 3, whereas in a representation of the previous formulation, each arc departing from PV would have had one copy for each segment s, and each arc departing from the utility would have had at least one additional copy due to the presence of both rated-production and grid-purchase decision variables for the utility, regardless of the number of redundant copies due to additional sets in both cases.

5 Data and results

We derive data for the 12 cases against which we evaluate our performance-enhancing techniques from a test set developed by the National Renewable Energy Laboratory. Each case contains combined heat and power and a boiler, and also some combination of solar photovoltaics, electric chillers, absorption chillers, along with different forms of energy storage such as batteries and thermal (hot and cold) energy storage; we solve for a year’s worth of dispatch decisions at hourly fidelity. In order to fully exercise the model attributes formulated mathematically and explained in Section 3, the case studies differ in the building type, total electrical energy pricing tiers (\(|{\mathcal {U}}|\)), monthly peak demand tiers (\(|{\mathcal {N}}|\)), time-of-use demand periods (\(|{\mathcal {D}}|\)), and whether standby charges apply. (We note that standby charges occur only if CHP technologies are not allowed to reduce peak demand; see constraint (11d) and constraint (12d).)

We first present the results by comparing models (\(\widehat{{\mathcal {R}}}\)) and (\(\bar{{\mathcal {R}}}\)) in terms of their problem statistics. Secondly, we compare run-time performance. Finally, we showcase our model’s ability to minimize the users’ dependency on the grid, especially during peak demand, by highlighting aspects of a solution to one case.

Table 2 Problem statistics for the 12 cases on which we perform computational experiments comparing model (\(\bar{{\mathcal {R}}}\)) and model (\(\widehat{{\mathcal {R}}}\))

5.1 Model statistics

Because of the complicated mathematical structure of our model and the size of our cases, we reformulate model (\(\bar{{\mathcal {R}}}\)) as (\(\widehat{{\mathcal {R}}}\)) using the methods described in Section 4. Table 2 shows the improvements in reformulation (\(\widehat{{\mathcal {R}}}\)) as a percent reduction in the number of variables and constraints. We concede that this reduction comes at the expense of a denser A matrix, owing to a more “compact” set of constraints, but the reduction in problem size more than offsets the increased density. That is, the approximately 40% reduction in both the number of variables and in the number of constraints in the reformulated model more than offsets the approximately same increase in the density of the constraint matrix when comparing solve times of the two models; this can be attributed to our use of simplex-based (versus interior point) methods. Furthermore, our reformulated model contains data that is much better scaled than that of the original model, where the decrease between the largest and smallest non-zero values is five (or more) orders of magnitude.

5.2 Model performance

Model (\(\bar{{\mathcal {R}}}\)) is implemented in Mosel (FICO 2021b) while model (\(\widehat{{\mathcal {R}}}\)) is implemented in AMPL (Fourer et al. 2004); the difference in modeling language is the result of a legacy formulation versus a convenient instrument that enabled us to easily implement the enhancements we describe in Section 4, respectively. They are both solved using default algorithmic settings in Xpress V8.8.0 (FICO 2021a) on a Dell Power Edge R410 server with two Intel Xeon E5520s at 2.27 GHz 28GB RAM, and 1TB HDD. We display problem characteristics associated with each case, and provide the corresponding performance in terms of percent optimality gap achieved within a 10-minute time limit, which was deemed to be appropriate given that our model is embedded in a web-based tool. Table 3 shows that, in each case, model (\(\widehat{{\mathcal {R}}}\)) performs better than (\(\bar{{\mathcal {R}}}\)) by achieving a tighter optimality gap. For each case in which the model finds a feasible solution, the gaps average more than 28% for model (\(\bar{{\mathcal {R}}}\)), whereas the corresponding average gap is slightly greater than 2% for these same cases with model (\(\widehat{{\mathcal {R}}}\)). For Case 9, the only one that exercises every possible technology combined with both hot and cold thermal energy storage, (\(\bar{{\mathcal {R}}}\)) cannot find a feasible solution within the time limit, while (\(\widehat{{\mathcal {R}}}\)) finds a solution with a 2.65% optimality gap. Case 7 is another extreme that reaches only a 99.3% gap using (\(\bar{{\mathcal {R}}}\)), whereas (\(\widehat{{\mathcal {R}}}\)) is able to reach a 1.11% optimality gap within the time limit. On average (excluding case 9), the overall gap improves by about 88% using formulation (\(\widehat{{\mathcal {R}}}\)).

Because our formulation is an extension of model (\({\mathcal {R}}\)) in Ogunmodede et al. (2021), we also test those cases (i.e., without CHP) and find that our implementation outperforms the original with solution times that average between 30 and 60 seconds, amounting to a reduction of as much as two orders of magnitude (using the same software and hardware).

Table 3 Results comparing solution quality obtained from model (\(\bar{{\mathcal {R}}}\)) and model (\(\widehat{{\mathcal {R}}}\)) within a 10-min time limit, using AMPL and Mosel Xpress default settings

5.3 Model dispatch strategy

We examine the solution determined by (\(\widehat{{\mathcal {R}}}\)) for Case 9 which prescribes the systems shown in Table 4.

Table 4 Model (\(\widehat{{\mathcal {R}}}\))’s technology mix for Case 9

Figure 4 displays how the technologies are dispatched to meet hourly site requirements while reducing electrical power consumption from the utility relative to the business-as-usual scenario, which only employs the utility, the boiler, and the electric chiller to meet the electrical, heating, and cooling loads, respectively.

Fig. 4
figure 4

Dispatch summary for one week within Case 9, in which the technologies reduce peak electrical power consumption from the utility while meeting all hourly site loads

Typically, in an electrical demand graph (see Fig. 4a), there are five high-demand periods representing the afternoon and evening of each weekday. However, due to Christmas day occurring on Monday of the respective week, there are four. The dashed line highlights the business-as-usual scenario in which the hospital’s cooling load is entirely met by the electric chiller. The optimized solution for Case 9 exhibits battery discharge, PV, and CHP—reducing the peak utility consumption to 212 kW to meet the majority of the electrical load. Figure 4b highlights the dispatch strategy of the CHP and the boiler systems. As part of peak-shaving, the absorption chiller is used instead of the electric chiller, and CHP is run at capacity. The heat provided by CHP cannot meet both the load consumed by the absorption chiller and the site heating load; therefore, the boiler makes up the difference. Figure 4c demonstrates the dispatch strategies of the absorption chiller, electric chiller and the chilled water thermal storage system serving the cooling demand. The use of the absorption chiller reduces the dependence of the system on the existing electric chiller, thereby reducing the total electricity usage. The solution associated with model (\(\widehat{{\mathcal {R}}}\)) represents a 22% savings over business-as-usual.

6 Conclusions

We examine a mixed-integer program that designs and dispatches renewable energy technologies and combined heat and power with a grid option. Instances of our mixed-integer program contain hundreds of thousands of variables and constraints, rendering an initial instantiation of our model intractable. To improve performance, we tailor data structures, efficiently handle data, and streamline the formulation through variable redefinition. These enhancements result in solutions within about 2% of optimality, on average, for the cases we test within a ten-minute time limit, rendering use of the model appropriate for a web-based tool. Without the enhancements, instances generally remain at optimality gaps well above 10% within the same time limit.

Future work could entail implementing a decomposition procedure to further expedite solutions, and employing the model in international settings such as emerging markets of sub-Saharan Africa where opportunities for combined heat and power could enhance economic growth. Additionally, experimental work in thermal science might reveal that a more detailed combined heat and power representation might better reflect the operations of this technology. Finally, domestic implementation calls for myriad variations of the model and its output, such as considering alternate objective functions that would encompass resiliency and efficiency, and examining a diversity of solutions that would capture intangibles.