Designing of Cost-Effective and Low-Carbon Multi-Energy Nanogrids for Residential Applications

Recently, hybrid multi-energy systems consisting of multiple generation, conversion, and storage technologies have been receiving great attention as a promising option to meet the multi-energy demands of residential end-users, by transforming them from passive consumers to active prosumers, who both produce and consume energy. The design problem of such systems is challenging due to the large number of degrees of freedom in the design and operation phases, so the system as a whole must be optimized. Moreover, both economic and low-carbon priorities should be considered in the design problem to foster an effective implementation and deployment. The aim of this paper was to present a methodology for the optimal design of multi-energy nanogrids (MENs) operating in grid-connected and islanded modes. Based on a pre-defined MEN superstructure, a multi-objective linear problem was established to find the types and sizes of the technologies in the MEN, with the aim to reduce the total annual cost and the fossil primary energy input, while satisfying the assigned time-varying user multi-energy demand. With reference to the latter, the thermal behavior of the building was simulated by using the dynamic simulation software TRNSYS. The Pareto frontier was found by minimizing a weighted sum of the total annual cost and fossil primary energy input, and the problem was solved by using branch-and-cut. In the numerical testing, a single-family house of 200 m2 located in Italy was considered as the residential end-user. Results show the effectiveness of the model for providing good balancing solutions for end-users based on economic and energetic priorities. Moreover, it was found that the MEN operating in grid-connected mode showed economic and environmental performances much better than those found for the configuration operating in islanded mode.


Motivation
It is well known that Europe tends towards the goal of a "zero-emission" energy system, which will require a necessary and gradual (already begun) energy transition. This transition will have to be characterized by a continuous increase in the penetration of generation systems from renewable energy sources (RES), a massive increase in energy efficiency (with attention on the energy consumption of buildings) and, contemporarily, an increased use of the electrical energy carrier to meet the needs traditionally required for the direct use of fossil fuels (in particular, domestic heating and systems related to mobility and road transportation) [1,2]. In this future scenario, where RES will play an increasingly important role, it is crucial to consider their peculiar characteristics: non-programmability (for solar and wind sources); the uncertainty in the predictability of generation capacity; the general lack of time coincidence between production and demand linked to final energy uses.
Buildings are responsible for 40% of energy consumption and 36% of CO 2 emissions in the EU. As a result, the topic of energy efficiency in buildings has assumed central importance in EU energy and environment policy-making. The goal is new buildings being nearly zero-energy buildings, i.e., buildings that have a very high energy performance. The energy performance of a building is determined based on the annual energy that is consumed in order to meet the different needs associated with its typical use and reflects the heating and cooling energy needs to maintain the envisaged temperature conditions of the building, as well as the domestic hot water needs. Furthermore, the low amount of energy required should be covered to a very significant extent by energy from RES produced on-site or nearby.
In most residential applications, user energy demands are usually met by the utility grid, conventional gas-fired boilers, and electric chillers. However, recently, along with the upstream grid as the main power supply, hybrid systems consisting of micro combined heat and power systems (µCHPs), photovoltaic (PV) systems, and storage units are being used to meet the energy demands of residential users, by transforming them from passive consumers to active prosumers, who both produce and consume energy [3]. These systems can be configured as multi-energy systems, including various generation, conversion, and storage technologies satisfying the users' electrical, thermal, and cooling demand. The design problem of a hybrid multi-energy system is challenging and introduces a large number of degrees of freedom in the design and operation phases, so the system as a whole must be optimized, while satisfying the time-varying end-user multi-energy demand. Moreover, both economic and low-carbon priorities should be considered in designing these systems to foster an effective implementation and deployment. Therefore, in such a contest, novel solutions are needed to: -effectively integrate RES at local level; -demonstrate the economic benefits of hybrid multi-energy systems implementation at local level; -reduce primary energy consumption by giving priority to green energy sources and low-carbon solution technologies; -increase management efficiency by dynamically matching local electricity and thermal generation and consumption; -stimulate the development of a leading-edge market for energy-efficient technologies with new business models.

Literature Review
The issue of the optimization of hybrid systems has been widely investigated in the literature. In [4], a model based on mixed integer linear programming (MILP) was proposed for the optimization of a hybrid renewable energy system with a battery energy storage system in residential microgrids, in which the demand response of available controllable appliances was coherently considered in the proposed optimization problem with reduced calculation burdens. The intrinsic stochastic behavior of renewable energy and the uncertainty involving electric load prediction were taken into account through proper stochastic models. In [5], several renewable and non-renewable energy sources, like PV, fuel cell, and battery storage were integrated in a grid-connected hybrid energy system to supply energy demand. A multi-objective optimization model was proposed to solve the cost-emission problem of a battery/PV/fuel cell hybrid system in the presence of a demand response program. Two conflicting objective functions, namely minimization of the total cost of the hybrid system and a reduction in CO 2 emissions, were the main goals of the proposed multi-objective model, which was solved through the In [20], a multi-objective design of a hybrid system composed of PV, fuel cell, and diesel generator to supply electric power to an off-grid community in Kerman, south of Iran in the presence of an operating reserve and uncertainties of load and solar power, was proposed. In [21], an energy storage system design approach was proposed in the context of residential buildings with PV generation. The objective of this approach was to increase the matching between the local generation and consumption, as well as to decease the energy bill, using lithium ion batteries as a storage device. Such a system was modeled and simulated using real data of solar radiation and energy consumption from a typical residential household in Coimbra (Portugal). In [22], the sizing of residential storage (adding the battery storage system to an existing residential PV system) was performed in order to increase the cost-effectiveness.
The use of hybrid energy systems requires finding the solution to optimization problems including one or more objectives, such as sizing the system to minimize energy costs, system management to balance the uncertainty of energy produced, or reduction of environmental impacts. In [23], a number of optimization techniques developed from past to present to solve these problems and especially to determine the efficacy of multi-objective optimization approaches were discussed.

Aims and Contribution
The aim of this paper is to develop a model that allows the design of solutions, optimized through a multi-objective approach with a view to saving primary energy and reducing costs, of a hybrid energy system, according to the concept of a multi-energy nanogrid (MEN), suitable for integrating multiple generation, conversion, and storage technologies to satisfy the end-user multi-energy demand both in grid-connected mode and in islanded mode in terms of electricity supply. The investigated nanogrid is thus intended as a small-scale grid including several energy resources and storage units, which can work in grid-connected or in islanded mode. From the grid scale aspect, a nanogrid can be implemented in residential and commercial buildings with capacity in the range of 2-20 kW [24]. The short-term objective coincides with the economic objective linked to minimizing the investment and the operation and maintenance (O&M) costs of the MEN as well as the energy costs, while the long-term objective coincides with the minimization of fossil primary energy, aimed at the rational use of energy resources, which has, as a direct consequence, a reduction in the environmental impacts. To consider the two objective functions, a multi-objective optimization problem is formulated by following an MILP approach, and it is solved by using the weighted-sum method. The objective of the optimization model is to determine the design and operation strategy solutions on the Pareto frontier, i.e., the MEN configurations and corresponding operation strategies optimized according to the economic and the energetic objectives.
One of the strengths of the optimization model proposed is its applicability in real contexts, thus providing decision support to residential end-users in terms of planning the optimal MEN configuration according to economic and low-carbon priorities. This advantage is made possible thanks to the general mathematical formulation of the model, as well as to the proposed optimization method. Once the input data of the model have been assigned, such as user loads, local climate data, energy prices, and techno-economic data of the technologies proposed to be part of the MEN configuration, the proposed model makes it possible to obtain their optimized combination, in terms of types of technologies and relative sizes, as well as the corresponding operating strategies, through economic and energetic objectives. The proposed methodology may be also applied in off-grid applications, including isolated individual users in rural areas, where there is no possibility of connection to an electricity distribution network, through designing cost-effective and low-carbon nanogrids. Moreover, the proposed methodology is easily scalable and applicable to larger applications. In fact, in the case of a buildings' cluster located in a well-defined area, and thus considering a microgrid application, the model can be applied through using the aggregated profiles of electrical and thermal loads of the microgrid's users. In such a meaning, the microgrid would refer to a multi-input and multi-output energy system, based on the concept of "local production of energy for local consumption", where the end-users can share the distributed generation systems. In the numerical testing, a single-family house of 200 m 2 located in the Italian climatic zone E, in the city of Turin, is considered as the residential end-user. To identify the hourly space heating and cooling profiles of the user, the thermal behavior of the building is simulated using the dynamic simulation software TRNSYS, whereas the electricity hourly profiles are built up considering the number of occupants, the use of appliances, and the lighting systems, and the domestic hot water hourly profiles are estimated based on the number of occupants. Two scenarios are investigated, where the MEN operates in grid-connected and islanded modes in terms of electricity supply. In both the analyzed scenarios, results show that the Pareto frontiers provide good balancing solutions for the end-user based on economic and energetic priorities. Moreover, the MEN operating in grid-connected mode shows economic and environmental performances much better than those found for the MEN operating in islanded mode.

System Description
The system under study was an MEN providing electrical and thermal energy to a residential building. A superstructure of the MEN was pre-established with a series of technologies for the generation, conversion, and storage of electrical and thermal energy to satisfy the electricity, thermal, and cooling demands of the building under investigation. In detail, the generation technologies included a micro combined heat and power (µCHP) system with an internal combustion engine as prime mover, a gas-fired auxiliary boiler, and a rooftop PV system; the conversion technologies included a reversible electric heat pump and a single-stage absorption chiller; whereas the storage technologies included a battery and thermal energy storages for thermal and cooling purposes. The superstructure of the MEN under consideration with the energy technologies and the detailed energy flows among the technologies is shown in Figures 1 and 2. The end-user electricity demand could be satisfied by the µCHP, the rooftop PV, the battery, and the power grid. The end-user thermal energy demand (space heating and domestic hot water) could be satisfied by the µCHP, the auxiliary boiler, the heat pump, and the thermal storage. The end-user cooling demand could be satisfied by the heat pump, the absorption chiller powered by the µCHP, and the auxiliary boiler, and the thermal storage. With reference to the end-user energy demand, the thermal behavior of the building was simulated using the dynamic simulation software TRNSYS for obtaining the hourly space heating and cooling profiles. The electricity hourly profiles were built up considering the number of occupants, the use of appliances, and the lighting systems, whereas the domestic hot water hourly profiles were estimated based on the number of the occupants.
Inventions 2020, 5, 7 5 of 22 In the numerical testing, a single-family house of 200 m 2 located in the Italian climatic zone E, in the city of Turin, is considered as the residential end-user. To identify the hourly space heating and cooling profiles of the user, the thermal behavior of the building is simulated using the dynamic simulation software TRNSYS, whereas the electricity hourly profiles are built up considering the number of occupants, the use of appliances, and the lighting systems, and the domestic hot water hourly profiles are estimated based on the number of occupants. Two scenarios are investigated, where the MEN operates in grid-connected and islanded modes in terms of electricity supply. In both the analyzed scenarios, results show that the Pareto frontiers provide good balancing solutions for the end-user based on economic and energetic priorities. Moreover, the MEN operating in gridconnected mode shows economic and environmental performances much better than those found for the MEN operating in islanded mode.

System Description
The system under study was an MEN providing electrical and thermal energy to a residential building. A superstructure of the MEN was pre-established with a series of technologies for the generation, conversion, and storage of electrical and thermal energy to satisfy the electricity, thermal, and cooling demands of the building under investigation. In detail, the generation technologies included a micro combined heat and power (µCHP) system with an internal combustion engine as prime mover, a gas-fired auxiliary boiler, and a rooftop PV system; the conversion technologies included a reversible electric heat pump and a single-stage absorption chiller; whereas the storage technologies included a battery and thermal energy storages for thermal and cooling purposes. The superstructure of the MEN under consideration with the energy technologies and the detailed energy flows among the technologies is shown in Figures 1 and 2. The end-user electricity demand could be satisfied by the µCHP, the rooftop PV, the battery, and the power grid. The end-user thermal energy demand (space heating and domestic hot water) could be satisfied by the µCHP, the auxiliary boiler, the heat pump, and the thermal storage. The end-user cooling demand could be satisfied by the heat pump, the absorption chiller powered by the µCHP, and the auxiliary boiler, and the thermal storage. With reference to the end-user energy demand, the thermal behavior of the building was simulated using the dynamic simulation software TRNSYS for obtaining the hourly space heating and cooling profiles. The electricity hourly profiles were built up considering the number of occupants, the use of appliances, and the lighting systems, whereas the domestic hot water hourly profiles were estimated based on the number of the occupants.

Optimal Design Model
Based on the pre-defined MEN superstructure, the problem was to find the optimal design of the system, by determining the types and sizes of the generation, conversion, and storage technologies in the MEN, with the objective of reducing the total annual cost and the total annual fossil primary energy input to the MEN, while satisfying the time-varying user multi-energy demand. In the following, the objective functions and the decision variables are defined in Sections 3.1 and 3.2, respectively. The problem constraints are established in Section 3.3, and the multi-objective optimization method is discussed in Section 3.4.

Objective Functions
The optimization problem presents the economic and the energetic objectives. The economic objective was to minimize the total annual cost CMEN of the MEN, consisting of the sum of the following functions [16]: The total annualized investment cost of all technologies is represented in Equation (1), and it was calculated as the product of the capital recovery factor of the technology i (a parameter), the specific capital cost of the technology (a parameter), and its designed size (a continuous decision variable). The capital recovery factor depends on the lifetime of the technology and the interest rate, according to the formula in (1). The total annual O&M cost of all technologies is represented in Equation (2), and it was calculated through multiplying the specific O&M cost of the technology i (a parameter) by the generation level of the technology at hour hr of day d (a continuous decision variable), and the length of the time interval (1 h). Note that for the battery and thermal storages, the O&M costs were calculated through their capacities. The total cost associated with natural gas is defined in Equation (3), and it was calculated through multiplying the gas price (a parameter) by the total amount of gas consumed by the µCHP and the auxiliary boiler (dependent decision variables), which depended on their generation levels at hour hr of day d (continuous decision variables) and their conversion efficiencies (parameters). The total cost of buying grid power, formulated in Equation (4), was calculated as the product of the time-varying unit price of electricity from the grid (a parameter) and the total amount of electricity taken from the grid (a continuous decision variable).

Optimal Design Model
Based on the pre-defined MEN superstructure, the problem was to find the optimal design of the system, by determining the types and sizes of the generation, conversion, and storage technologies in the MEN, with the objective of reducing the total annual cost and the total annual fossil primary energy input to the MEN, while satisfying the time-varying user multi-energy demand. In the following, the objective functions and the decision variables are defined in Sections 3.1 and 3.2, respectively. The problem constraints are established in Section 3.3, and the multi-objective optimization method is discussed in Section 3.4.

Objective Functions
The optimization problem presents the economic and the energetic objectives. The economic objective was to minimize the total annual cost C MEN of the MEN, consisting of the sum of the following functions [16]: The total annualized investment cost of all technologies is represented in Equation (1), and it was calculated as the product of the capital recovery factor of the technology i (a parameter), the specific capital cost of the technology (a parameter), and its designed size (a continuous decision variable). The capital recovery factor depends on the lifetime of the technology and the interest rate, according to the formula in (1). The total annual O&M cost of all technologies is represented in Equation (2), and it was calculated through multiplying the specific O&M cost of the technology i (a parameter) by the generation level of the technology at hour hr of day d (a continuous decision variable), and the length of the time interval (1 h). Note that for the battery and thermal storages, the O&M costs were calculated through their capacities. The total cost associated with natural gas is defined in Equation (3), and it was calculated through multiplying the gas price (a parameter) by the total amount of gas consumed by the µCHP and the auxiliary boiler (dependent decision variables), which depended on their generation levels at hour hr of day d (continuous decision variables) and their conversion efficiencies (parameters). The total cost of buying grid power, formulated in Equation (4), was calculated as the product of the time-varying unit price of electricity from the grid (a parameter) and the total amount of electricity taken from the grid (a continuous decision variable). In the design optimization problem, the efficiencies, as well as the specific capital and O&M costs were assumed constant, not varying with the sizes. This assumption was reasonable, considering the residential application and thus the expected small variation in the designed sizes for the considered energy technologies.
The energetic objective was to minimize the total annual fossil primary energy input to the MEN, PE MEN , consisting of the sum of the following functions: The total primary energy associated with the natural gas is formulated in Equation (5) and was equal to the total amount of natural gas consumed by the µCHP and the auxiliary boiler (dependent decision variables), which depended on their generation levels at hour hr of day d (decision variables) and their conversion efficiencies (parameters). The total primary energy associated with the electricity taken from the grid is formulated in Equation (6) and it was calculated through dividing the total amount of the electricity taken from the grid (decision variable) by a reference electrical efficiency, depending on the power generation plants characteristics in the related country (a parameter).

Decision Variables
In the optimization problem, the decision variables included both binary and continuous ones. The binary variables represented the existence and the operation status (on/off) of the energy technologies. The continuous variables included: sizes of the technologies and their generation levels; capacities of battery and thermal storages; power input and output to/from battery; heating and cooling rate input/output to/from thermal storages; and power taken from the utility grid.

Constraints
The constraints of the optimization problem consisted of design and operation constraints for the energy technologies, and energy balances constraints, as discussed in the following.

Design Constraints for Energy Technologies in the Multi-Energy Nanogrid
The main design constraint of the energy technologies in the MEN is formulated below: This constraint ensured that the designed size of the technology i was within the limits available in the market. The binary decision variable, x i , was equal to 1 if the technology was chosen to be part of the MEN configuration.
The design constraint for the rooftop PV is formulated below: which ensured that the total designed area was lower than the available one.

Operation Constraints for Energy Technologies in the Multi-Energy Nanogrid
The common constraint for generation and conversion technologies in the MEN was the capacity constraint, formulated below by taking the µCHP as an example [16]: Inventions 2020, 5, 7

of 23
This constraint ensured that for each hr of day d, the power provided by the µCHP was limited by its minimum part load and the size, if the technology was on, i.e., the binary decision variable x µCHP,d,hr is equal to 1.
In the following, the additional operation constraints of generation, conversion, and storage technologies are presented.

Operation Constraints for Generation Technologies
The generation technologies in the MEN included the µCHP, the auxiliary boiler, and the rooftop PV. The operation constraints for the µCHP are formulated below: The amount of natural gas required by the µCHP to provide electricity is formulated in Equation (10), and the amount of heat recovered by the µCHP is formulated in Equation (11). Equation (12) was established to link the amount of heat recovered by the µCHP to the shares used to meet the thermal demand and to meet the cooling demand through the absorption chiller.
The operation constraints for the auxiliary boiler were similar and they are formulated below: The operation constraint for the rooftop PV is formulated below: which links the electricity provided by the rooftop PV to the area to be installed and the hourly solar irradiance through the electrical efficiency.

Operation Constraints for Conversion Technologies
The conversion technologies in the MEN included reversible heat pumps and single-stage absorption chillers. Reversible heat pumps may be involved in meeting the thermal and cooling demand in heating and cooling mode, respectively. The related operation constraint valid for the heating mode is formulated as: which links the electricity required by the heat pump to the heat rate provided through its coefficient of performance. The constraint was similar for the heat pump operating in cooling mode. Absorption chillers could be implemented to meet the cooling demand, powered by the heat from µCHP and auxiliary boiler. The related operation constraint is formulated below: which links the cooling rate provided by the absorption chiller to the amount of heat provided by the µCHP and the auxiliary boiler through its coefficient of performance.
Inventions 2020, 5, 7 9 of 23 Operation Constraints for Storage Technologies The storage technologies included a battery and thermal energy storage systems for heating and cooling purposes.
The operation constraints for the battery are formulated below: x Ch The charging/discharging power limits of the battery are enforced in Equations (18)-(20), whereas the battery state-of-charge (SOC) is defined in Equation (21) and the limit of SOC is enforced by Equation (22).
As for the thermal storage systems, the operation constraint is formulated as: meaning that the energy stored at hour hr depended on the non-dissipated energy stored at the previous hour (based on the storage loss fraction), and on the net energy flow.

Energy Balances Constraints
The energy balances constraints are formulated below for electricity and thermal demand: The energy balance for the cooling demand can be formulated in a similar way.

Multi-Objective Optimization Method
With the economic and the energetic objectives formulated in Section 3.1, the problem had two objective functions to be minimized. To solve this multi-objective optimization problem, the weighted-sum method was used, and a single objective function was formulated as: where c is a constant scaling factor chosen to have two objectives of the same order of magnitude, and ω is the weight varying in the interval 0-1. In detail, with ω = 1, it is possible to find the solution that minimizes the total annual cost, whereas with ω = 0, it is possible to find the solution that minimizes the total annual fossil primary energy input to the MEN. Instead, the Pareto frontier can be found by varying the weight ω in the interval ]0, 1[. A detailed flowchart of the multi-objective optimization problem formulated above is shown in Figure 3.

Energy Demand
The end-user was assumed to be a single-family house with a usable floor area of 200.0 m 2 , and net height equal to 3.0 m, located in the Italian climatic zone E, in the city of Turin.
The hourly energy demands for space heating and cooling were evaluated through the dynamic simulation software TRNSYS 17. The considered building was divided into eight rooms (living, kitchen, two baths, three bedrooms, and a lobby), and each room was modeled as a different thermal zone, as shown in Figure 4. The Type56 of TRNSYS was used to model the thermal behavior of the building, and the TRNSYS 3D plug-in for Google SketchUp to draw the multi-zone building and import the geometry from the SketchUp interface into the TRNSYS building environment (TRNBuild). By importing the building in TRNSYS Simulation Studio Interface, the weather data and the ground temperature, evaluated according to the Hadvig relation, relative to the city of Turin, were assigned. The construction of the opaque components of the building was defined so that the wall transmittance of the external walls, the roof, and the ground floor were set equal to 0.34, 0.30, and 0.33 W/m 2 /K, respectively. For the windows, the glazing and frame transmittance were set equal to 6.56 and 1.53 W/m 2 /K, respectively [25], and the area of each window was defined as the 12.5% of the useful area of the zone where the window is located [26]. For each thermal zone, the air exchange rate was Given the input data of the model, such as user multi-energy demand, energy prices, solar irradiance profiles, and techno-economic information of the energy technologies proposed to be part of the MEN configuration, the proposed model makes it possible to obtain their optimized combination, in terms of types of technologies and relative sizes, as well as the corresponding operating strategies, through economic and energetic objectives.
The problem formulated through Equations (1)-(26) was linear and involved both discrete and continuous variables. Branch-and-cut, which is powerful for MILP problems, was therefore used to solve it.

Energy Demand
The end-user was assumed to be a single-family house with a usable floor area of 200.0 m 2 , and net height equal to 3.0 m, located in the Italian climatic zone E, in the city of Turin.
The hourly energy demands for space heating and cooling were evaluated through the dynamic simulation software TRNSYS 17. The considered building was divided into eight rooms (living, kitchen, two baths, three bedrooms, and a lobby), and each room was modeled as a different thermal zone, as shown in Figure 4.

Energy Demand
The end-user was assumed to be a single-family house with a usable floor area of 200.0 m 2 , and net height equal to 3.0 m, located in the Italian climatic zone E, in the city of Turin.
The hourly energy demands for space heating and cooling were evaluated through the dynamic simulation software TRNSYS 17. The considered building was divided into eight rooms (living, kitchen, two baths, three bedrooms, and a lobby), and each room was modeled as a different thermal zone, as shown in Figure 4. The Type56 of TRNSYS was used to model the thermal behavior of the building, and the TRNSYS 3D plug-in for Google SketchUp to draw the multi-zone building and import the geometry from the SketchUp interface into the TRNSYS building environment (TRNBuild). By importing the building in TRNSYS Simulation Studio Interface, the weather data and the ground temperature, The Type56 of TRNSYS was used to model the thermal behavior of the building, and the TRNSYS 3D plug-in for Google SketchUp to draw the multi-zone building and import the geometry from the SketchUp interface into the TRNSYS building environment (TRNBuild). By importing the building in TRNSYS Simulation Studio Interface, the weather data and the ground temperature, evaluated according to the Hadvig relation, relative to the city of Turin, were assigned. The construction of the opaque components of the building was defined so that the wall transmittance of the external walls, the roof, and the ground floor were set equal to 0.34, 0.30, and 0.33 W/m 2 /K, respectively. For the windows, the glazing and frame transmittance were set equal to 6.56 and 1.53 W/m 2 /K, respectively [25], and the area of each window was defined as the 12.5% of the useful area of the zone where the window is located [26]. For each thermal zone, the air exchange rate was assumed to be equal to 0.28 h −1 [27]. According to the Italian Law [25], for the climatic zone E, the duration of the heating season goes from 15 October to 15 April. As a consequence, for each thermal zone, the indoor air temperature was controlled during this time interval by setting the set-point temperature for daytime (6.30 a.m. to 11 p.m.) and night-time heating at 21 • C and 15 • C, respectively. Moreover, for each thermal zone, a set-point temperature equal to 26 • C was set to control the indoor temperature during the cooling season, from June to August. Heat coming from occupants, household appliances, and lighting systems were assumed to contribute to the internal gains of the building. In detail, the number of the occupants was fixed at 5 and the sensible heat coming from each one was assumed to be equal to 75.0 W, considering light work/typing as the degree of activity, according to the Standard ISO 7730 [26]. The number of occupants and occupants-related sensible heat gain as a function of the time are shown in Figure 5. assumed to be equal to 0.28 h −1 [27]. According to the Italian Law [25], for the climatic zone E, the duration of the heating season goes from 15 October to 15 April. As a consequence, for each thermal zone, the indoor air temperature was controlled during this time interval by setting the set-point temperature for daytime (6.30 a.m. to 11 p.m.) and night-time heating at 21 °C and 15 °C, respectively. Moreover, for each thermal zone, a set-point temperature equal to 26 °C was set to control the indoor temperature during the cooling season, from June to August. Heat coming from occupants, household appliances, and lighting systems were assumed to contribute to the internal gains of the building. In detail, the number of the occupants was fixed at 5 and the sensible heat coming from each one was assumed to be equal to 75.0 W, considering light work/typing as the degree of activity, according to the Standard ISO 7730 [26]. The number of occupants and occupants-related sensible heat gain as a function of the time are shown in Figure 5. The hourly electricity demand of the building was built up by considering the number of occupants, the use of appliances, and of the lighting systems. Typical household appliances (fridge, washing machine, dish washer, hair-dryer, flat iron, PC, TVs), and lighting systems composed of LED lamps were considered. For each zone, the total electrical power of the lighting system was calculated depending on the type of lamps, intent-of-use of the zone, and its useful area, whereas the thermal power coming from each lamp was assumed to be equal to 75% of its nominal electrical capacity. To take into account the heat gains coming from the household appliances and lighting systems, the sensible heat flux related to their usage was estimated. In detail, it was assumed to be transferred to the indoor air by both radiation (70%) and convection (30%) [28]. The schedule of the household appliances and lighting systems was assumed to be the same for each day of the year [29][30][31].
The outputs of the TRNSYS simulation were the hourly profiles for space heating and space cooling of the building for the entire heating and cooling season, respectively. Starting from these, the hourly energy rate demand for space heating and space cooling was built up for four representative season days. In detail, the year was assumed to be composed of 90 days in the cold season, from December to February; 92 days in the cold mid-season, from 15 October to 30 November and from 1 March to 15 April; 91 days in the hot mid-season, from 15 April to 31 May and from 1 September to 15 October; 92 days in the hot season, from June to August. Therefore, the hourly energy The hourly electricity demand of the building was built up by considering the number of occupants, the use of appliances, and of the lighting systems. Typical household appliances (fridge, washing machine, dish washer, hair-dryer, flat iron, PC, TVs), and lighting systems composed of LED lamps were considered. For each zone, the total electrical power of the lighting system was calculated depending on the type of lamps, intent-of-use of the zone, and its useful area, whereas the thermal power coming from each lamp was assumed to be equal to 75% of its nominal electrical capacity. To take into account the heat gains coming from the household appliances and lighting systems, the sensible heat flux related to their usage was estimated. In detail, it was assumed to be transferred to the indoor air by both radiation (70%) and convection (30%) [28]. The schedule of the household appliances and lighting systems was assumed to be the same for each day of the year [29][30][31].
The outputs of the TRNSYS simulation were the hourly profiles for space heating and space cooling of the building for the entire heating and cooling season, respectively. Starting from these, the hourly energy rate demand for space heating and space cooling was built up for four representative season days. In detail, the year was assumed to be composed of 90 days in the cold season, from December to February; 92 days in the cold mid-season, from 15 October to 30 November and from 1 March to 15 April; 91 days in the hot mid-season, from 15 April to 31 May and from 1 September to 15 October; 92 days in the hot season, from June to August. Therefore, the hourly energy rate demands for space heating and space cooling for each representative season day were evaluated as the average of the hourly mean values of the space heating and space cooling, respectively, in the corresponding hour of all days in the relative season.
As to the domestic hot water demand, it was evaluated depending on the number of the occupants, and was considered to be the same for each day of the year [29][30][31].
The hourly electricity demand, the hourly thermal demand, given by the sum of the hourly domestic hot water and space heating demands, and the hourly space cooling demand of the building, for the four representative season days, are shown in Figure 6.
Inventions 2020, 5, 7 12 of 22 The hourly electricity demand, the hourly thermal demand, given by the sum of the hourly domestic hot water and space heating demands, and the hourly space cooling demand of the building, for the four representative season days, are shown in Figure 6.

Solar Irradiance Profiles
Solar irradiance profiles were built up based on meteorological data in Turin [32]. In detail, the hourly solar irradiance on a 35° tilted surface for each representative season day was evaluated as the average of the hourly mean values of the solar irradiance in the corresponding hour of all days in the relative season. The average hourly solar irradiance profiles for the four representative season days are shown in Figure 7. The maximum available area for installation of the rooftop PV arrays was assumed to be 190 m 2 .

Solar Irradiance Profiles
Solar irradiance profiles were built up based on meteorological data in Turin [32]. In detail, the hourly solar irradiance on a 35 • tilted surface for each representative season day was evaluated as the average of the hourly mean values of the solar irradiance in the corresponding hour of all days in the relative season. The average hourly solar irradiance profiles for the four representative season days are shown in Figure 7. The maximum available area for installation of the rooftop PV arrays was assumed to be 190 m 2 .
hourly solar irradiance on a 35° tilted surface for each representative season day was evaluated as the average of the hourly mean values of the solar irradiance in the corresponding hour of all days in the relative season. The average hourly solar irradiance profiles for the four representative season days are shown in Figure 7. The maximum available area for installation of the rooftop PV arrays was assumed to be 190 m 2 .

Techno-Economic Information of Energy Technologies
The techno-economic information of the generation, conversion, and storage technologies in the MEN superstructure are shown in Table 1. The maximum size of the technologies was omitted, considering the type of end-user investigated, and the expected small sizes designed for the energy technologies. The maximum and minimum SOC for the battery were assumed to be 80% and 20% of the designed capacity, respectively. To evaluate the total annualized investment cost, the interest rate was assumed to be 5%.

Other Input Data
The energy prices were chosen according to the Italian market. The unit price of natural gas was assumed to be 0.462 €/Nm 3 , whereas the time-of-day electricity price was assumed to vary between 0.123 and 0.152 €/kWh. The reference electrical efficiency of the Italian thermoelectric park used to evaluate the primary energy associated with the electricity taken from the grid in Equation (6) was set to 0.488 [35].

Results
The model developed in Section 3 was implemented using IBM ILOG CPLEX Optimization Studio Version 12.6. In the numerical testing, two scenarios were considered for the optimal design problem: • Scenario 1: MEN operating in grid-connected mode; • Scenario 2: MEN operating in islanded mode in terms of electricity supply.
In the following, the optimization results are discussed for both scenarios, by presenting the Pareto frontiers and the optimized MEN configurations obtained under the economic and the energetic optimization, and for the trade-off points on the Pareto frontiers. The operation strategies of the energy technologies in the optimized MEN configurations obtained under the economic and energetic optimization are also presented and discussed.

Optimized System Configurations on the Pareto Frontier in Scenario 1
For the numerical testing in Scenario 1, the optimization problem could be solved within 10 h with a mixed integer gap lower than 0.15% with a PC with 2.60 GHz (2 multi-core processors) Intel(R) Xeon(R) E5 CPU and 32G RAM.
The Pareto frontier is shown in Figure 8. The point marked with a was obtained with ω = 0 under the energetic optimization, and the total annual fossil primary energy was minimum and equal to 12,197 kWh, whereas the total annual cost was maximum and equal to €6071. Conversely, the point marked with b was obtained with ω = 1 under the economic optimization, and the total annual cost was minimum and equal to €3425, whereas the total annual fossil primary energy is maximum and equal to 26,486 kWh. All the other points on the Pareto frontier represent trade-off solutions of the multi-objective optimization problem, and they were obtained by subdividing the weight interval into 10 equally-spaced points.
Inventions 2020, 5, 7 14 of 22 was minimum and equal to €3425, whereas the total annual fossil primary energy is maximum and equal to 26,486 kWh. All the other points on the Pareto frontier represent trade-off solutions of the multi-objective optimization problem, and they were obtained by subdividing the weight interval into 10 equally-spaced points. Each point on the Pareto frontier corresponds to a different optimized MEN configuration, as shown in Table 2.  Each point on the Pareto frontier corresponds to a different optimized MEN configuration, as shown in Table 2.   It can be noted that the size of the µCHP did not change with the weight value, and this is mainly due to the type of end-user and the low electrical loads. As for the auxiliary boiler, it was not selected in any configuration, higlighting that this technology is not convenient for both the economic and energetic purposes, mainly due to the low conversion efficiency. As for the PV arrays, the installed area increased with the decrease of the weight. When the weight of the energetic objective was higher than that of the economic one, the size of this technology increased, showing that it is essential for reducing the total fossil primary energy. The same behavior can be noted for the electric heat pump and the absorption chiller, whose sizes were maximum under the energetic optimization, thereby highlighting the importance of these technologies for the reduction of the fossil primary energy, due to the high conversion efficiency and the possibility to recover waste heat for cooling purposes, respectively. The increase in the capacity of the battery with higher weights of the environmental objective was mainly due to the corresponding increase of the PV area installed and the related higher amount of renewable electrical energy to be stored. As for thermal storage systems, it can be noted that higher capacities were obtained for higher weights of the energetic objective. This can be explained by the increase in the sizes of the heat pump and the absorption chiller, which are used to charge the thermal storages for heat and cooling, respectively.

Operation Strategies of the Multi-Energy Nanogrid in Scenario 1
For different optimized configurations of the MEN, different operation strategies of energy technologies were obtained. For the illustration purpose, the operation strategies for electricity, heating, and cooling of the energy technologies in the optimized MEN configurations obtained under the energetic and economic optimization are compared below for the four representative season days.
In Figure 9 for electricity, it can be noted that for all the representative season days, the amount of grid power was larger under the energetic optimization than under the economic one. This is due to the larger usage of the electric heat pump under the energetic optimization, as also shown in Figure 10 for the operation strategies for heat, with the consequent larger electricity required by this technology. The electricity provided by the PV arrays was larger under the energetic optimization than under the economic one, consistent with the larger size of this technology, as shown in Table 2. The larger amount of electricity generated by PV under the energetic optimization leads to the higher usage of the battery. Finally, the electricity generated by the µCHP was lower under the energetic optimization than under the economic one. This result is mainly due to the fact that under energetic optimization, to satisfy the thermal demand, the electric heat pump was mainly used instead of the µCHP, as shown in Figure 10 for heat. In Figure 11 for cooling, it can be noted that the absorption chiller was never used to satisfy the space cooling demand under the economic optimization, consistent with the results shown in Table 2, where it can be found that this technology was not implemented in the MEN configuration under the economic optimization.
optimization than under the economic one. This result is mainly due to the fact that under energetic optimization, to satisfy the thermal demand, the electric heat pump was mainly used instead of the µCHP, as shown in Figure 10 for heat. In Figure 11 for cooling, it can be noted that the absorption chiller was never used to satisfy the space cooling demand under the economic optimization, consistent with the results shown in Table 2, where it can be found that this technology was not implemented in the MEN configuration under the economic optimization.   optimization, to satisfy the thermal demand, the electric heat pump was mainly used instead of the µCHP, as shown in Figure 10 for heat. In Figure 11 for cooling, it can be noted that the absorption chiller was never used to satisfy the space cooling demand under the economic optimization, consistent with the results shown in Table 2, where it can be found that this technology was not implemented in the MEN configuration under the economic optimization.   For the numerical testing in Scenario 2, the computational effort dramatically increased and the optimization problem could be solved in about 240 h with a mixed integer gap lower than 0.15%, with a PC with 2.60 GHz (two multi-core processors) Intel(R) Xeon(R) E5 CPU and 32G RAM.
The Pareto frontiers obtained under Scenarios 1 and 2 are compared in Figure 12. The point marked with a' was obtained with ω = 0 under the energetic optimization, and the total annual fossil

Optimized System Configurations on the Pareto Frontier in Scenario 2
For the numerical testing in Scenario 2, the computational effort dramatically increased and the optimization problem could be solved in about 240 h with a mixed integer gap lower than 0.15%, with a PC with 2.60 GHz (two multi-core processors) Intel(R) Xeon(R) E5 CPU and 32G RAM.
The Pareto frontiers obtained under Scenarios 1 and 2 are compared in Figure 12. The point marked with a was obtained with ω = 0 under the energetic optimization, and the total annual fossil primary energy was minimum and equal to 19,547 kWh, whereas the total annual cost was maximum and equal to €6580. Conversely, the point marked with b was obtained with ω = 1 under the economic optimization, and the total annual cost was minimum and equal to €3995, whereas the total annual fossil primary energy was maximum and equal to 35,867 kWh. All the other points on the Pareto frontier represent trade-off solutions of the multi-objective optimization problem, and they were obtained by subdividing the weight interval into 10 equally-spaced points. It can be noted that in Scenario 2, both the energetic and economic performances of the MEN got worse. By comparing points a and a under the energetic optimization, it can be noted that the total annual fossil primary energy obtained in the islanded mode increased by 60.3% as compared with the value obtained in the grid-connected mode. Also, the total annual cost under the energetic optimization was higher in the islanded mode, increasing by 8.4% compared with the cost obtained in the grid-connected mode. A similar worsening situation was found also under the economic optimization. By comparing points b and b under the economic optimization, it can be noted that the total annual cost obtained in the islanded mode increased by 16.6% compared with the value obtained in the grid-connected mode. In this comparison, when also taking into account the fixed costs of connection to the electricity grid and of meter transport and management, which were considered only for the grid-connected configuration and were equal to €48/year and €20/year [36], respectively, the grid-connected configuration results more convenient than the islanded one. In fact, under this assumption, the total annual cost of the grid-connected MEN would amount to €3493, which is still lower than the total annual cost of the islanded MEN (€3995). In addition, the total annual fossil primary energy under the economic optimization was much higher in the islanded mode, increasing by 35.4% compared with the value obtained in the grid-connected mode. Moreover, it can be noted that both the economic and energetic performances significantly reduced at all points of the Pareto frontier for the MEN operating in islanded mode. The different optimized MEN configurations obtained in Scenario 2 for the different values of the weight ω are shown in Table 3.  The different optimized MEN configurations obtained in Scenario 2 for the different values of the weight ω are shown in Table 3. In general, it can be noted that with the MEN operating in islanded mode, the optimized sizes of all energy technologies were higher than those obtained in grid-connected mode. This result explains the higher total costs obtained for the MEN operating in islanded mode, which was mainly due to the higher investment costs. With reference to the µCHP, higher sizes were obtained for higher weights of the economic objective. The contrary occurred for the PV arrays, since the maximum installed area was obtained in correspondence with higher weights of the energetic objective. Similar to what occurred for Scenario 1, in Scenario 2, the auxiliary boiler was also never implemented in the optimized MEN configuration. As for the electric heat pump, the trend of size variation with the weight ω was similar to that identified in Scenario 1, since the size of this technology increased for higher weights of the energetic objective. The situation was similar for the storage technologies.

Operation Strategies of the Multi-Energy Nanogrid in Scenario 2
The operation strategies for electricity, heating, and cooling of the energy technologies in the optimized MEN configurations obtained under the energetic and economic optimization are compared below for the four representative season days.
In Figure 13 for electricity, it can be noted that for all the representative season days, the amount of grid power was zero, since the MEN operated in islanded mode. In all representative season days, the amount of electricity provided by the µCHP was larger under the economic optimization than under the energetic one, consistent with the larger size attained for this technology under the economic optimization, as shown in Table 3. Conversely, it can be noted that the usage of the electric heat pump was larger under the energetic optimization than under the economic one, as also shown in Figure 14 for the operation strategies for heat. The larger electricity required by the heat pump was satisfied by the electricity provided by PV arrays, which was larger under the energetic optimization. This result also explains the larger usage of the battery under the energetic optimization than under the economic one.
The operation strategies for heating and cooling shown in Figures 14 and 15, respectively, confirm the results discussed above. In Figure 14, it can be noted that, to satisfy the building thermal demand, the amount of thermal energy provided by the µCHP was larger under the economic optimization than under the energetic one, whereas the contrary occurred for the thermal energy provided by the heat pump. The usage of thermal storage systems was larger under the energetic optimization than under the economic one, consistent with the larger sizes attained for these technologies under the energetic optimization. Results were similar for the operation strategies for cooling.
demand, the amount of thermal energy provided by the µCHP was larger under the economic optimization than under the energetic one, whereas the contrary occurred for the thermal energy provided by the heat pump. The usage of thermal storage systems was larger under the energetic optimization than under the economic one, consistent with the larger sizes attained for these technologies under the energetic optimization. Results were similar for the operation strategies for cooling.   demand, the amount of thermal energy provided by the µCHP was larger under the economic optimization than under the energetic one, whereas the contrary occurred for the thermal energy provided by the heat pump. The usage of thermal storage systems was larger under the energetic optimization than under the economic one, consistent with the larger sizes attained for these technologies under the energetic optimization. Results were similar for the operation strategies for cooling.

Conclusions
In this paper, a methodology was proposed for the optimal design of multi-energy nanogrids (MENs) for residential applications. Based on a pre-defined MEN superstructure, a multi-objective linear problem was established to define the types and sizes of the generation, conversion, and storage technologies in the MEN, with the aim of reducing the total annual cost and the fossil primary energy input, while satisfying the assigned time-varying end-user multi-energy demand. With

Conclusions
In this paper, a methodology was proposed for the optimal design of multi-energy nanogrids (MENs) for residential applications. Based on a pre-defined MEN superstructure, a multi-objective linear problem was established to define the types and sizes of the generation, conversion, and storage technologies in the MEN, with the aim of reducing the total annual cost and the fossil primary energy input, while satisfying the assigned time-varying end-user multi-energy demand. With reference to the latter, the thermal behavior of the building was simulated by using the dynamic simulation software TRSNSYS for obtaining the hourly space heating and cooling profiles. The electricity hourly profiles were built up, considering the number of occupants, the use of appliances, and the lighting systems, whereas the domestic hot water hourly profiles were estimated based on the number of the occupants. The Pareto frontier was found by minimizing a weighted sum of the total annual cost and fossil primary input. The problem was solved by branch-and-cut.
In the numerical testing, a single-family house of 200 m 2 located in the Italian climatic zone E, in the city of Turin, was considered as the residential end-user. Two scenarios were investigated, where the MEN operated in grid-connected and islanded modes. In both the analyzed scenarios, results showed that the Pareto frontiers provided good balancing solutions for end-users based on economic and energetic priorities. Moreover, the MEN operating in grid-connected mode showed economic and environmental performances much better than those found for the MEN operating in islanded mode. It was found that under energetic optimization, the total annual fossil primary energy obtained in the islanded mode increased by 60.3% as compared with the value obtained in the grid-connected mode. A similar worsening situation was found for the economic performances of the MEN under the economic optimization, where the total annual cost obtained in the islanded mode increased by 16.6% compared with that obtained in the grid-connected mode. When also considering the fixed costs of connection to the electricity grid and of meter transport and management, which were valid only for the grid-connected configuration, the results were more convenient than the islanded one. In fact, under this assumption, the total annual cost of the islanded MEN would increase by 14.4% compared with the new value obtained in grid-connected mode.
Although the islanded MEN is less convenient for both economic and energetic purposes, the results found in this work show the effectiveness of the methodology for off-grid applications, including isolated individual end-users in rural areas, where there is no possibility of connection to the electricity distribution network, thereby representing a valid solution for designing cost-effective and low-carbon nanogrids, while ensuring access to electricity in critical residential areas.

Conflicts of Interest:
The authors declare no conflict of interest.