for mixed-type buildings

Energy ef ﬁ ciency and renewable energy solutions in buildings is an important and actual research topic. Operating and ﬁ xed costs of sustainable energy solutions can be reduced by using optimization models. We developed a novel optimization model and applied it for a mixed-type building with commercial, of ﬁ ce, and residential parts in Finland. The model determines the optimal con ﬁ guration, dimensioning, and operation of different local energy production and storage technologies for power, heat, and cooling. The model is formulated as a large dynamic linear or mixed-integer linear programming model (LP/MILP) for a full year. The result shows that district heating, district cooling, energy storage, heat pumps, and photovoltaics as a hybrid solution for a building can both reduce the combined operating and ﬁ xed costs annually by 27100 V , and support meeting the nearly Zero Energy Building requirements with E -value limit of 107 kWh/m2/a. Photovoltaics can be pro ﬁ table when consumed maximally at the building. While heat and cooling storages are cost-ef ﬁ cient for balancing demand and supply, power storages are still too expensive. District heating and heat pump heating worked synergetically together, but district cooling and heat pump cooling were mutually exclusive choices at nearly equal cost. © 2021 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license


Background
Improved energy efficiency can reduce greenhouse gas emissions and lower energy costs on a household and economy-wide level [1,2]. By the EU Energy Performance of Buildings Directive, nearly zero-energy building (nZEB) means a building with very high energy performance. In addition, the required energy should be covered mainly by renewable sources [3]. The majority of Member States have a completed national nZEB definition in force. Most of the provided reports include an energy indicator of primary energy use and include the obligation to cover a minimum energy demand share from renewable sources [4]. The Finnish Ministry of the Environment clarifies that the products and technical building systems with their measurement systems must be used as intended. Also, energy consumption and power demand should remain low, and the energy consumption must be monitored [5].
Planning and optimal operation of efficient hybrid renewable energy systems is an economically competitive solution to reach decarbonization and to reduce greenhouse gas emissions of buildings [6]. There are already many pilot projects in the EU integrating renewable energy sources (RES) such as solar, wind, and geothermal into energy systems [7]. This study is focused on optimizing together the configuration, dimensioning, and operation of hybrid energy solutions for buildings, based on energy production possibilities commonly available in Finland. Finland is one of the leading countries in RES utilization [8]. District heating (DH) is an important, widely applied energy form and natural heating choice for buildings in urban areas. Over half of floor space in Finland is heated using DH, and over 90% in Helsinki. Important benefits of DH are ability to use various waste heat sources to lower heating costs and emissions compared to using fuels alone [9]. District cooling (DC) is a rising energy trend in major cities. DC has more limited coverage, but the network is growing rapidly.
Different kinds of heat pumps, such as ground source and air source heat pumps are commonly used outside the urban areas of Finland, and gain popularity also in cities where DH is available. Heat pumps can also be used as part of DH/DC systems. One of the world's largest heat pump plants producing DH and DC together operates in Helsinki, under the Katri Vala Park. The capacity is 90 MW DH and 60 MW DC [10].
Photovoltaic power (PV) is a globally booming renewable technology. However, PV is highly intermittent, depending on cloudiness, time of the day, season, and, therefore, non-coincident with building load. The non-coincidence is a particular problem in the northern latitude of Finland. This study shows that the PV production to the grid is still not profitable, but production to satisfy local demand within a building is more efficient both in terms of transmission losses and costs.
Energy storages can help balance non-coincident production and demand of heat, cooling, and power. While heat and cooling can be stored at reasonable cost, power storage is still a very expensive technology.

Related research
Our study involves many technologies and energy forms in one mixed-type building; therefore, the literature survey field is broad. The related research survey starts from hybrid systems in different facilities and energy system planning, ending with optimization methodologies, optimizing system sizes or management costs. Many studies have considered different subsets of optimizing the configuration, dimensioning, and operation of hybrid energy solutions for buildings. Some focus mainly on the reduction of CO 2 emissions in the buildings and energy management optimization. Hirvonen et al. [11] reported the most cost-effective solution with a ground source heat pump system. In the study he used a dynamic building simulation and optimization tool and annual average emission factor for district heating. Pylsy et al. [12] used average monthly emission factors for electricity that were determined and used without dynamic interconnection between buildings and the energy system. Other investigated studies focused on combining technologies for providing heat and power to different kind of buildings, and at the same time optimizing costs. Koskela et al. [13] studied optimal sizing of PV with battery storage. He applied the energy community model to maximize local utilization of PV. Langer et al. [14] included a single representative residential building equipped with a PV system, a modulating heat pump, thermal energy storage systems for floor heating and hot-water supply, and a battery. Rehman et al. [15] investigated the energy system with photovoltaic-thermal panels, providing electricity and heat to the building by adding a power bank and several long-and short-term thermal storages to reduce electricity curtailment and import. Fitzpatrick et al. [16] used a residential building equipped with a hybrid heat pump coupled with a thermal energy storage unit. A predictive control algorithm was used to minimize the daily operating cost over a full heating season. Pinamonti et al. [17] analyzed solar-assisted heat pump (SAHP) configurations for a residential building, in combination with energy storage technologies to find factors that decrease the energy demand of the system, increase the self-consumption of solar energy, and minimize the installation cost. Habib et al. [18], proposed a day-ahead operative model of hybrid energy system for three separate buildings: hotel, office, and market. Genetic algorithm was used to optimize a cost function to treat battery storage, but no dimensioning or configuration optimization was proposed.
Another angle of the studies lies in optimizing sizes of the  [19], proposed an energy management optimization of storage with PV-integrated low-energy buildings, including various scenarios for different aims. Some concepts focus on battery health by minimizing the battery cycling aging when others minimize the net grid power's standard deviation and reduce the exceeded load. Luerssen et al. [20] included cooling applications coupled with PV systems and highlight the role of energy storage. Comello et al. [21] presented a metric for energy storage cost and identifying optimally sized storage systems. Hakimi at el [22]. proposed an optimal sizing of PV/diesel with the aim of minimizing cost and improving reliability by a levy flight-based particle swarm optimization (PSO). The optimal location and capacity of energy storage systems (ESS) have been determined in purpose of cost minimisation, reliability improvement, and load shaving. Also, a multi-criteria method has been proposed to optimally size wind turbine (WT), PV, fuel cell (FC), electrolyzer, hydrogen tank, and batteries, although the annual cost and the sources' movement have not been considered in the study. Studies on meeting the nZEB requirements are also found. Jung et al. [23] described the energy performance for office buildings in three cases relying on the nZEB concept in three climate zones, including Helsinki in Finland, London in the United Kingdom, and Bucharest in Romania. Reda et al. [24] concluded that nZEB concepts in Finland could be achieved by adopting the Finnish passive design principles without installing renewable energy systems onsite.
In our study we use linear programming (LP) software, which is commonly met in studies. Xia et al. [25] used LP optimization in the district multi energy system (MES) planning. The MES obtained techno-economic parameters of candidate devices (like PV, CS, etc), the year-round operating boundary conditions of MES, load profile, import and export energy price, available output of renewable energy sources in purpose to find the suitable device combination to minimize overall costs. Abdollahi et al. [26] formed a parametric LP analysis that was applied to models for determining the optimal marginal operating costs as a function of power production for multi-area combined heat and power production with power transmission and storage. Klemm et al. [27] reviewed various modeling methods and showed that with LP it is possible to optimize models with multiple energy sectors (e.g., multi-energy systems) and where many stakeholders with different interests participate. Abdollahi et al. [28] applied parametric linear programming analysis for determining the optimal marginal operating costs as a function of power production for multi-area heat and electricity production transmission and storage. In the second phase of network model was solved using generic sparse linear programming software. Wang et al. [29] performed a mixed-integer linear programming (MILP) optimization model for multiple heat storages in distributed system, according to energy qualities in a short computation time. Vignali et al. [30] used stochastic optimization of building cooling system using dynamic programming for a cooling storage. Growth of dynamic programming state space becomes a problem with more than one storage or production units. Other met methodologies and tools used for obtaining the optimization results, are TRNSYS combined with jEPlus þ EA (Evolutionary Algorithm) [31], Advanced Energy System Analysis Tool EnergyPLAN for costs [32], for CO 2 emissions [33], an hourly based resolution for electricity, heat, and transportation sectors [34], or energy consumption in office buildings [35]. Zhang et al. [36] proposed a multi-objective EA, BBMOPSO-A, to deal with the optimization problem of building energy performance and integrated the algorithm into EnergyPlus software. Pinto et al. [37] used Stochastic Multicriteria Acceptability Analysis (SMAA), a simulation-based method specifically designed to consider imprecise information to support decision-making about carbon-neutral technologies for DH. Kirppu et al. [38] used the same method in a real-life case applying multicriteria decision analysis to evaluate carbon-neutral heat-only production technologies in the DH system of Helsinki.

Research gap and novelty of this study
There are no studies that optimize together the configuration, dimensioning, and operation of hybrid energy solutions in buildings including heating, cooling, power, local RES production and multiple storages. Only very few studies have addressed the costefficient utilization of PV in buildings at northern latitudes [13,39,40].
This study aims to optimize hybrid low-emission energy technologies for a mixed-type (residential, office, commercial) building in the Helsinki region. Different types of buildings will exhibit different load profiles due to the building functions. For example, residential buildings have a morning and evening peak in energy consumption, while office buildings consume energy mostly during the office hours and very little in the night, and commercial buildings typically have specific cooling loads due to cool storages. The combined load profile in a mixed-type building is thus more complicated, but can also be more uniform due to non-concident loads of the different functions. This makes it interesting to study how different renewable energy forms together with storages can satisfy the demand in a cost-efficient manner. The model can also be used for other types of buildings and other locations, if the appropriate yearly load profiles are available, and be extended with other energy RES technologies.
In particular, we optimize the building's combined operating and fixed costs while meeting current nZEB requirements. The model solves simultaneously the building energy system's optimal operation, decides which technologies to include, and how to dimension them. We define the model development in Section 2. In Section 3, we describe the target building. Section 4 describes the data for the study. In Section 5 we present the results on the analysis. Section 6 contains conclusions and directions for future research.

Methodology
In a hybrid energy system, everything depends on everything. Heat pumps combine power with heat and cooling, storages combine hourly periods together and interact with supply and demand of corresponding energy form, while wind and solar power affect power price and balance between supply and demand. Due to the complex dependencies between different energy forms and system dynamics caused by storages, the optimum can be found only using an integrated optimization model.
We have developed a model for optimizing the combined operating and fixed costs of the energy solutions of a mixed residential, commercial, and office building. The operating costs depend on how the energy system is operated while the fixed costs depend on the dimensioning of supply and storage components. The model is a multi-period linear programming (LP) or mixed integer linear programming (MILP) model that balances the hourly supply and demand of power, heat, and cooling for any given time horizon. In this study, we apply the model for one year (8760 h). The methodology is universal, the model can be applied for other countries, but the results and conclusions depend on local conditions such as solar radiation, investment and production costs, load profiles, etc.
The model is based on given full year (historical or predicted) hourly demand for power, heat, and cooling, and solar radiation in the target location. The model balances optimally the hourly need for each of the three commodities with supply from different sources, such as power from the grid, DH, DC, PV, and heat pumps for heating and cooling. Also, storages for power, heat and cooling are used in the balancing. The objective function is to minimize the overall operative and fixed costs of the energy system. The fixed costs depend on the dimensioning of the different energy supplies and storages.

Model validation
The model was validated by building it up incrementally and validating each component first separately and then together. Each component was first optimized separately in simple cases where the optimal operation could be verified without an optimization model. For example, without storage, the optimal hourly operation can be determined by applying different production technologies in price order. After that, sensitivity analysis was used to see that the model reacted correctly to changes in input parameters.

Structure of the optimization model
The model determines the building energy system's optimal operation and the dimensioning of different energy supplies and storage. Fig. 1 illustrates the full energy system considered in this study. The energy system covers three energy forms: heating, cooling and electric power. Demand of each energy form can be balanced with different technologies: local production, external energy, and storages. The power balance connects power demand with power purchase from the grid, local PV production, and the power storage. Possible excess power can also be sold back to the grid. Similarly, heat and cooling balances combine demand for heat and cooling with corresponding energy sources and storages. The demand of different energy forms are pooled together across the different building functions. This implements the energy community model to maximize local use of local RES production [13]. The model can be solved with any combination of the technologies included or excluded.
The model is a high-level model that does not deal explicitly with uncertainties in input data, transmission losses between units (losses are counted in each technology separately), or different temperature levels for DH or DC. The effect of uncertain input data could be considered by running the model many times with stochastic input data. Because we solve the model using full-year data, price and demand volatility is already considered in the optimization.

Objective function
The objective is to minimize the combined operating and fixed energy costs for the building. Fixed costs for purchased energy (DH, DC, power from the grid) depend linearly on the maximal hourly supply (kWh/h). Fixed costs for local energy production technologies (PV, heat pumps) consist of the investment costs and they are related to the maximal hourly production capacity (kWh/h). For storages, the investment costs are related to the storage capacity (kWh). Fixed costs are represented as annuity scaled for the length of the planning horizon.
We denote by U the set of energy supply units and by S the set of energy storages. The supply units include purchase contracts (DH, DC, power from grid), sales contracts (selling excess power to grid), and different local production technologies (PV, heat pumps). The objective function is formulated as The first summation is the operating costs of energy supply units u2U. Index t iterates through the periods (hours) in the planning horizon 1, …, T. For example, in a one-year model, T ¼ 8760 h. The operating costs for each energy supply unit and period are computed as the product of the price coefficient c u;t and the utilization of the supply unit x u;t . Note that storages do not have operating costs in this formulation. Also, some supply units may have zero operating costs. For energy sales contracts, the price coefficient is negative.
The second summation is the fixed costs of the supply units and the third summation is the fixed costs of storages. Affine is added multiplied by a binary (0/1) variable z u . The binary variable is equal to 1 when the unit is included and equal to 0 when the unit is excluded.
Note that the binary variables make the model into a MILP (Mixed Integer Linear Programing) model. If for each technology, either the constant cost term is zero (as it is for several technologies in our case) or the binary variable is fixed to 1 or 0, then the model can be solved as an LP model.

Energy balance constraints
In the following we use sub/superscripts H, C, or P for symbols to identify the energy form (Heat, Cooling, Power). Energy balances for heat, cooling and power require that the supply must match the demand ðd H;t : d C;t ; d P;t Þ for each hour. Energy balances are formulated as In heat and cooling balances (2) ). In the power balance (4), U þP is the set of units that supply power (power purchase contract, PV) and U ÀP is the set of units that consume power (power sales contract, heat pumps). In this notation there is a single energy storage for each energy form, affecting the energy balance through charge variable s IN B;t and discharge variable s OUT B;t .

Purchase and sales contracts
Purchase contracts for heat, cooling, and power include an energy fee c u;t (per kWh of purchased energy), a yearly capacity fee z u 2 f0; 1g; u2U B ; B2fH; C; Pg: Constraint (5) sets the capacity limit for the hourly energy purchase x u;t . In (6) (7) can be fixed to either 0 or 1 to force a supply component to be excluded or included.
Excess power can be sold back to the grid at spot-price. The fee for excess power is represented as a negative unit cost in the objective function (1). No fixed costs apply for a small-scale producer, which implies that the sales contract is modelled simply by a non-negative variable x u;t ! 0.

Heat pumps
Our model's production units include three kinds of heat pumps: heat pump for a heating, heat pump for cooling, and heat pump for combined heating and cooling. We denote by U H the heat pumps that produce heat and by U C the heat pumps that produce cooling. A combined heating and cooling heat pump belong to both sets. Different types of heat pumps are modelled in the same way, in terms of capacity and COP (coefficient of performance) factor using the following constraints.
z u 2f0; 1g (10) Constraints (8) define the capacity limit for the hourly input power to the heat pump. Constraints (9)e(10) enable or disable the heat pump using a big number F and a binary variable z u . Constraints (11) link the heat pump production x B u;t with electricity consumption x u;t using COP factors h B t . This formulation allows the COP factor to change hourly, for example as function of outdoor temperature for air-source heat pumps. For the ground source heat pump, the COP factor is constant. In the objective function (1) the immediate operating costs are zero for heat pumps, and the caused operating costs are due to electricity consumption.

Photovoltaics
Hourly PV production is determined by solar radiation, the area of PV panels, their orientation, and efficiency of the panels. This is defined by In (12) h u is the efficiency factor of PV, A u is the variable panel area (in square meters), and r t is the intensity of the solar radiation per square meter of panel area. Constraints (13)e(14) enable or disable PV using a big number F and a binary variable z u . The solar radiation consists of two components: direct radiation and ambient radiation. The meteorological institute measures the direct radiation r DIR t on a surface orthogonal to the sun rays and the ambient radiation r AMB t on a horizontal surface. To obtain the solar radiation intensity on the PV panels, the two components are combined by Here q t is the angle between the direction to the sun and the normal of the PV panel, and 42[0,p/2] is the tilt angle of the panels. We assume that the PV panels are installed south-facing with constant tilt angle. The yearly average of the direct radiation term is maximized by choosing a tilt angle close to the latitude of the collector location. However, the ambient radiation is proportional to the part of the sky that the tilted collector surface faces, and this term is maximized by horizontal collectors (4 ¼ 0). High tilt angles also make multiple rows of PV panels shadow each other unless they are installed far apart, and may cause serious wind loads, if the roof is tilted less than the panels. Thus, the ideal tilt angle for combined radiation is smaller than the latitude. In this study we applied 45 angle [38].

Storages
Dynamic behavior of storages is modelled as shown in Fig. 2 Because we have exactly one storage for each energy form, the set of storages S ¼ {H,C,P}. Here (16) is the dynamic constraint that links storage levels of subsequent hours together as illustrated in Fig. 2. Constraint (17) is the capacity limit of the storage. Constraints (18) and (19) limit the charge and discharge rate of the storage. Constraints (20)e(21) enable or disable the storage using a big number F and a binary variable z u . The model allows applying different storage technologies, starting from heat storages (e.g., underground thermal storage) and ending with power storages (e.g., Li-ion battery, etc.).

Case study
The target is a mixed-type building with residential, commercial, and office parts. Such mixed buildings are becoming increasingly popular in the capital region of Finland. The building's energy consumption estimation is based on similar separate buildings, for which historical hourly heat, cooling, and power consumption are available. Table 1 displays general data on the target building. Fig. 3 illustrates the hourly energy demand (heat, cooling, and power) and Nordpool power price. We composed yearly demand for the mixed-type building with from real-life load profiles for existing single-type buildings. Full year hourly data is used in the model, but to make the figure more readable, we present data only for the first week of a selected month in each season: February, May, August, and November. The hourly data is from year 2019, which is the latest full year for which we had all data available. (Also earlier data from 2018 was available, but we did not apply that in the optimization model).
The heating demand depends heavily on the temperature, superimposed with the cyclic daily and weekly variation. The summer demand for heating is due to year-around production of hot tap water. The year-around cooling demand is mainly due to cool storages in the building's commercial part. In the summer the overall cooling demand increases due to space cooling in the office and commercial parts. The power consumption does not change dramatically on the yearly level, but the daily and weekly living and working rhytm of people cause cyclic variations on the demand. Demand of power is at a little lower level during the summer holiday season. Power price is highly volatile around the year.

nZEB requirements
The building must satisfy the national requirements for nZEB. The nZEB regulation is based on the building energy performance indicator, or E-value. The E-value is defined as annual nonrenewable primary energy consumption per heated floorspace, measured as kWh/m 2 /a. The E-value is calculated by adding up energy from different sources multiplied by national energy carrier factors. In Finland, the energy carrier factors are 0.5 for DH, 0.28 for DC, 1.2 for PP, 1.0 for locally used fossil fuels, and 0.5 for locally used renewable fuels. PV is not included when computing the E-value. In Finland, the nZEB limit for the E-value is 90 for multi-floor residential buildings, 100 for office buildings, and 135 for commercial buildings [41]. For the mixed-type target building, we calculated the limit 107 kWh/m 2 /a as an average for the three building types weighted by their corresponding floor areas.

Model parameters
To complement purchased electricity, the building can be equipped with a maximum of 750 m 2 of PV panels on the roof. In Helsinki, the maximum solar radiation is about 1 kW/m 2 [39]. Applying 15% efficiency for the PV system [39] gives 112.5 kW peak power with maximal panel area. To complement district heating and cooling, it is possible to install heat pumps to produce heating and cooling locally.
When buying power from the grid, the customer must pay in addition to the market price for the electricity, the electricity tax, transmission and distribution fees, retailer margin, and VAT (24%) for everything. Finland has no feed-in tariff for small scale renewable power, which means that excess PV can be sold to the grid at a low price depending on the local distribution company. In Helsinki, this price equals the market price (NordPool Elspot price) for electricity. As a result, the sales price for power is much lower than the purchase price. This implies that PV production should be dimensioned to mostly cover local consumption, resulting in avoidance of taxes and transmission&distribution costs. Because heat pumps consume electricity, they act synergetically with local PV production when consumption coincides with production. In Finland, this is particularly true for cooling heat pumps. The advantage of storages is that they can be used to shift production to improve the coincidence. The developed optimization model will consider all these factors and dependencies automatically.
Historical data used in the analysis is hourly based from 2019 (1. 1.-31.12.). Input data includes solar radiation in Helsinki [42,43]; heat, cooling and power consumption in similar buildings [44e46]; NordPool Elspot power prices for Finland [47]; the district heat and cooling prices [48]; power distribution tariffs [49]; additional data marked in Tables 2e4 on capacities, lifetimes, COP factors, and investment costs for different technologies [39,50e56]. We used constant COP-factors for the heat pumps over the full year, ignoring possible dependence on variable temperature levels. Different COPfactors were applied as part of sensitivity analysis outside this study. Table 2 presents the cost parameters for different energy sources and storages. DC contract prices are not public; they are based on confidential negotiations. PV investment price per peak power is computed based on typical current PV system price per peak power in Finland (1766 V/kWp) as annuity with 4% interest and a 20-year lifetime [57]. We applied a 15-year lifetime for different heat pumps, 20 years for HS and CS, and 10 years for PS [50e53]. Table 3 provides a review of investment costs relied upon for the calculated parameters in Table 2. Table 4 lists technical parameters for local production and storages.
The investment cost of HPC relied on reference [54] but was adapted based on the temperature difference [48] and COP factor [50]. The investment cost for H&C was based on HPC costs and COP factor from Ref. [50]. The estimate for CS investment price is based on HS cost, multiplied by a factor of 5 to reflect the smaller

Scenarios
The objective is to minimize the combined operating and fixed costs. The cost minimum can be obtained by solving the optimization model as a MILP model that determines which technologies should be included and how they should be dimensioned while optimally operating the energy system. However, a standard MILP solver would primarily only give a single optimal solution, and possibly an arbitrary selection of non-optimal solutions. To gain more insight into different technologies' benefits, we instead solve explicitly LP models for different combinations of binary variables corresponding to various technologies. In principle, with ten technologies or contracts, there are 2 10 ¼ 1024 LP models to solve, but only a fraction of these are feasible and/or meaningful. For example, there must be a supply technology for each of the three energy forms. Also, PV alone is insufficient to provide all needed power due to limitations on the panel area, which means that the power contract must always be present. Still, over 100 combinations are, in principle, possible. Rather than presenting all combinations, we focus on the following configurations that we call scenarios: All includes all contracts, production technologies and storages for each energy form: district heating (DH), district cooling (DC), power purchased from the grid (PP), photovoltaic panels (PV), heat pump for heating (HPH), heat pump for cooling (HPC), combined heating and cooling heat pump (H&C), heat storage (HS), cooling storage (CS), and power storage (PS). NoDH excludes DH as an energy supply. All other technologies are included. NoDC excludes DC. NoPV excludes PV. NoH&C excludes combined H&C heat pump. NoStor excludes storages (HS, CS, PS). Table 5 shows the optimized results for the chosen scenarios (technology configurations) representing different combinations of enabled production forms, storages, and purchase contracts for energy.    scenario has the lowest total costs. However, the All scenario is only 106V more expensive, which means that DC can be included or excluded based on local availability and after more detailed negotiations with local DC company. Analysis of all possible configurations showed that whenever DC was included, separate HPC was never included. This means that DC and HPC are mutually exclusive alternatives for cooling the building. The NoDH scenario is most expensive, showing that DH is a cost-efficient heating form in Helsinki, even together with distributed energy solutions. Therefore, DH should be enabled when optimizing energy solutions for mixed-type buildings. Figs. 5 and 6 illustrate subdivision of operating and fixed costs between different technologies. Only DH, DC and PP impose operating costs. As described earlier, neither storages nor heat pumps involve operating costs. The NoDH scenario has the lowest operating costs but highest fixed costs. In contrast, the NoPV scenario has the highest operating costs but lowest fixed costs. Excluding H&C increases the operating costs significantly, because coproduction of heat and cooling is a very efficient technology. Also, excluding storages increases the total costs significantly. When enabled, optimal size of both HS and CS was quite large. However, power storage technology is still too expensive for buildings, resulting in zero size PS in every scenario. Sensitivity analysis showed that price of PS must be cut to about one third, before it becomes profitable in the current case.

Dimensioning
Figs. 7 and 8 show that the optimal dimensioning of the heating and cooling technologies differ much across scenarios. This is due to the fact that everything depends on everything in the complex building energy system. As mentioned earlier, the optimal size for the PS was zero in all scenarios, thus it is omitted from the figures. We make the following observations: NoDH scenario leads to large HPH together with large HS. HS shaves off the heat demand peaks allowing to under-dimension the expensive HPH. NoStor scenario requires large DH and DC contracts. Without storages, the contracts (together with local production) must be dimensioned according to the peak demand. HPC is used only in the absence of DC contract (NoDC scenario). HPC has similar cost structure as DC, which makes them mutually exclusive.

Operation
As mentioned above, scenario All was very similar to scenario NoDC with a minimal annual difference in costs. Therefore, we illustrate in the following the optimal production and purchase of heat, cooling, and power in scenario All. Fig. 9 shows energy production and purchase (MWh) during four weeks from selected months. (HPC is omitted from the figure beause it has zero capacity in scenario All).
We observe that HPH produces base heating while DH covers the peaks year-around; a few hours with high power price made an exception. Interestingly, November 2019 was so warm that no peak supply was needed. The combined H&C heat pump was used for base cooling throughout the year, with DC stepping in during the peak hours during the summer when cooling demand is higher. The intermittent PV production operates totally according to the solar  radiation. PV can only cover a small fraction of the overall power demand; most of the power demand must be satisfied by PP. Fig. 10 shows heat and cooling storage levels for the selected weeks. (PS is omitted because it was dimensioned at 0 size). We see that HS was not used at all in February when the heat demand was high and HPH was operating at maximum power. In the other weeks HS is used to shave peak heat demand in order to replace more expensive DH by cheaper HPH. The CS has a similar peak shaving function together with the combined H&C heat pump for base cooling and DC for peak cooling.

PV system
The maximal panel area for PV (750 m 2 ) was optimal in every scenario. All PV production was consumed at the building e there was never excess production to be sold back to the grid. However, there are situations when the heat pumps cannot utilize all PV, and some PV must be used elsewhere in the building to reduce PP. This happens e.g. when power price is high; it becomes more economical to satisfy heat and cooling using DH and DC rather than HPs.
We also tested solving the model with unlimited PV panel area. Then, the optimal size for PV was about three times larger. This increased investment costs significantly but reduced total costs by 4500V. Power was sold back to the grid for a mere 1000V.
The last row of Table 5 shows the E-value for each scenario. Every scenario satisfy by a significant margin the nZEB limit of 107 kWh/m 2 /a. This is remarkable, because solving the model   without local production and storages the E-value would be 119 kWh/m 2 /a. Thus, optimization of costs not only saves money but also reduces non-renewable primary energy consumption.

Conclusions and future research
The developed optimization model can optimize simultaneously the configuration, dimensioning and operation of hybrid energy solutions for a building. The target building was a mixed type building with commercial, office, and residential parts in Helsinki, Finland. The model can be easily extended with other RES technologies and applied for other locations.
The results of the case study showed that hybrid energy solutions in the building can support reaching the nZEB requirements while reducing total energy costs. The savings between the lowest and highest annual total costs were approximately 27100V.
The scenarios NoDC and All resulted in the lowest total costs and their E-values (100 vs 99) were also clearly below the nZEB limit (107). Different scenarios demonstrated that DC and HPC are mutually exclusive options for cooling the building. In contrast, DH and HPH were included together in all scenarios, i.e. they work synergetically. The lowest E-value (94) appeared in scenario NoDH, but at significantly higher total costs than the optimum. The NoPV scenario resulted in a little higher total cost than the optimum but resulted in the highest E-value (105). This highlights the role of PV in reducing the primary energy consumption of the building.
High investment cost for power storages makes them currently unprofitable. Only heat and/or cooling storages were included in  the optimal solutions, depending on the configuration. Without heat or cooling storages, the total expenses increased; NoStor was the most expensive scenario. Having all electric power consumption pooled into a common balance facilitates consuming all PV locally in the building. This also allows substituting (electric) HP heating and cooling with DH and DC when power price is high.
One limitation with the model is that it is deterministic, assuming precise values for all parameters. The effect of uncertain parameters could be estimated by running the model many times with stochastic parameter values.
In future research, it is interesting to study in more detail different storage technologies, how they work together with each other and with various local RES solutions. We can modify our model to evaluate if power storages become profitable with the 15min power balance settlement implemented in the EU within a few years.
The current model was based on single objective optimization. The model can be extended to include multiple objectives, such as various environmental, techno-economic, and social factors. This allows using the results together with multi-criteria decision support methods [7].

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.