**Abbreviations**

The following abbreviations are used in this manuscript:


## **Appendix A. Technology Equations**

In this section, the equations for different technologies which are not presented in the article are provided.

## *Appendix A.1. General Constraints*

All technologies are limited in their power output with their capacity *Qcap*,*<sup>j</sup>* according to Equation (A1).

$$\begin{cases} Q\_j \le Q\_{cap,j} \\ P\_j \le P\_{cap,j} \\ K\_j \le K\_{cap,j} \end{cases} \tag{A1}$$

As mentioned in Section 2.1.3, the biomass boiler and the CHP unit are not always dispatchable. Therefore, they are regularly fixed to specific levels (Equation (A2)). Moreover, HPS, HPW1, HPW2, and the absorption chiller are only in operation during specific periods of the year, as also represented by Equation (A2).

$$Q\_{j,t} = Q\_{fix,j,t} \qquad \forall t \in t\_{undisptchle} \tag{A2}$$

*Appendix A.2. Biomass Boiler (B) and Flue Gas Condenser (FGC)*

The heat produced in the boiler (Equation (A3)) is related to the fuel input (*Qf uel*,*B*,*<sup>t</sup>*) and the efficiency of the boiler (*ηB*) . Besides, the heat recovered from the flue gas condenser (Equation (A4)) is related to the heat not absorbed by boiler and the efficiency of the condenser (*ηf gc*).

Since the flue gas condenser and the biomass boiler are in the same unit, their heat is aggregated and presented as one unit in this study (Equation (A5)).

$$Q\_{B,t} = Q\_{fuel,B,t} \times \eta\_B \tag{A3}$$

$$Q\_{f\emptyset \mathbb{S},t} = Q\_{fuel,\mathbb{B},t} \times (1 - \eta\_{\mathbb{B}}) \times \eta\_{f\emptyset \mathbb{S}} \tag{A4}$$

$$Q\_{\mathcal{B} + f\_{\mathcal{S}}\mathbf{c}, t} = Q\_{\mathcal{B}, t} + Q\_{f\_{\mathcal{S}}\mathbf{c}, t} \tag{A5}$$

Moreover, the changes in boiler's output is limited to the ramp-up (*RUB*) and ramp-down (*RDB*) limits (Equation (A6)).

$$RLI\_B \le Q\_{B,t} - Q\_{B,t-1} \le RD\_B \tag{A6}$$

As shown in Figure 2, the export to external district heating can only come from the biomass boiler and therefore is limited to its production (Equation (A7)).

$$Q\_{exp,t} \le Q\_{B,t} \tag{A7}$$

#### *Appendix A.3. Combined Heat and Power*

The CHP unit has a boiler and a turbine. The system can regulate how much of the heat produced in the CHP boiler (*Qchpb* ) is to be sent directly to the local district heating network (*Qchpb*<sup>2</sup>*g* ) or to the turbine (*Qchptr*). Moreover, the heat which is not converted to power in the turbine can be recovered and sent to the district heating grid afterward (*Qchphtr*).

In this study, the heat from the CHP unit is the sum of the heat sent directly from the boiler to the grid and the heat from the turbine (Equation (A8)). The heat produced by the boiler is related to the fuel input and the efficiency of the boiler (Equation (A9)). Moreover, the power production in the turbine is calculated based on the efficiency of the turbine and how much heat is sent to it (Equation (A11)).

$$Q\_{chp,t} = Q\_{chp\_{b2g},t} + Q\_{chp\_{htr},t} \tag{A8}$$

$$Q\_{chp\_b t} = Q\_{fuel, chp\_b t} \times \eta\_{chp\_b} \tag{A9}$$

$$Q\_{\rm chp\_{lrr},t} = Q\_{\rm chp\_{lr},t} \times (1 - \eta\_{tr}) \tag{A10}$$

$$P\_{\rm chpr\_{tr},t} = Q\_{\rm chpr\_{tr},t} \times \eta\_{tr} \tag{A11}$$

## *Appendix A.4. Absorption Chiller*

The cooling production level of the absorption chiller (*Kabsc*) is related to the cooling coefficient of performance (*COPk*,*absc*) and presented in Equation (A12).

$$K\_{\text{absc},t} = \text{COP}\_{\text{k},\text{absc}} \times Q\_{\text{absc},t} \tag{A12}$$

The absorption chiller has a minimum operation limit during the cooling season (Equation (A13)). The cooling season is presented in Table A2 and *Kmin*,*absc*,*<sup>t</sup>* is considered to be 200 kW in this case study.

$$K\_{\text{absc},t} \ge K\_{\text{min,absc},t} \tag{A13}$$

*Appendix A.5. Refrigeration Heat Pump (*HPR*)*

Due to the local system's limitations, the heating produced as the byproduct of this heat pump is limited to 20% of the heating load of the building it is situated in (*Qdem*,*x*,*<sup>t</sup>*).This constraint is presented in Equation (A14).

$$Q\_{hp\_rt} \le 0.2 \times Q\_{dem\_rx,t} \tag{A14}$$

## *Appendix A.6. Storages*

All of the storages are limited to their respective energy capacities (*ENcap*). This constraint is presented in Equation (A15).

$$EN\_{j,t} \le EN\_{cap,j} \tag{A15}$$

The energy level of the storage unit (Equation (A16)) is related to the previous energy state, the amounts of charging (*Pch*,*j*,*<sup>t</sup>*) and discharging (*Pdis*,*j*,*<sup>t</sup>*), and the efficiencies of charging (*ηch*) and

discharging (*ηdis*). Charging and discharging efficiencies are considered to be equal in each unit. Moreover, for the cold water basin, instead of *P*, *K* is used in Equation (A16).

$$EN\_{j,t} = EN\_{j,t-1} + P\_{ch,j,t} \times \eta\_{ch} - P\_{dis\_{\eta},t} \times \frac{1}{\eta\_{dis}} \tag{A16}$$

Appendix A.6.1. Cold Water Basin (CWB)

Due to local system's limitations, discharging of the cold water basin is only limited to the cooling load of the building it is situated in ( *Kdem*,*y*,*<sup>t</sup>*). This constraint is presented in Equation (A17).

$$\mathbb{K}\_{dis,cuvb,t} \le \mathbb{K}\_{dem,y,t} \tag{A17}$$

Moreover, it has been observed that only considering the charging and discharging efficiencies will not stop simultaneous charge and discharge of the cold water basin. The reason is that the cooling demand is lower than heating demand in the district as a whole and there is not enough cooling storage to handle the excess produced cooling. Therefore, the optimizer would theoretically curtail cooling by charging and discharging at the same time, causing additional losses in the cooling system.

To prevent simultaneous charging and discharging, binary variables are used (Equation (A18)) where *b* is the binary variable and *M* is a big number (106kW in this case study).

$$\begin{cases} b\_{ch,cwb,t} + b\_{dis,cwb,t} \le 1 \\ \mathcal{K}\_{cl,cwb,t} \le b\_{cl,cwb,t} \times \mathcal{M} \\ \mathcal{K}\_{dis,cwb,t} \le b\_{dis,cwb,t} \times \mathcal{M} \end{cases} \tag{A18}$$

Appendix A.6.2. Battery

For the battery units, an additional constraint is considered on the minimum state of charge (*SOCmin*). This constraint (Equation (A19)) is to prevent high degradation costs.

$$EN\_{\rm bcs,t} \ge EN\_{\rm cap,bcs} \times SOC\_{\rm min} \tag{A19}$$

## **Appendix B. Input Data**

In this section, the input data for energy technologies, marginal emissions, marginal prices, and energy demand of the campus are provided. The parameters for energy technologies are presented in Table A1.

The heating and cooling seasons, which are considered for the heat pumps' and absorption chiller's operation is presented in Table A2.

Results from simulation models are very dependent on their assumptions and therefore other emission factors or marginal prices can affect the simulation results. With the developed model, similar studies can be performed to assess efficient abatement strategies in other locations or with different assumptions. The marginal emissions and marginal prices for external electricity and district heating networks that are used in this study are presented in Figures A1 and A2. The emission factors used for calculating the marginal emissions are presented in Tables A3 and A4.

All electricity efficiencies and emission factors are based on [35,36], except for oil and waste incineration where the work of Bertoldi et al. [37] is the source. Pumped hydro and 'Unknown' are taken from [29]. Pumped hydro is based on average Swedish emissions during times when hydro is being charged. 'Unknown' is based on the average generation plant in the Swedish electrical grid. The emission factors for CHP units are calculated based on the Benefit Allocation Method [38].


**Table A1.** Technology characteristics.



**Figure A1.** Marginal prices from external electricity and district heating networks over the simulated period.

**Figure A2.** Marginal emissions from external electricity and district heating networks over the simulated period.

In the district heating system, the emission factor (Table A3) for the marginal unit is considered to be the marginal emission factor for every hour. The emission factors are primarily based on the energy allocation method which may differ from current practice among district heating operators in Sweden. More details on the calculation of the emissions factors can be found in Supplementary Materials based on the following references [35–39]. The hourly marginal unit data are taken from a district heating operator in Sweden. Based on the information from the district heating provider, for this dataset, the most expensive unit at each hour has been assumed to be the marginal unit. However, the common practice for marginal unit allocation in the external district heating system is not necessarily the most expensive unit because of other constraints such as the ramp-up and ramp-down limitations of the units. However, due to limited data access on the external district heating network, this assumption was considered reasonable.

**Table A3.** Emission factors for district heating units. HOB is the heat only boiler, RH is the waste heat from refineries, and WI is waste incineration.


For calculating the marginal emissions for the electricity grid, a statistical method is used to predict the marginal emissions at every hour based on historical data [40]. Firstly, the probability that each technology is on the margin based on a consumed unit of electricity in Sweden is taken from Electricity Map [29]. Secondly, the probabilities are multiplied by the relevant emission factor of each technology and summed. The emission factors for each technology can be seen in Table A4.

**Table A4.** Emission factors of different technologies for electricity grid.


The differing approaches for calculating marginal emissions in the electricity and district heating networks are due to the respective size of these systems and therefore the ability to know precisely which unit is on the margin. The district heating network of a city is usually smaller than the electricity network and limited to the boundaries of the city. Identification of the exact marginal unit can therefore be easily estimated. However, the electricity network is much larger and tangled with production units in other countries through import and export across regional and country borders. Since the

exact marginal unit cannot be identified, the electricity system's marginal emissions are determined by statistical methods, as described above.

Energy demand of the campus for electricity, heating, and cooling for the simulation period is presented in Figure A3. The simulation period is selected based on availability and quality of real data from the campus energy system. The simulations are run for the period from 1 March 2016 to 28 February 2017.

**Figure A3.** Energy demand of the Chalmers campus over the simulated period. The simulated period is from 1 March 2016 to 28 February 2017.
