
==== Front
Heliyon
Heliyon
Heliyon
2405-8440
Elsevier

S2405-8440(24)12904-0
10.1016/j.heliyon.2024.e36873
e36873
Research Article
Mixed-integer disciplined convex programming approach applied to the optimal energy supply of near-zero energy buildings
Muñoz-Salcedo Martín jmunozs@unemi.edu.ec
a⁎
Ruiz de Adana Manuel b
Peci-López Fernando bc
a Facultad de Ciencias e Ingeniería, Universidad Estatal de Milagro, Milagro, Ecuador
b Departamento de Química-Física y Termodinámica Aplicada, Universidad de Córdoba, Córdoba, Spain, Campus de Rabanales, Antigua Carretera Nacional IV, km 396, 14072 8, Spain
c International Researcher, Universidad Ecotec, Guayaquil, Ecuador
⁎ Corresponding author. jmunozs@unemi.edu.ec
24 8 2024
15 9 2024
24 8 2024
10 17 e3687311 12 2023
20 8 2024
23 8 2024
© 2024 The Authors
2024
https://creativecommons.org/licenses/by-nc/4.0/ This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
Energy needs in the buildings sector accounts for 40 % of global energy demand. Therefore, the implementation of several renewable energy sources is necessary to reduce this demand. The design stage of a decentralized generation project requires quantifying the power to be installed and the energy forecast for each source throughout the useful life of the building. This study develops a novel optimization algorithm for a long-term economic function based on mixed-integer disciplined convex programming (MIDCP) which guarantees the sustainability of the building and its energy systems. The robust algorithm integrates risk management of intermittent sources, technical and economic parameters of selected technologies, and life cycle analysis (LCA) of different energy systems, including storage. Furthermore, the penetration of green hydrogen into the distributed generation mix is evaluated as an important contribution. Meteorological and energy demand variables of two antagonistic scenarios were also used as inputs to the algorithm. As a result, the optimal energy supply sizing for tertiary buildings in the two defined locations was obtained. The results of the simulations have achieved an optimal convergence of 100 % in the proposed scenarios, with a resolution time of 14 s and using a memory of about 183 MB. The simulations suggest a higher penetration of green hydrogen in scenarios where supply and investment costs decrease to gray hydrogen supply levels, reaching up to 81 % coverage of the thermal demand of the building. Hybrid energy systems under favorable conditions show a penetration of about 92 % within the distributed generation mix. The developed tool could enable decision-makers to optimally plan distributed generation projects in buildings based on economic, policy, and geographic conditions.

Keywords

Mixed-integer disciplined convex programming
Near-zero energy buildings
renewable energy
green hydrogen
==== Body
pmc Nomenclature

BOS	Balance of system	
CAPEX	Capital expenditures	
CHP	Combined heat and power	
CO2	Carbon dioxide	
COP	Coefficient of performance	
CP	Convex programming	
CVXR	Convex optimization in R	
DCP	Disciplined convex programming	
DOD	Depth of discharge	
EROI	Energy return of investment	
ETC	Evacuated tube collector	
ETS	Emissions trading scheme	
EUA	European Union allowance	
GH2	Green hydrogen	
GHI	Global horizontal irradiance	
GLPK	GNU linear programming kit	
H2 CHP	Hydrogen combined heat and power	
HVAC	Heating ventilation and air conditioning	
LCA	Life cycle analysis	
LCOE	Levelized cost of energy	
LP	Linear programming	
MIDCP	Mixed-integer disciplined convex programming	
MINLP	Mixed-integer nonlinear programming	
NPV	Net present value	
NREL	National Renewable Energy Laboratory	
nZEB	Nearly-zero energy buildings	
OPEX	Operating expenses	
PV	Photovoltaic	
PVGIS	Photovoltaic geographical information system	
SOC	State of charge	
SOFC	Solid oxide fuel cell	
TMY	Typical meteorological year	
djt	Thermal energy supply	
dje	Electric energy supply	
CG	Global cost	
τ0	Initial year	
τ	Calculation period	
C1	Initial investment cost	
Ca,i	Annual variable cost	
Rd	Discount rate	
Vf,τ	Residual value at the end of calculation period	
zj	Number of sources to be installed of technology j	
uj	Base unit power of technology j	
Cij	Initial investment cost of technology j	
Crj	Replacement cost of technology j	
nrj	Number of replacements of technology j	
Rp	Percentage of price evolution	
τj	Useful life of technology j	
Cc	Cost of capital	
ns	Number of seasonal profiles	
xj	Energy supply of source j	
djt,e	Energy efficiency of source j	
pj	Supply price of primary energy of source j	
xd	Stored electrical energy input	
xc	Instantaneous storage capacity	
xi	Initial state of charge (SOC)	
yd	Battery discharge	
yc	Battery charge	
ubp	Discharge battery power (DOD)	
db	Battery performance profile	

1 Introduction

Nowadays, 40 % of the world energy is consumed by buildings and they produce 33 % of greenhouse gas emissions [1]. In this sense, one of the key aspects to consider is their energy efficiency. Governments have been implementing regulations for sustainable building designs that include both bioclimatic conditions and the architectural integration of renewable energy sources. Near zero energy buildings (nZEB) are pivotal to the transition to carbon neutrality. The integration of energy efficiency measures, renewable energy sources and supporting policies could accelerate this transition and bring both environmental and economic benefits. Establishing a clear roadmap with specific targets, fostering collaboration between governments, industry and academia, is essential to overcome the challenges and achieve long-term sustainability goals [2].

The design stage of an nZEB involves determining environmental, technical, economic and even social aspects that guarantee its sustainability. One of the main aims is to ensure a continuous and optimal supply in response to the energy demand. To achieve this, it is necessary to simulate climatic conditions with risk management of intermittent sources. Electrochemical storage is indispensable for the proper management of intermittent sources such as PV and wind turbines, quantifying battery carbon intensity over their lifetime allows to determine their sustainability [3]. Storage systems integrating renewable energy and hydrogen generation are currently being developed to achieve carbon neutrality and enhance energy flexibility. Accurately predicting the degradation levels and lifetimes of these systems enables precise estimation of their energy production, thereby avoiding overestimation of their techno-economic performance [4]. In addition, all the elements and energy sources must be considered as a single system within the useful life of the building [5].

Current requirements call for a reduction in the demand of fossil fuel primary energy and are increasingly restrictive in terms of limiting the use of electricity from the grid. Decentralized generation is driving a change in traditional energy systems, enabling the supply of electricity and thermal energy from renewable sources. Conventional energy supply in large plants far from the areas of demand generates losses in the transportation of energy. To break this paradigm, distributed generation focuses on providing energy at or very close to the point of demand. It combines different renewable energy sources into a mix capable of satisfying energy demand from households to district grids. Therefore, there must be an optimal management of the energy mix, in order to optimize technical, economic and environmental performance [6]. Integration of renewable energy and hydrogen systems could decrease total annual costs and carbon emissions. Optimization algorithms have been used to achieve global and Pareto front-end optimal solutions, promoting hydrogen deployment for operational cost savings and system sustainability [7].

In the last decades, several mathematical models for the optimization of distributed generation systems in buildings have been developed. Upstream and downstream models are the most highlighted. The first one is focused on economic issues of the operation levels of power grid systems, while the second one represents a more engineering approach by minimizing the costs of the systems operating in the building to increase its energy efficiency. Other methods include linear programming (LP), mixed-integer linear programming (MILP), dynamic programming, Fuzzy Programming, mixed-integer nonlinear programming (MINLP), heuristic algorithms, genetic algorithms (GA), and multi-objective optimization (MOO). The latter can provide a wide range of information in the energy design of a building when integrated with software such as TRNSYS or EnergyPlus [8]. However, they require a more complex characterization of the building, a high computational cost and no single optimal value is obtained, so optimization is at the discretion of the designer.

A meta-model based on multi-criteria optimization using a modified coot optimization algorithm and artificial neural networks (ANN) is proposed in Ref. [9]. EnergyPlus is used herein as a simulation tool. The results are evaluated on the thermal comfort and energy efficiency of a building, showing savings of up to 75 % of the number of simulations obtained with other models. Although this method improves computational efficiency in the number of samples, the sizing of energy systems and their penetration level as a function of climatic conditions is not addressed. In Ref. [10], a MILP-based system is proposed, which integrates multiple renewable energy sources, groundwater and thermal energy storage, leading to a better match with thermal and electrical loads. The performance indicators of the study are: the percentage of energy from photovoltaic panels (consumed instantaneously), proportion of hours that a building is operating off-grid, and fraction of demand covered by renewable energies. A multi-objective optimization model for nZEB is proposed in Ref. [11]. The MILP-based model reduces the energy needs of building devices in a specific schedule, decreasing CO2 emissions. It employs a micro-grid composed of photovoltaic, fuel cell, and battery generation technologies. In this way, it can use energy from the local grid when generation from renewable sources is low and the surplus energy generated could be used in energy markets. Several algorithms in Ref. [12] for demand management are proposed among which are, genetic algorithms, learning-based optimization, improved differential evolution algorithm and the improved differential teaching-learning algorithm. The model proposes a micro-grid with renewable energy sources and the main objectives of the model are: integration of renewable energy sources, minimization of electricity billing cost, user discomfort, minimization of peak-to-average ratio and carbon emission. The conflict between electricity cost and user discomfort must be resolved. In Ref. [13], genetic algorithms are employed for the operational optimization of a heating, ventilation and air conditioning (HVAC) system in a near-zero energy smart building. The optimization aims to balance minimum energy cost and thermal comfort and the authors analyzed several scenarios to demonstrate the potential of the algorithm in reducing energy costs. The results showed a reduction between 9.9 % and 25 %. A methodology that evaluates the techno-economic and environmental performance of a microgrid using a genetic algorithm is developed in Ref. [14]. This results in configurations of PV, wind turbine, electrochemical storage, and hydrogen fuel cell with the lowest levelized cost of energy (LCOE). A model based on mixed-integer second-order cone programming for the sizing and placement of photovoltaic generators and their location in distribution networks is presented in Ref. [15]. The validation of the proposed model showed optimal results with respect to metaheuristic models. The power losses of the network are minimized by locating the nodes in the correct place. However, the optimal long-term supply of different sources of distributed generation is not addressed. The model is implemented in commercial software and solvers such as Matlab and Gurobi.

Advances in MILP solvers allow for increased computational efficiency, so it can be implemented for larger and more complex problems [16]. These models allow the inclusion of power grid constraints, detailed economic analysis, electricity market rules and power system operation. For their part, the combination of heuristic methods with disciplined convex programming (DCP) [17] allows finding global optimal solutions only for continuous decision variables, which makes the analysis of binary variables more difficult. DCP is a methodology that allows the construction of convex optimization problems (CP) through a series of pre-established rules that must be checked before solving them [18]. When one or more decision variables are required to take integer and continuous values, mixed-integer disciplined convex programming (MIDCP) could be used. Unlike a DCP, a MIDCP is not convex, therefore finding a global optimum requires a mix of the conventional convex optimization algorithm and an exhaustive search such as the branch-and-bound algorithm. Some solvers do not include this second option and therefore do not support MIDCP [19]. Furthermore, if dichotomous decision variables are required to be added, only a few commercial solvers are capable of handling such variables.

In recent times, convex programming has had an important development in different branches such as robotics, predictive control, data mining, structural optimization, networks, quantum computing, neural networks, economics and finance to name a few examples [20]. However, it is necessary to find new applications that could contribute with robust solutions to dynamic optimization problems, capable of handling continuous, discrete and binary decision variables.

Most of the current models evaluated in the literature use linear, no linear programming heuristic and metaheuristic methods to carry out the energy optimization process [[21], [22]]. Optimization for energy sizing in buildings has been extensively studied through heuristic and metaheuristic models. Table 1 shows the benchmark of some models for energy sizing in off-grid and grid-connected systems. Although these models provide high quality solutions due to their advanced search for optimal values, require a detailed definition of the problem and a high computational cost. They do not guarantee a global solution so they may fall into local optima. In addition, the randomness range of the results requires a deep statistical analysis for its interpretation.Table 1 Benchmarking of economic optimization models.

Table 1Reference	Year	Tool	Location covered	Technique	Energy sources	Strategies covered	Main Findings	
[23]	2012	Matlab and GenOpt	Finland	Non Sorting Genetic Algorithm (NSGA II), pNSGA II and aNSGA II)	PV, geothermal heat pump, wind turbine and PEMFC	Minimizing PEC and LCC	The algorithms tested show varying convergence properties based on the number of evaluations used, with aNSGA-II demonstrating better repeatability and high convergence in finding optimal solutions for nearly-zero energy building design problems. The convergence behavior of the algorithms is crucial for finding diverse sets of solutions near the true Pareto-optimal front, especially in complex optimization problems with time-consuming simulation runs	
[24]	2014	Matlab	Poitou–Charentes in France	Controlled elitist Genetic Algorithm	PV, wind turbine and battery	LCC, embodied energy and loss of power supply probability	The study proposed a methodology for designing an autonomous hybrid PV-wind-battery system, successfully sizing it to supply at least 95 % of a residential house's yearly total electric demand. The Pareto fronts obtained in the study demonstrated the correlation between life cycle cost and embodied energy, indicating convergence in the optimization process	
[25]	2014	Matlab CVX toolbox	St. Louis and San Francisco in United States	Distributed optimization based on Alternating direction method of multipliers (ADMM)	PV, wind turbine, diesel generator and different storage technologies	Total cost	The problem can be parallelized, making it scalable as the number of scenarios increases, ensuring convergence. The algorithm converges when both the primal and dual residual are less than a certain threshold, ensuring convergence in the numerical examples provided	
[26]	2015	Matlab	Kerman-Iran	Particle swarm optimization (PSO)	PV, wind turbine and battery	Minimizing LCC	PSO with adaptive inertia weight was proposed to balance global and local searches, enhancing convergence properties of the algorithm.The adaptive inertia weight-based PSO algorithm yielded more promising results than other PSO variants in optimizing the hybrid renewable energy system	
[27]	2020	Matlab	Copenhagen, Madrid, and Tarifa	Genetic Algorithm (GA)	PV, wind turbine, solar collector, battery, heat pump	Net present cost and enviromental footprint	The algorithm's convergence was improved by adjusting parameters like population size and crossover fraction, enhancing the variability of the population and resolution of results. Single-objective optimization terminated in less than 2 min and found the global optimum in around 60 % of cases, while multi-objective optimization required longer calculation times but returned global optima with the right parameters	
[28]	2023	Lingo	Zaragoza-Spain and Marseille-France	Mixed Integer Linear Programming (MILP)	PV, wind turbine, gas boiler, solar thermal, absorption chiller, cogeneration, heat pump, thermal and cooling storage and battery	To maximize the NPV	The study analyzed the economic viability and environmental benefits of an energy supplier company acting as an aggregator for both demand and supply, showcasing the convergence of economic and environmental aspects. Different business models were tested, showing savings for customers and the efficiency of polygeneration systems compared to conventional solutions	
[29]	2023	Not stated	Johor Bahru- Malaysia	Improved butterfly optimization algorithm (IBOA) and Gray wolf algorithm (GWA)	PV, wind turbine and battery	Minimize the cost of energy (including sales and subsidies) and the load factor.	IBOA proved to be highly efficient in optimizing economic dispatch in an autonomous system. It outperformed other algorithms in terms of convergence and accuracy in solving the economic dispatch problem. IBOA can be a viable and robust solution for optimizing energy systems in isolated environments.	

Current studies have focused on making modifications to genetic algorithms in multimodal functions using algorithms such as differential evolution of particle swarm optimization (dePSO), harmonic search (HS), ant colony optimization (ACO), among others. While these techniques promise more realistic results, their reproduction becomes difficult due to the high degree of complexity in setting parameters, which are sensitive to the amount of information available. Most studies only make a comparison focused on renewable energy systems to be integrated into the building. The full interaction with conventional energy sources, storage or developing technologies is not addressed. To consider both conventional and non-conventional energy is crucial in the design stage of a long-term nZEB. This analysis is necessary to quantify the level of penetration that different technologies will have within the distributed generation mix over the life of the building.

While most stochastic algorithms are valuable for their flexibility and ability to handle a wide range of problems, they have several limitations in terms of optimality guarantee, convergence, computational requirements, parameter sensitivity, robustness, reproducibility and scalability. In addition, complete input information is required and the problem formulation in most cases is complex. In contrast to stochastic models based on nature, this paper proposes a different approach not explored in the literature, which employs mixed integer disciplined convex programming (MIDCP) for the sizing of the optimal energy supply of an NZEB. To carry out the definition of an optimization problem based on disciplined convex programming, it is necessary to comply with a series of rules and adaptations that guarantee the convexity of the problem. Once convexity is proven, it is possible to find global optima with high computational efficiency. The applications of convex programming are varied. Recent studies have found a niche in predictive control, thanks to its advantages over other optimization techniques. Mainly because of its versatility in handling dynamic functions, simple syntax using a natural mathematical language, robustness against the risk management of the input data and ease of interpretation of the results. This versatility allows incorporating within the proposed algorithm, mathematical models of energy storage and renewable and non-renewable energy sources. In addition, the proposed long-term economic approach includes the analysis of the upstream life cycle of the energy sources to be installed.

The main objective of this study is to determine the optimal long-term energy supply and the size of the sources to be integrated in a distributed generation mix for nZEB in the tertiary sector, with special attention to green hydrogen as an energy vector. Green hydrogen has been integrated into the mix as one of the sources, but also the analysis of hydrogen supply through renewable sources has been carried out. The cost function to be optimized has been improved. Long-term techno-economic parameters have been pre-fixed within the algorithm. LCA of the energy systems has been obtained upstream. Risk management has been approached with both pessimistic and optimistic profiles. The output of the algorithm has been tested for two antagonistic climate scenarios. For this purpose, a novel and robust optimization tool based on MIDCP has been implemented through the CVXR package, available in R Studio software.

The main contributions of this paper are.• The restructuring of a dynamic convex optimization problem based on MIDCP. It uses the global cost function defined in the CEN EN 15459 standard. In this function it is proposed to add the harmonized upstream life cycle analysis of different energy sources including green hydrogen cogeneration. Therefore, a robust tool capable of long-term sizing of the optimal energy supply for NZEB is provided.

• A modification in the definition of the semi-defined constraints and decision variables of the optimization problem. This has allowed the handling of continuous, discrete and binary decision variables simultaneously. The original optimization problem is transformed to a MIDCP one, this guarantees to find the global optimum in any scenario, even in the intermittent source risk scenario. The use of the CVXR package available in R to perform the optimization provides a public domain alternative to most commercial optimization software.

The performance of this tool was tested by analyzing two antagonistic locations. The results show that the penetration level of hydrogen-powered technology, in suitable conditions, could displace conventional fossil fuel technologies. The use of this tool could be focused on the design and evaluation of policies for the promotion of cleaner and more efficient technologies to be integrated into a building. It could also contribute to decision-makers and those involved in the construction sector to motivate a more sustainable design from an energetic approach.

2 Methodology

This paper implemented a new optimization tool based on convex programming. It is able to provide the power to be install and their supply within a decentralized generation mix for an nZEB. The objective function to be minimized was the global economic cost defined in CEN EN 15459, which integrates investment, operating and maintenance costs, considering the number of replacements within the useful life of the building. The techno-economic inputs have been predefined for the long term. Climate profile data and energy demand profiles were obtained experimentally in two different locations. The performance of the optimization algorithm was benchmarked against other algorithms to check its convergence and speed. The global cost function is based on the net present value (NPV) and the discount rate. The evolution of costs has also been evaluated based on the inflation index. As an additional input, the values corresponding to the upstream LCA of different energy supply sources were aggregated within the economic costs. The economic approach of this function allows a complete analysis that will have different technologies within the distributed generation mix in a building. Fig. 1 shows the general scheme, where the red dotted line represents the phase of obtaining the input parameters. In this phase, the technical and economic parameters were selected according to the most appropriate sources and technologies to be applied in the optimization algorithm. The thermal and electrical generation sources collected information on useful life, LCA, number of replacements, fixed costs and variable costs. These parameters were considered at the micro-scale generation level. With the energy sources and their techno-economic parameters defined, the performance profiles of renewable (non-dispatchable) and non-renewable (dispatchable) sources were obtained. The evaluation of renewable resources was performed on a seasonal basis using a procedure that will be explained in more detail later. Risk management of renewable sources was also addressed in this phase, through an extreme scenario, defined as the low energy supply capacity of intermittent sources. Additionally, at this stage, electrochemical storage was added to manage renewable sources. Finally, the electric grid was also considered to measure its penetration within the distributed generation mix in different scenarios. The blue dashed line corresponds to the characterization stage of the building's energy demand. In this study, the demand was segmented into an electrical and a thermal profile, both obtained on a seasonal basis. To evaluate the demand response, the energy demand profiles were obtained in two locations with antagonistic climatic conditions. Finally, the dashed green line represents the development phase of the optimization algorithm. In this phase, the decision variables, the objective function and the constraints that make up the optimization problem were defined. The syntax of the problem was established in natural mathematical language complying with MIDCP rules. It was verified that the problem is disciplined convex before executing the optimization. As output, the number of sources to be installed and their energy contribution were obtained. Based on the techno-economic parameters and the energy demand of the building, different scenarios were proposed based on the risk management of intermittent profiles, price variation and energy demand limitation policies. All these considerations have been modeled within the constraints of the algorithm. The objective was to find the penetration level of the different energy sources within the generation mix of the algorithm as well as the impact of the implementation of green hydrogen. The following sections describe in detail the proposed development phases.Fig. 1 Methodology.

Fig. 1

2.1 Input data

The energy sources and technologies to be installed in the building have been selected at this stage. For such purpose, it was necessary to evaluate the energy potential of renewable resources. Due to their technological maturity, solar thermal, solar photovoltaic and wind turbine sources were selected. In addition, green hydrogen (H2) was selected as the primary fuel in the combined heat and power technology (CHP). H2 CHP was the denotation for this energetic source. The non-renewable sources selected were: heat pump and gas boiler. With the selection of these thermal energy sources, it was intended to compare a Hydrogen-powered technology against a traditional natural gas-powered technology. For a better understanding of the energy contribution of each selected source, the study has been divided into two sections: thermal and electrical. Once the renewable and no-renewable sources have been defined, their performance profiles were obtained. The methodology applied for each profile is detailed in the following sections.

2.1.1 Thermal energy supply

Thermal energy supply ∑jtndjt considered the use of the following sources jt: solar thermal, heat pump, boiler and H2 CHP. The performance profile of the solar thermal source was obtained based on the methodology applied in Ref. [30]. The evacuated tube collector (ETC) technology has been selected, where its performance curve [31] was calculated in (1) as a function of the temperature variation of the inlet and outlet fluid and the ambient temperature:(1) dst=d0−k1∙(T‾−Ta)G−k2∙(T‾−Ta)2G

where dst (%) represents the collector efficiency, d0 (%) is the collector optical efficiency, G (W m−2) is the global irradiance, k1 and k2 are the collector heat loss coefficients, T‾ (°C) is the average collector inlet and outlet temperature and Ta (°C) is the ambient temperature. The variables d0, k1, k2 were retrieved from the manufacturer data, while Ta and G were obtained from the PVGIS and NREL databases [[32], [33]]. A site adaptation procedure for the G defined in Ref. [34] was carried out.

For the heat pump profile, the idealized Carnot cycle was used. For a better understanding, the effect of the compressor and heat exchangers was neglected. This analysis led to an average coefficient of performance (COP) of 3.5. Natural gas was used as the primary fuel for the boiler. The thermal efficiency considered was 90 %. A solid oxide fuel cell (SOFC) in the H2 CHP technology was assumed with a thermal efficiency of 45 %.

2.1.2 Electric energy supply

In this section the electric supply profile ∑jendje considered the following sources je: solar photovoltaic, wind turbine, cogeneration micro-turbine, (hydrogen CHP fuel cell) and the grid connection. In addition, an electrochemical storage system has been selected as a mode of management of intermittent source availability. The profile of the solar photovoltaic source, equation (2), was based on the maximum cell performance of a crystalline silicon PV module described in Ref. [35]:(2) dpv=dSTC∙(GHIGHISTC)∙[1−γ∙(Tc−25)]

where dpv (%) is the maximum cell power, dSTC (%) is the cell power under standard test conditions, γ (°C−1) is the maximum cell power temperature coefficient, Tc (°C) is the cell temperature. GHISTC = 1000 (W m−2), dSTC and γ are supplied by the manufacturer, whereas Tc with equation (3):(3) Tc=Ta+GHI∙(NOTC−20800)

where NOTC (°C) corresponds to the nominal operating temperature of the cell and is given by the manufacturer.

The simplified wind power model, equation (4), was used for the wind turbine profile of three blades. It was considered that the maximum power extracted from the wind corresponds to the Betz limit with an efficiency of 0.59 [36].(4) dw=12∙Cp∙ρ∙v3∙π∙R2

dw (W) is the rotor power, Cp is the rotor power coefficient (Betz limit), ρ (Kg m−3) is the air density at hub height, v is the wind speed for a specific location and R (m) is the rotor radius. The integration of wind turbines into a building's energy systems is possible once the wind resource at the site has been evaluated. Microturbines are particularly suitable for installation in the corridors of low-rise buildings or on rooftops [37].

For the SOFC profile (CHP) in electricity supply, an efficiency of 55 % was used. For a detailed review of this technology see Ref. [38].

For simplicity, the grid connection performance profile has been assumed to be ideal, dg=100%. Finally, the battery has been selected considering lithium-ion technology with a depth of discharge (DOD) of 75 %. It is imperative to emphasize that for enhanced battery management, forecasting the load uncertainty is crucial to optimize the battery's charging and discharging schedule, as demonstrated in Ref. [39]. Nevertheless, for the practical purposes of this investigation, only a deterministic load demand has been considered.

The performance profiles of the selected technologies in the thermal and electrical sections were sorted as a set of daily average values on a seasonal basis. Solar thermal, PV and wind turbine sources are powered by intermittent resources, so it is necessary to emulate climatic conditions of solar radiation, wind speed and temperature under low energy supply conditions. For this reason, two scenarios were considered: optimistic which is the base scenario; and pessimistic, which involves risk management. For the pessimistic scenario, the gap between average renewable resource values of a typical meteorological year (TMY) and extreme values [40] was set at 50 % of the energy potential of the base scenario.

2.1.3 Economical and technical assumptions

Table 2 summarizes the economic and technical assumptions of the sources used. CapEx and OpEx were considered as fixed costs, where decommissioning costs were included [[41], [42], [43]]. CO2 emissions in the life cycle analysis (LCA) generated in the extraction and manufacturing stage were also included [44]. The price of emission allowances (EUA) traded in the European Union Emissions Trading Scheme (ETS) was established as the average of the year 2020 [45]. Supply energy costs were considered as variable costs where CO2 emissions from primary fuels used in each source were also considered [46]. The base units were established by power and space criteria according to medium-sized buildings in the tertiary sector. The number of replacements was obtained by setting a time horizon of 30 years. For a better understanding, the economic inputs were summarized in Table 3, which shows the relation between the financial data and constants assumed in the algorithm.Table 2 Economical and technical assumptions.

Table 2Source	Technology	CapEx [€/kW] [41,42]	OpEx [€/kW/y] [41,42]	CO2 upstream LCA [gr CO2/kWh]	CO2 emission [gr CO2/kWh]	EUA CO2 emissions cost [€/T CO2]	Supply Cost [€]	Total supply Cost [€]	Base unit [kW]	Lifetime [y]	Replacements	
Solar thermal	ETC	1200	20	20	0	24.75	0.02	0.0200	1	25	1	
Heat pump	ASHP	900	15	19	357	0.09	0.0988	25	20	1	
Natural gas boiler	H2R	700	27	20	252	0.07	0.0762	25	15	1	
H2 CHP	SOFC	12000	42	27	0	0.237	0.2370	1	10	2	
Solar photovoltaic	Cristalline silicon	1982	29	28	0	0.048	0.0480	1	25	1	
Wind turbine	Horizontal axis	2182	56	12	0	0.033	0.0330	20	25	1	
Grid connection	Source-mix	63	36	649	331	0.12-0.22	0.1282-0.2282	1	1	29	
Battery system	Li-ion	420	20	32	–	–	–	20 [kWh]	10	2	

Table 3 Summary of financial inputs.

Table 3financial assumptions	Fixed costs	Variable costs	CO2 emissions upstream LCA	CO2 emissions	Emission allowances	Supply Costs	Total supply costs	Price evolution	Cost of capital	Discount rate (year i)	Calculation period	
Value	CapEx + OpEx + CO2 emissions upstream LCA	Total supply costs	Table 2	Table 2	24.75 [€/T CO2]	Table 2	Supply Costs+(CO2 emissions)x (Emission allowances)	2 %	7.50 %	1(1+7.5%l)i	30 [y]	

It is important to note that this information could change depending on the size of the sources, the geographic area, state policies, market evolution, etc. Although the costs of the different renewable sources have been on a downward trend for years, the pandemic and the conflict in Ukraine have created an inflection point that should not be ignored, especially in the costs of fossil fuels, raw materials and the development of emerging technologies.

2.2 Energy demand

Demand profiles for two buildings in the tertiary sector were selected. Data were retrieved from January 1 to December 31, 2022. The profiles were also aggregated as daily averages on a seasonal basis. The locations chosen were Madrid-Spain (40.408, −3.711) and Milagro-Ecuador (−2.150, −79.60). The technology used in both cases to obtain the data was a Schneider Electric ION8650 grid meter [47]. Whereas the seasonal profiles in Spain have four seasons, in Ecuador there are only two seasons: dry and wet. The wet season is from December to May and the dry season from June to November. In Spain, thermal demand Dt and electricity demand De were considered, but in the case of Ecuador, only electricity demand was considered due to its tropical climate throughout the year.

2.3 Optimization algorithm

Once the input parameters were defined, the optimization of the global cost function established in the CEN EN 15459 standard [48] was proposed. The optimization problem was composed of the decision variables, defined in expression (5), an objective function and its constraints. MIDCP was employed because of its versatility in solving problems with dynamic profiles, in both the objective function and the constraints. The objective of the algorithm was to minimize the objective global cost function to obtain the number of sources of each technology to be installed (z), and their energy supply (x), both fixed as decision variables, as it can be seen in equation (5).(5) minz,xF(z,x)

2.3.1 Objective function

The objective function to be optimized took into account the overall cost of the energy system and its components. The CEN EN 15459 standard was used for the calculation. This method consists of a discounted value of all costs during a defined calculation period. This standard contemplates investment costs (including replacements), operating costs, depreciation, price evolution and final salvage value in a long-term calculation period. The purpose of using this function was to determine the impact of different technologies within a building at the end of the calculation period. In addition, it was proposed to add to this function the harmonized LCA values upstream of each system. This made it possible to obtain more realistic economic indices such as the Energy Return of Investment EROI or the Levelized Cost of Energy LCOE. Equation (6) used in the optimization algorithm shows the global cost calculation defined in the CEN EN 15459 standard. This standard follows the methodology proposed by the Buildings Performance Institute Europe BPIE [49].(6) CG(τ0)=C1(j)+∑j[∑i=1τ(Ca,i(j)×Rd(i))−Vf,τ(j)]

where CG(τ0) denotes the global cost referred to the initial year τ0, C1 considers the initial investment costs (including extraction and manufacturing costs of an LCA analysis), τ represents the calculation period, Ca,i(j) represents the annual variable cost of year i of component j where operating or component replacement costs were included, with Rd(i) being the discount rate for year i. Finally, Vf,τ(j) refers to the residual value of the component j at the end of the calculation period τ.

Fixed investment costs were disaggregated using equation (7):(7) C1(j)=(zj×uj×Cij)+Crj(τ)

where zj is the number of sources to be installed, uj is the base unit power selected, Cij represents the initial investment costs of technology j, which includes the costs of operation, maintenance, extraction and manufacturing emissions costs, finally, Crj(τ), calculated in (8), are the replacement costs for the calculation period τ:(8) Crj(τ)=nrj(τ)×(zj×uj×Cij)×(1+Rp)nrj(τ)×τj×1(1+Cc)nrj(τ)×τj

nrj(τ) represents the number of replacements in the calculation period, Rp is the percentage of price evolution fixed at 2 %, τj is the useful life in years of technology j, Cc represents the weighted average cost of capital, where a constant score of 7.5 % has been assumed [41].

In (9), the annual variable costs of year i of component j are represented as cash flow:(9) Ca,i(j)=365ns×xj×pj

ns represents the number of seasonal profiles, xj the energy supply of source j, and pj is the generation price related to the value of the primary energy or fuel used. For sources using fossil fuels, the cost of CO2 emissions was added.

The discount rate Rd(i) referred to year i is defined in equation (10) as:(10) Rd(i)=1(1+Cc)i

Lastly, the residual value or salvage cost in has been defined in (11) by:(11) Vf,τ(j)=[(zj×uj×Cij)×(1+Rp)nrj(τ)×τj]×[(nrj(τ)+1)×τj−ττj]×Rd(τ)

where the expression [(zj×uj×Cij)×(1+Rp)nrj(τ)×τj] represents the evolution of the initial investment cost of component j, [(nrj(τ)+1)×τj−ττj] expresses the linear depreciation of the last replacement of technology j with respect to its useful life, and Rd(τ) corresponds to the discount rate at the end of the calculation period τ.

The final objective function of the algorithm (12) was defined as the addition of the global cost of each of the sources j of the thermal 2.1.1 and electrical 2.1.2 sections:(12) FTotal=Ft+Fe

the thermal function Ft was formed by the global thermal cost function CGt(τ0) of each thermal source jt referred to the current calculation period τ0, has been defined in (13) as follows:(13) Ft=∑jtnCGt(τ0)=∑jtn{C1(jt)+∑jt[∑i=1τ(Ca,i(jt)×Rd(i))−Vf,τ(jt)]}

likewise, the electrical function Fe formed by the global electrical cost function CGe(τ0) of each electricital source je referred to the current calculation period τ0, has been defined in (14) as:(14) Fe=∑jenCGe(τ0)=∑jen{C1(je)+∑je[∑i=1τ(Ca,i(je)×Rd(i))−Vf,τ(je)]}

2.3.2 Constraints

The constraints of the optimization problem were due to the real energy supply limits depending on the power to be installed. The decision variables of number of units to install z were defined as discrete while the energy supply variables x were defined as continuous, while the battery charge and discharge variables were defined as binary variables.

Each function (13) and (14) has its own constraints. The constraints of the thermal function include all thermal sources selected in 2.1.1 section. The Balance of System (BOS) has also been considered. Equations (15), (16) represent the lower and upper limits respectively of the thermal source jt :(15) zjt≥0

(16) zjt≤1e6

The semi-defined constraint in (17) establishes the supply xjt limit of the thermal source jt which shall not exceed the power to be installed, considering its performance profile djt:(17) xjt≤zjt×ujt×djt

The thermal BOS (18) was defined as the coverage of the thermal demand profile through the sum of the energy supply of each of the thermal sources considered:(18) Dt=∑jtnxjt

Likewise, for the electrical section, the upper and lower limits of the units to be installed were defined in constraints (19), (20):(19) zje≥0

(20) zje≤1e6

Similarly, in (21), the supply xje limit of the electrical source je which shall not exceed the power to be installed, considering its performance profile dje:(21) xje≤zje×uje×dje

The electrical BOS (22) was defined as the equilibrium of electrical demand and electrical energy supply:(22) De=∑jenxje

BOS of thermal and electrical demands (18) and (22) considered the supply ratio of profiles that generate heat (70 %) and electricity (30 %) simultaneously (CHP). Also, the heat supply with an electrical demand added to the electrical demand profile (Heat pump).

2.3.2.1 Battery constraints

The mathematical model applied to the battery charging and discharging management was described in the decision variables xd , yd and xc, yc respectively and constraints to be added to the electrical section. xd represents the stored electrical energy input according to the discharge power, while xc represents the instantaneous storage capacity. The variables xi in (23), sets the initial state of charge (SOC). The binary variables yd and yc in expression (24), indicate whether the battery is discharging 1 or charging 0 respectively. The technical limits (25) and (26) of the restrictions applied were:(23) xi≥0

(24) yd+yc≤1

(25) xd≥0

(26) xd≤zb×ubp×db

where zb corresponds to the battery units to be installed, ubp is the discharge power (DOD assumed) and db is the battery performance profile. The upper discharge limit in (27) was set in as:(27) xd≤yd×1e6

Likewise, the battery charging restrictions (28), (29) and (30) were:(28) xc≤0

(29) xc≥−1×zb×ubp×db

(30) xc≥−1×yc×1e6

In (31), the condition and limit applied for the battery state of charge (SOC) was:(31) xi≤zb×ubs

where ubs is the unit of battery storage capacity.

The electrical energy storage of the battery is performed when energy supply of all electrical sources exceeds the electrical demand. In turn, the amount of electrical energy taken from the battery is given when the electrical supply from all sources cannot satisfy the electrical demand. The storage and energy supply limits (32) and (33), were given by:(32) [1111⋮1]∙xi+[1001101110…00…00…0111⋮⋮⋮1111…0⋮⋱01…1]∙(−xd−xc)≤zb×ubs

(33) [1111⋮1]∙xi+[1001101110…00…00…0111⋮⋮⋮1111…0⋮⋱01…1]∙(−xd−xc)≥0

Moreover, the constraint (34) provided for the impossibility of charging and discharging the battery at the same time:(34) xd+xc=0

Although the battery management methodology presented in this paper uses dynamic energy profiles, it would be valuable to explore analytical methods that ensure convergence, computational efficiency, and sensitivity, as demonstrated in Ref. [50], where the study focuses on an online optimal control strategy for a battery-integrated energy storage system (BIES). This method is applied to minimize the cost of electricity procurement from the grid, considering system constraints and battery efficiency.

With the thermal and electrical (including battery) section constraints defined, both were aggregated in (35) into a single constraint RTotal:(35) RTotal=[Rt,Re]

where Rt and Re represent the stringing together of all thermal and electrical source constraints respectively. For better visualization, the constraints have been summarized in Table 4.Table 4 Constraints.

Table 4Boundary	Thermal function	Electrical function	Battery	BOS	
Upper	zjt≤1e6	zje≤1e6	yd+yc≤1		
	xjt≤zjt×ujt×djt	xje≤zje×uje×dje	xd≤zb×ubp×db		
			xd≤yd×1e6		
			xc≤0		
			xi≤zb×ubs		
			[1111⋮1]∙xi+[1001101110…00…00…0111⋮⋮⋮1111…0⋮⋱01…1]∙(−xd−xc)≤zb×ubs		
Lower	zjt≥0	zje≥0	xi≥0		
			xd≥0		
			xc≥−1×zb×ubp×db		
			xc≥−1×yc×1e6		
			[1111⋮1]∙xi+[1001101110…00…00…0111⋮⋮⋮1111…0⋮⋱01…1]∙(−xd−xc)≥0		
Defined			xd+xc=0	Dt=∑jtnxjt	
				De=∑jenxje	

2.3.3 Optimization process

Once the input data, the objective function and its constraints were established, the open-source software R Studio 4.1.1 2021 was used. The CVXR package [51] was adapted for the optimization process. CVXR allows the modeling of convex problems in a natural mathematical syntax unlike most commercial solvers. The CVXR package enables to verify that the problem is disciplined convex (DCP) and, once validated, transforms it to conic form using graph implementations. For a detailed review of these features, see Refs. [[20], [52]]. The objective function was discretized and the constraints were set as a list. The GLPK solver was employed to minimize the optimization problem. This solver is useful for solving problems like Linear (LP), Mixed-Integer Linear (MILP) and other types. The problem stated was MIDCP. However, CVXR does not allow to define binary decision variables. Therefore, it was necessary to implement a code that allows to emulate binary variables. This process was carried out through the assignment as integers of the battery decision variables yd and yc and its constraints. The optimization process will be successful as long as the algorithm finds a global minimum of the cost function, capable of satisfying each of the constraints of the problem.

2.4 Scenarios and policies

Policies that determine the energy supply of a building with a minimum of renewable energy sources and that limit the demand of the electricity grid can be easily modeled in the algorithm. Furthermore, the evaluation of different economic scenarios, where the trend is towards a decrease in supply costs, could also generate interesting results. The proposed scenarios could provide decision-makers with data to generate state policies in the pre-feasibility and design stage of an nZEB project. Although the simulation of district networks and energy markets within the optimization algorithm could offer a comprehensive spectrum of analysis, the object of this study only considered decentralized generation in individual systems.

This study defined two antagonistic climate scenarios to test the performance of the proposed algorithm. For each scenario, an optimistic baseline energy supply and a pessimistic energy supply were considered. The pessimistic scenario represented the risk management of renewable sources. Two locations were selected as case studies, the first one in Spain with a marked seasonality and powerful renewable resources such as solar radiation and wind. The other scenario was located in a coastal area in Ecuador with constant tropical seasonality, only differentiated by dry and rainy periods, with 80 % cloud cover throughout the year and a weak wind resource. For both scenarios, the costs of electricity from the grid were set according to the regulations of each country, considering its variability in off-peak and peak hours. In the case of the Ecuadorian scenario, only the electric section was used in the algorithm since its tropical climate does not require thermal energy demand. In addition, the H2 CHP source was excluded from this scenario, since the real efficiency of this technology is revealed in the combined supply of heat and electricity. Finally, the investment costs of the electric section sources were updated with an increase of 16 % assuming transportation costs and local taxes.

With the case studies defined in Madrid-Spain and Milagro-Ecuador, a sensitivity analysis was proposed. Starting with the base scenario using the inputs defined in Table 1, the effects caused by variations in CapEx, OpEx and the yield of intermittent sources were studied considering a scenario for risk management. With the optimistic and pessimistic reference scenarios, different possibilities were considered. In the case of H2 cogeneration technology, CapEx and OpEx reduction was proposed in different simulation scenarios. The objective was to achieve a gradual increase in the penetration of this technology within the distributed generation mix. In addition, for the case of the Ecuadorian scenario, an increase in electricity costs in accord with the Spanish electricity market was considered. The objective was to study the level of penetration of renewable energies under unfavorable economic and technical conditions. Table 5, Table 6 show the variables used in the sensitivity analysis for each of the scenarios evaluated in Madrid and Milagro, respectively.Table 5 Sensitivity variables and scenarios. Case study Spain.

Table 5Inputs variables	a) Optimistic base	b) Pessimistic reduction OpEx	c) H2 reduction OpEx	d) H2 reduction CapEx and OpEx	e) Pessimistic reduction CapEx and OpEx	
CapEx	Table 2 inputs	Table 2 inputs	Table 2 inputs	H2 CHP = 3000 [€/kW]	H2 CHP = 3000 [€/kW]	
OpEx	Table 2 inputs	H2 CHP = 0.1185 [€/kW]	H2 CHP = 0.1185 [€/kW]	H2 CHP = 0.1185 [€/kW]	H2 CHP = 0.1185 [€/kW]	
Performance profiles intermittent sources (solar, wind)	Experimental data	(solar profile)*0.5, (wind profile)*0.5	Experimental data	Experimental data	(solar profile)*0.5, (wind profile)*0.5	

Table 6 Sensitivity variables and scenarios. Case study Ecuador.

Table 6Inputs variables	a) Optimistic base	b) Increase electricity costs	c) Pessimistic with increase electricity costs	
CapEx	(Table 2 inputs)*1.16	(Table 2 inputs)*1.16	(Table 2 inputs)*1.16	
OpEx	Ecuadorian grid electricity prices	Spanish electricity market prices	Spanish electricity market prices	
Performance profiles intermittent sources (solar, wind)	Experimental data	Experimental data	(solar profile)*0.5, (wind profile)*0.5	

3 Results and discussion

The results of the simulations have achieved an optimal convergence of 100 % in the proposed scenarios, with a resolution time of 14 s and using a memory of about 183 MB. Table 7 shows the performance of the algorithm for each scenario. Table 8 shows the benchmark with genetic and metaheuristic algorithms. The objective functions of the GA, NSGAII and aNSGAII algorithms were evaluated through the R package Profvis. The higher efficiency of the proposed optimization algorithm is evidenced, reaching the global optimum in a fraction of the time of the other optimization techniques. The performance of the proposed MIDCP algorithm achieves high efficiency compared to other genetic algorithms. A global optimum has been reached that guarantees the convergence of the algorithm in all scenarios. Most remarkable is the low computational cost which was 309 times faster than aNSGA II.Table 7 MIDCP algorithm performance in all scenarios.

Table 7Scenario	Section	Location	Convergence	Is disciplined convex?	Memory [MB]	Runtime [ms]	
a) Optimistic base	Thermal	Madrid-Spain	Optimal	TRUE	15	1200	
b) Pessimistic reduction OpEx	Optimal	TRUE	15	1200	
c) H2 reduction OpEx	Optimal	TRUE	15	1200	
d) H2 reduction CapEx and OpEx	Optimal	TRUE	15	1200	
e) Pessimistic reduction CapEx and OpEx	Optimal	TRUE	15	1200	
a) Optimistic base	Electrical	Optimal	TRUE	17	1400	
b) Pessimistic reduction OpEx	Optimal	TRUE	17	1400	
c) H2 reduction OpEx	Optimal	TRUE	17	1400	
d) H2 reduction CapEx and OpEx	Optimal	TRUE	17	1400	
e) Pessimistic reduction CapEx and OpEx	Optimal	TRUE	17	1400	
a) Optimistic base	Electrical	Milagro-Ecuador	Unbounded	TRUE	7.5	200	
b) Increase electricity costs	Optimal	TRUE	7.5	580	
c) Pessimistic with Increase electricity costs	Optimal	TRUE	7.5	590	
Total			
182.5	14370	

Table 8 Results of the benchmark simulation.

Table 8Technique	Convergence	Time [s]	
MIDCP proposed	Optimal	14	
GA [27]	Pareto front (60 %)	60	
NSGA II [23]	Paretofront (40 %)	1080	
aNSGA II [23]	Pareto front (80 %)	4320	

In Madrid-Spain, the simulation produced results in 10 different scenarios, 5 for the thermal section and 5 for the electrical section. For both sections, the results for each of the scenarios were obtained as follows: a) Optimistic base, b) Pessimistic reduction OpEx, c) H2 reduction OpEx, d) H2 reduction CapEx and OpEx and e) Pessimistic reduction CapEx and OpEx. The Optimistic base scenario considered current financial data and normal performance of intermittent renewable sources. The Pessimistic reduction OpEx secenario considered the reduction in the performance of intermittent renewable sources (risk management) and the 50 % reduction in generation costs of H2 CHP technology. The H2 reduction OpEx scenario maintained the reduction in supply costs of H2 CHP technology without considering the uncertainty of generation from renewable sources. The H2 reduction CapEx and OpEx secenario retained the performance of renewable sources but reduced CapEx to −75 % and OpEx to −62 % (gray H2). Finally, the pessimistic reduction CapEx and OpEx maintained previous CapEx and OpEx reductions but considered risk management of renewable sources. The following sections present the results of the most representative scenarios a) and e) for the thermal and electrical sections, respectively.

3.1 - Thermal section Madrid. a) baseline scenario

Fig. 2 shows the base optimistic scenario a). In this baseline scenario, H2 CHP technology is not installed and therefore there is no thermal power generation throughout the year. If this trend continues in the medium term, green hydrogen will not be able to compete with conventional energy production technologies. The heat pump generates an energy input of up to 25 kWh only in the winter, since the electricity grid powers it. The natural gas boiler provides the greater thermal energy input throughout the year, followed by solar thermal technology. This scenario is consistent due to the technological maturity of the boiler and its OpEx. This result is congruent with [28], where in the Zaragoza scenario gas consumption increased by 20 %. It can be seen that although the solar thermal energy contribution is constant throughout the year, its intermittency and energy density limitations do not enable it to displace the gas boiler. In the context of these results, the adoption of green hydrogen incentive policies is crucial in the thermal scenario decarbonization. Likewise, the introduction of biomass-powered sources could be a viable alternative facing the intermittency of the solar thermal source.Fig. 2 Thermal section energy supply by source and season. Optimistic base scenario.

Fig. 2

3.1.1 Thermal section Madrid. e) pessimistic reduction CapEx and OpEx

Fig. 3 represents scenario e) Pessimistic reduction CapEx and OpEx. In this scenario, H2 CHP technology provides its energy contribution in a disruptive way compared to the baseline scenario, given that investment costs are reduced to boiler cost levels and operating costs to gray hydrogen levels. Under these conditions, the H2 CHP generation capacity is able to regulate the demand coverage in fall and winter seasons. The heat pump maintains its energy supply trend in more extended time zones compared to the previous scenario. The boiler reduces its supply by about 50 % compared to the base scenario. Finally, solar thermal energy supply is zero. This result is consistent, since in this scenario, the solar performance profile was reduced by half as a way to handle the risk. In this scenario, the technological maturity of the H2 CHP source is considered by reducing its investment and operating costs. It is remarkable that under these conditions the energy contribution is higher than the rest of the sources considered in the mix. On the other hand, evaluating the uncertainty of the solar thermal source at low performance levels reflects a higher thermal energy contribution by the heat pump and therefore a higher consumption of the electrical grid.Fig. 3 Thermal section energy supply by source and season. Pessimistic reduction CapEx and OpEx scenario.

Fig. 3

The seasonal mix of thermal energy supply is presented in Fig. 4 for the optimistic baseline scenario. For the fall, the greater energy contribution is provided by the natural gas boiler together with the solar thermal source. Since the energy generation from the boiler is independent of weather conditions, its contribution follows the shape of the demand curve. In the spring and summer the thermal demand decreases as expected, the contribution of solar thermal increases subtly. On the other hand, in winter the presence of all the thermal sources increases, the contribution of the heat pump is made in the demand peaks, being the most convenient choice made by the algorithm. In agreement with these results, the study [53] evaluates the penetration capacity of different sources for a thermal demand network.Fig. 4 Mix sources energy supply. Thermal section. Optimistic base scenario. Seasonal.

Fig. 4

The energy supply mix for the thermal section in scenario e) Pessimistic reduction CapEx and OpEx, is presented in Fig. 5. The higher energy contribution of H2 cogeneration in all seasons of the year, mainly in winter, stands out. The algorithm is consistent in producing higher thermal energy at almost twice the boiler output. Due to the absence of solar thermal energy, H2 CHP turns out to be the most sustainable option in the long term according to the algorithm. This result is in agreement with [[27], [54]], according to which it is more efficient to use a single primary energy source to produce thermal energy and electrical energy, even more so with high CapEx and OpEx.Fig. 5 Mix sources energy supply. Thermal section. Pessimistic reduction CapEx and OpEx scenario.

Fig. 5

Fig. 6 shows the installed power of each source in the thermal section for the 5 scenarios generated. Note that in the base scenario a) the H2 CHP source is not installed due to the current high operation and maintenance costs. On the other hand, the source with the highest installed power is the natural gas boiler with 175 kW, followed by solar thermal and heat pump with 47 kW and 25 kW respectively. Scenario b), where the OpEx of the H2 CHP source is reduced by 50 % considering risk management, allows an installed power of only 1 kW for H2 CHP. While the natural gas boiler and the heat pump remain with their initial powers of 175 kW and 25 kW respectively, the installed power of the solar thermal source reaches 11 kW. For the third scenario c), where the risk management of the solar thermal source is not considered but the reduction of the OpEx for H2 CHP is maintained, 1 kW for H2 CHP, 175 kW for the natural gas boiler, 25 kW for the heat pump and an increase of 36 kW for the solar thermal with respect to the previous scenario b). For scenario d), where CapEx and OpEx are drastically reduced, the installed capacity of H2 CHP grows suddenly, reaching 69 kW, in turn the boiler and solar thermal decrease their installed power to 125 kW and 44 kW respectively. While the heat pump remains constant at 25 kW. Finally in scenario e) where in addition to the drastic reduction of the CapEx and OpEx of H2 CHP, risk management for the solar thermal source is considered. It is here where the H2 CHP source reaches its highest penetration within the thermal energy mix, with an installed power of 148 kW it exceeds for the first time the natural gas boiler that reaches 75 kW, while the heat pump remains with 25 kW and solar thermal is not considered due to its low performance.Fig. 6 Installed power by source. Thermal section. All scenarios.

Fig. 6

Fig. 7 shows the average annual thermal energy supply of each source in the different scenarios. The energy supplied by the natural gas boiler covers in scenarios a), b) and c) more than 70 % of the demand response, while maintaining a high-capacity factor with respect to the rest of the sources. The solar thermal source also presents an important capacity factor in the optimistic scenarios b) and c), the heat pump, although its penetration is constant in all scenarios, its energy supply and therefore capacity factor is lower in all scenarios except a). This is because its primary energy demand is electricity. On the other hand, H2 CHP energy supply has a higher deployment in scenarios d) and e), exceeding even the natural gas boiler. Under current conditions, green hydrogen cannot compete with conventional sources such as natural gas. This is due to its high investment and operating costs. As CapEx and OpEx are reduced, green hydrogen is strengthening its penetration, especially in critical scenarios where intermittent sources do not reach their minimum generation capacity. Solar thermal energy, despite its technical limitations, makes an important contribution to the thermal energy supply mix in all scenarios, with the exception of the pessimistic scenario where risk management is simulated.Fig. 7 Average annual energy supply by source. Thermal section. All scenarios.

Fig. 7

The box plot in Fig. 8 shows the distribution of average annual energy supply values by source in the generated scenarios. The dots represent the outliers. The largest number of outliers appears in the heat pump, due to its weak energy contribution in all scenarios, filling low gaps within the source mix. Although the heat pump is an efficient technology compared to other conventional air conditioning technologies, its use uses electricity. For this reason, the thermal contribution of the heat pump is low, due to the high cost of electricity in the Spanish energy market and its associated CO2 emissions. The natural gas boiler has an even distribution within the thermal energy supply mix, especially in scenarios a), b) and c), due to its regulation capacity. The solar thermal source has a low median in scenarios a), b) and c), due to the distribution of its radiation profile throughout the day. Finally, H2 cogeneration has a high median in scenario d) and a more uniform median in scenario e), suggesting an increase in regulation capacity in favorable energy supply scenarios.Fig. 8 Average annual supply boxplot by source. Thermal section. All scenarios.

Fig. 8

3.2 Electrical section Madrid. a) baseline scenario

On the other hand, the simulations of the electrical section are shown in Fig. 9 for the base scenario a). This scenario shows the energy supply of the different sources in each season of the year. The charging and discharging process of the batteries presents a defined pattern throughout the year in which there are no significant changes in energy management. Note that in the time range from 7 a.m. to 21 p.m. there is no charging. This is because the battery is discharged in this time interval to help cover the peak hours of the demand curve with the rest of the energy sources within the mix. The power supply from the grid connection shows an invariable shape in winter, spring and summer, with slight variations in autumn. Its contribution is mainly in the afternoon and evening. The H2 cogeneration source does not generate electricity supply because its supply is conditioned to the thermal section, where the algorithm does not find the economic optimum. The PV source has a defined energy supply throughout the year, due to the hours of radiation available during the day; the summer season has a higher energy contribution compared to the rest of the year. Finally, the wind turbine has a varied energy supply throughout the year, reaching its maximum performance in the summer period, it is noteworthy that this source has the highest energy contribution than the other sources. This baseline scenario reflects a greater focus on the electricity supply of the H2 CHP source, due to its zero contribution to the energy mix. Given that the current prices of green hydrogen-based technologies are not competitive with renewable energies, their implementation is still far off. On the other hand, the penetration of PV and wind turbine is high, due to the high availability of irradiance and wind speed in Madrid. This fact justifies the appearance of batteries to manage its intermittency.Fig. 9 Electrical section supply by source and season. Optimistic base scenario.

Fig. 9

3.2.1 - Electrical section Madrid. e) pessimistic reduction CapEx and OpEx

The results of seasonal electricity supply for each source are presented in Fig. 10 for scenario e). In this extreme scenario, it is observed that the only two sources producing electricity are mainly the grid connection and the electrical contribution of H2 cogeneration with a low penetration level. The deficit of renewable primary energy, such as sun and wind, does not lead to the installation of batteries. This scenario represents the extreme conditions that may occur due to climate change, where the generation capacity of intermittent sources is reduced to 50 %. In these conditions the grid plays a crucial role, followed by developing sources such as H2 CHP. It is in this type of scenario where a higher penetration of the latter source would reduce grid dependence in near-zero energy buildings. Although the cost reduction in the H2 CHP source has reached optimal levels, its penetration is not sufficient to significantly reduce grid dependence. This result points to the need to diversify the energy input in the distributed generation mix, with clean energy sources that do not only use the sun or wind as primary energy.Fig. 10 Electrical section supply by source and season. Pessimistic reduction CapEx and OpEx scenario.

Fig. 10

Fig. 11 shows the electricity supply mix by season for scenario a). The high penetration of renewable energies is remarkable in all seasons. This effect reduces the dependence on electricity from the grid. The largest energy contribution throughout the year is generated by the wind turbine, mainly in the summer season. It is followed by the battery, the grid connection and finally, photovoltaics. The H2 CHP source does not generate electricity supply in this scenario, because its installation is conditioned to the thermal section, where its results were previously presented. It is observed that the battery charging is mainly performed when the energy supply comes from the wind turbine or the photovoltaic. Note that the demand response in spring is covered entirely by renewable sources. These results are in agreement with the study conducted in Ref. [55].Fig. 11 Mix sources supply. Electrical section. Optimistic base scenario. Seasonal.

Fig. 11

Unlike scenario a), Fig. 12 shows the seasonal supply mix for scenario e), in which renewable energy risk management is considered. The algorithm considers throughout the year, only the grid contribution and the H2 CHP electrical contribution for demand coverage. Most of the demand response is provided by the grid, with low H2 CHP supply, since this source contributes only 30 % of its total energy supply. This result is in line with that obtained in the thermal section, due to the greater contribution of thermal energy produced by H2 cogeneration in the winter and fall seasons. The absence of renewable sources in the mix means that most of the energy produced is dependent on the electrical grid.Fig. 12 Mix sources supply. Electrical section. Pessimistic reduction CapEx and OpEx scenario.

Fig. 12

Fig. 13, Fig. 14 show the installed power and average annual supply of the electricity sources in the different scenarios. In the base scenario a) the wind turbine has the greater installed power and electrical energy supply, giving rise to a capacity factor close to 30 %. It is followed by PV, grid connection and battery with capacity factors of 26 %, 11 % and 4 %, respectively. In pessimistic scenario b), neither PV sources nor wind turbines are installed. More than 99 % of the demand response is provided by grid connection and a small contribution of H2 CHP. The results of scenario c) are similar to scenario a) with the difference that in scenario c) there is a small electrical contribution of 15 kWh on average per year from H2 CHP. Installed capacity and energy supply in scenario d) continues to be led by wind turbine. Note that in this scenario, for the first time, the installed capacity and electricity supply of H2 CHP is greater than PV. The installed capacity of the battery increases by 40 kWh compared to scenario c). Finally, the installed power and the energy contribution of the grid connection remains similar to the previous scenario. Scenario d), which considers the risk management of renewable sources, presents an installed capacity and energy supply only from grid connection and H2 CHP with capacity factors of 44 % and 18 % respectively (see Fig. 15).Fig. 13 Installed power by source. Electrical section. All scenarios.

Fig. 13

Fig. 14 Average annual supply by source. Electrical section. All scenarios.

Fig. 14

Fig. 15 Average annual supply boxplot by source. Electrical section. All scenarios.

Fig. 15

Boxplot 15 shows the distribution of the energy supply data for the different electricity sources in all scenarios. The wind turbine shows a uniform distribution in the optimistic scenarios and is the best performer in the electricity generation mix. In the Madrid location, this renewable source could be considered as a base energy within the generation mix. The complement to this renewable source is integrated by photovoltaic energy which, together with batteries, allows managing the energy demand, mainly in scenarios a), c) and d). The distribution of H2 cogeneration values shows a higher regulation capacity in scenario e) compared to scenario d). Finally, the outliers generated by the power grid in scenarios a), c), and d) represent the appropriate distribution that non-renewable and fossil sources should have within the distributed generation mix in in near-zero energy buildings.

Fig. 16 summarizes the installed power of fossil sources and the penetration of renewable sources in all scenarios. Scenarios b) pessimistic reuction Opex and e) pessimistic reduction Capex and Opex belong to the lowest and highest penetration of renewable energy sources respectively. Note that the installation of renewable sources is conditioned to the meteorological factor and to the reduction of the investment costs of developing technologies. Fig. 17, Fig. 18 also show the annual average and the percentage penetration of renewable energies with respect to fossil fuels. The installed power with respect to production shows a lower energy density of renewable sources, especially in solar energy, which requires a greater area for its implementation, the main disadvantage of integrating into nZEB.Fig. 16 Summary of installed power from renewable sources for all scenarios.

Fig. 16

Fig. 17 Average annual supply from renewable sources for all scenarios.

Fig. 17

Fig. 18 Penetration of renewable sources for all scenarios.

Fig. 18

3.3 Electrical section Milagro. A) optimistic baseline scenario and b) scenario with increased electricity costs

On the other hand, in Milagro-Ecuador, the H2 CHP source was not included because its installation is justified in locations where thermal and electrical energy is required. As mentioned above, the climate at this location is tropical with no wide temperature variations in the dry and wet seasons. The simulations have resulted in the generation of three scenarios: scenario a) with the current prices of the technologies, considering the Ecuadorian electricity market, scenario b) where an increase in electricity costs is proposed, and finally, scenario c) where the increase in electricity costs is conserved but the risk management of renewable sources is considered. Fig. 19, Fig. 20 show the supply profiles of the energy sources on a seasonal basis for scenarios a) and b) respectively. Note that in the baseline scenario, the optimization algorithm selects grid connection as the only source of energy supply. This is because the cost of electricity in Ecuador is very low, primarily due to the nation's reliance on hydroelectric power in its energy matrix. Consequently, renewable sources such as PV and wind do not compete with the grid in the long term in this scenario. Fig. 20 shows scenario b), in which electricity costs increase to the level of the Spanish electricity market. In this scenario, photovoltaic energy supply becomes profitable, leading to the emergence of batteries as a storage medium. This result is in line with [28], where higher RES penetration reduces grid dependence by 8 % in the Marseille scenario. On the other hand, the wind turbine is not selected within the mix, due to the weak wind resource present at the site. These results are consistent with the fact that the average wind speed at the Milagro location is 2 m/s [56]. The dry and wet season electricity generation mix in Fig. 21 shows how the grid connection covers the demand of the building in the base scenario a). In this scenario, there is no energy contribution from other sources. It can be seen that there is no major variation in the energy contribution from the grid in the dry and wet seasons.Fig. 19 Electrical section supply by source and season. Optimistic base scenario.

Fig. 19

Fig. 20 Electrical section supply by source and season. Increase electricity costs scenario.

Fig. 20

Fig. 21 Mix sources supply. Electrical section. Optimistic base scenario. Seasonal.

Fig. 21

Fig. 22 shows the supply of the different sources in the dry and wet seasons for scenario b) where there is an increase in electricity costs. In this scenario, PV and grid connection are the sources that mainly cover the demand. Note that, for the first time, the batteries are charged from the grid during the hours when there is a lack of solar radiation. In this scenario, the energy supply mix in the dry and wet seasons maintains similar battery charging and discharging management patterns.Fig. 22 Mix sources supply. Electrical section. Increase electricity costs scenario.

Fig. 22

Fig. 23, Fig. 24 represent the installed power and supply in the three scenarios. In scenarios a) and c) the algorithm selects only the grid connection as the optimal from the economic point of view. This is mainly due to two situations: the first is the low performance of renewable sources due to a weak renewable energy resource and the second is the low price of electricity in the Ecuadorian market, in this context renewable energies are not yet able to compete with traditional sources. Conversely, in scenario b), the increase in electricity costs allows the majority penetration of PV in the mix, and in turn the installation of batteries. However, the installation of the wind turbine is not feasible in any scenario. Although in this scenario the PV supply is higher than the contribution from the grid, its capacity factor only reaches 9 %. However, in this favorable scenario for PV, together with the battery, a coverage of 66 % of the building's energy demand is achieved. This result is similar to the one obtained in Ref. [57], where a hybrid renewable energy system with storage is able to cover 95 % of the total demand of a residential building in France.Fig. 23 Installed power by source. Electrical section. All scenarios.

Fig. 23

Fig. 24 Average annual supply by source. Electrical section. All scenarios.

Fig. 24

The box plot in Fig. 25 presents the distribution of source supply values for each scenario. Note the absence of outliers in all scenarios. This effect may be due to the lack of more energy sources within the mix, but also to the constant solar resource at the Milagro location, which under favorable conditions could be a base energy source. The median grid supply, shows values above 25 kWh for scenarios a) and c). PV reaches its highest energy contribution in scenario b), with peaks close to 56 kWh, while the battery reaches peaks of 8 kWh. The high penetration of PV in scenario b) will predict in the short term, a greater development of this technology in Ecuadorian buildings.Fig. 25 Average annual supply boxplot by source. Electrical section. All scenarios.

Fig. 25

The scenarios evaluated provide a long-term perspective on the sustainability of implementing a mix of technologies in a tertiary sector building. Under favorable performance conditions and competitive generation prices, renewable energy sources could close to 100 % coverage of a building demand. Storage systems make it possible to manage the intermittency of renewable sources, providing energy mainly at peak demand times. On the other hand, in unfavorable weather conditions and with prices for renewables that are not competitive with the traditional electricity market, moving towards an nZEB concept is extremely difficult. As the investment and generation costs of renewables become competitive with fossil fuels, and as technological evolution allows the development of more efficient energy sources, political agendas for energy savings could be achieved. Also, lower prices for primary fuels such as green hydrogen or biomass can displace traditional sources such as boilers or heat pumps powered by electricity. The results obtained in each scenario for the two antagonistic locations of Madrid and Milagro are consistent through the sensitivity analysis. Under this premise, under optimal climatic conditions and favorable policies, the actual implementation of building-integrated energy systems would be feasible.

4 Conclusions

A new optimization algorithm based on MIDCP applied to nZEB sizing has been proposed. The long-term analysis of the global cost function defined in the EN 15459 standard was considered. Different energy sources were characterized, with special interest in the H2 CHP source. Technical and economic assumptions were established considering baseline scenarios and harmonized price trends. CO2 emissions in upstream LCA (extraction and manufacturing) were converted to fixed costs. The power to be installed and the energy supply of the distributed generation mix were evaluated in two antagonistic scenarios. The risk management of renewable energy sources and their management through an electrochemical storage system was implemented.

The results obtained in the simulations suggest a high penetration of renewable sources such as PV and wind turbines in the distributed generation mix in the Madrid baseline scenario. Wind turbines under favorable conditions could cover up to 85 % of the energy demand in the distributed generation mix. PV can supply up to 7 % of total building demand. As long as the supply costs of renewable sources are competitive and their capacity factor high, their implementation in a tertiary building is sustainable. Technologies powered by green hydrogen in current scenarios are not sustainable, due to their high investment and supply costs. As supply costs decrease to the level of gray hydrogen and their investment costs to the level of common cogeneration technologies, their deployment and development will displace traditional technologies. Under these conditions, H2 CHP technology could cover up to 81 % of the building's thermal energy demand. In addition, its implementation is more efficient at sites with pronounced seasonality, which require both thermal and electrical energy supply.

Scenarios with weak renewable energy potential and electricity cost subventions are likely to maintain grid connection in response to the building's energy demand. This is where it is necessary to set a value for the cost of electricity that allows higher penetration of clean energy sources. In the case of Ecuador, greater competitiveness in PV prices suggests a greater penetration within the distributed generation mix, reaching up to 50 % coverage of the building's energy demand. Renewable technologies with low capacity factors could be replaced by fuel powered by biomass.

In most scenarios, the battery installation is linked to the energy supply of PV and wind turbine sources. For this reason, its implementation is sustainable as a means of energy management in the face of the intermittency of renewable energies. Under favorable conditions, battery energy management within the distributed generation mix reached 7 % and 9 % for the Madrid and Milagro scenarios, respectively.

The algorithm developed in this paper uses previously defined energy sources but also allows to easily add new sources and thus analyze their level of penetration within the energy mix of an nZEB. The tool uses a code developed in a free software and can be particularly useful for energy sizing in the design phase of a building in the tertiary sector. It can also be useful in the creation of policies that allow the definition of a specific concept of an nZEB, based on technical and economic variables evaluated in the long term. Decision makers will be able to evaluate different scenarios according to economic parameters, regulations and geographical conditions.

The developed MIDCP algorithm is based on specific input data collected from two distinct geographical locations with varying weather conditions and energy consumption patterns. Furthermore, the life cycle analysis of the systems and the economic parameters have been treated as deterministic. Although the sensitivity analysis performed provided results that reflect the evolution of investment and operating costs under different scenarios, the output values may exhibit potential deviations in certain conditions. Therefore, future research should aim to conduct a more comprehensive sensitivity analysis of the climate-related input variables and the techno-economic parameters of the energy systems to be integrated into the building.

Although MIDCP problems are limited to continuous functions since they must satisfy certain rules that guarantee their convexity, future works can employ relaxation techniques to linearize complex functions. In this way, they could be combined with metaheuristic models using an intelligent search methodology. Future research should also focus on developing a MIDCP-based multi-objective algorithm capable of optimizing both energy systems and the building envelope, thereby ensuring comprehensive sustainability in nearly Zero-Energy Buildings.

An interesting evaluation scenario for this tool would be the case of China, which is expected to reach its carbon peak between 2028 and 2040. Therefore, targets have been set for 2030, aiming for 30 % of new buildings to be nZEBs, 30 % of existing buildings to be retrofitted, and 30 % of buildings to be powered by renewable energy [2]. In this context, the proposed work could contribute to sustainable energy sizing of nZEBs, leading to the creation of policies focused on greater penetration of renewable energies. These policies would include strategies for subsidies for the initial investment in energy sources and improvements in energy/carbon trading.

Data availability

Data will be made available on request.

CRediT authorship contribution statement

Martín Muñoz-Salcedo: Writing – review & editing, Writing – original draft, Software, Resources, Project administration, Methodology, Investigation, Formal analysis, Data curation, Conceptualization. Manuel Ruiz de Adana: Writing – review & editing, Validation, Conceptualization. Fernando Peci-López: Writing – review & editing, Writing – original draft, Validation, Supervision, Methodology.

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.

Acknowledgments

Special gratitude goes to the 10.13039/501100015650 Carolina Foundation , the Universidad Estatal de Milagro and the Universidad de Córdoba, institutions that have co-funded the author's doctoral studies.
==== Refs
References

1 International Renewable Energy Agency (IRENA) World energy transitions outlook 2022: 1.5°C pathway. Abu dhabi [Online]. Available: https://irena.org/Digital-Report/World-Energy-Transitions-Outlook-2022%0A 2022 https://irena.org/publications/2021/March/World-Energy-Transitions-Outlook
2 Zhou Y. Worldwide carbon neutrality transition? Energy efficiency, renewable, carbon trading and advanced energy policies Energy Rev. 2 2 2023 10.1016/j.enrev.2023.100026
3 Zhou Y. Lifecycle battery carbon footprint analysis for battery sustainability with energy digitalization and artificial intelligence Appl. Energy 371 May 2024 10.1016/j.apenergy.2024.123665
4 Zhou L. Song A. Zhou Y. Electrification and hydrogenation on a PV-battery-hydrogen energy flexible community for carbon–neutral transformation with transient aging and collaboration operation Energy Convers. Manag. 300 July 2023 2024 10.1016/j.enconman.2023.117984
5 European Union Commision Delegated (EU) No 244/2012 of 16 January 2012, Supplementing Directive 2010/31/UE of the European Parliament and of the Council on the Energy Performance of Buildings by Establishing a Comparative Methodology Framework for Calculating Cost-Optim 2012 18 36 6
6 Coster E.J. Myrzik J.M.A. Kruimer B. Kling W.L. Integration issues of distributed generation in distribution grids Proc. IEEE 99 1 2011 28 39 10.1109/JPROC.2010.2052776
7 Zhou Y. Low-carbon transition in smart city with sustainable airport energy ecosystems and hydrogen-based renewable-grid-storage-flexibility Energy Rev. 1 1 2022 10.1016/j.enrev.2022.100001
8 Attia S. M H. W O. Carlucci S. Assessing gaps and needs for integrating building performance optimization in net zero energy buildings design Philosophique 60 19 2016 110 124 [Online]. Available: http://journals.openedition.org/philosophique/950
9 You X. Yan G. Thwin M. Applying modified coot optimization algorithm with artificial neural network meta-model for building energy performance optimization: a case study Heliyon 9 6 2023 e16593 10.1016/j.heliyon.2023.e16593
10 Del Pero C. Modelling of an integrated multi-energy system for A nearly zero energy smart district ICCEP 2019 - 7th Int. Conf. Clean Electr. Power Renew. Energy Resour. Impact 0 2019 246 252 10.1109/ICCEP.2019.8890129
11 Javanmard M.E. Ghaderi S.F. Sangari M.S. Economic and Environmental Analysis of nZEB model with smartification building using MILP Proc. - 2020 IEEE Int. Conf. Environ. Electr. Eng. 2020 vol. 2020 2020 IEEE Ind. Commer. Power Syst. Eur. EEEIC/I CPS Eur. 10.1109/EEEIC/ICPSEurope49358.2020.9160528
12 Javaid N. Demand side management in nearly zero energy buildings using heuristic optimizations Energies 10 8 2017 1 29 10.3390/en10081131
13 Kampelis N. HVAC optimization genetic algorithm for industrial near-zero-energy building demand response Energies 12 11 2019 1 23 10.3390/en12112177
14 Nagapurkar P. Smith J.D. Techno-economic optimization and environmental Life Cycle Assessment (LCA) of microgrids located in the US using genetic algorithm Energy Convers. Manag. 181 September 2018 2019 272 291 10.1016/j.enconman.2018.11.072
15 Gil-González W. Garces A. Montoya O.D. Hernández J.C. A mixed-integer convex model for the optimal placement and sizing of distributed generators in power distribution networks Appl. Sci. 11 2 2021 1 15 10.3390/app11020627
16 Yokoyama R. Shinano Y. Taniguchi S. Ohkura M. Wakui T. Optimization of energy supply systems by MILP branch and bound method in consideration of hierarchical relationship between design and operation Energy Convers. Manag. 92 April 2015 92 104 10.1016/j.enconman.2014.12.020
17 Grant M. Boyd S. Ye Y. Disciplined convex programming Glob. Optim. 2006 155 210 10.1007/0-387-30528-9_7
18 The DCP ruleset — CVX users' guide http://web.cvxr.com/cvx/doc/dcp.html#dcp
19 Introduction — CVX users' guide http://web.cvxr.com/cvx/doc/intro.html
20 Agrawal A. Amos B. Barratt S. Boyd S. Diamond S. Zico Kolter J. Differentiable Convex Optimization Layers 2019
21 Ringkjøb H.K. Haugan P.M. Solbrekke I.M. A review of modelling tools for energy and electricity systems with large shares of variable renewables Renew. Sustain. Energy Rev. 96 April 2017 2018 440 459 10.1016/j.rser.2018.08.002
22 Chen W. Ren H. Zhou W. Review of multi-objective optimization in long-term energy system models Glob. Energy Interconnect. 6 5 2023 645 660 10.1016/j.gloei.2023.10.010
23 Problem N.B.O. Hamdy M. Palonen M. Hasan A. Implementation of pareto-archive NSGA-II algorithms to a nearly-zero-energy building optimisation problem First Building Simulation and Optimization Conference 2012 181 188 September
24 Hamdy M. Hasan A. Siren K. A multi-stage optimization method for cost-optimal and nearly-zero-energy building solutions in line with the EPBD-recast 2010 Energy Build. 56 2013 189 203 10.1016/j.enbuild.2012.08.023
25 Yang P. Nehorai A. Joint optimization of hybrid energy storage and generation capacity with renewable energy IEEE Trans. Smart Grid 5 4 2014 1566 1574 10.1109/TSG.2014.2313724
26 Askarzadeh A. dos Santos Coelho L. A novel framework for optimization of a grid independent hybrid renewable energy system: a case study of Iran Sol. Energy 112 2015 383 396 10.1016/j.solener.2014.12.013
27 Mayer M.J. Szilágyi A. Gróf G. Environmental and economic multi-objective optimization of a household level hybrid renewable energy system by genetic algorithm Appl. Energy 269 January 2020 115058 10.1016/j.apenergy.2020.115058
28 Pinto E.S. Gronier T. Franquet E. Serra L.M. Opportunities and economic assessment for a third-party delivering electricity, heat and cold to residential buildings Energy 272 February 2023 10.1016/j.energy.2023.127019
29 Alhasnawi B.N. A novel economic dispatch in the stand-alone system using improved butterfly optimization algorithm Energy Strateg. Rev. 49 August 2023 10.1016/j.esr.2023.101135
30 Iturriaga Hidalgo E. Desarrollo de un método simple para la optimización del diseño de las instalaciones en edificios residenciales de consumo energético casi nulo en el País Vasco Univ. del País Vasco 2017 cc 2017 1 85
31 ASHRAE Methods of Testing and Determine the Thermal Performance of Solar Collectors 1986 Atlanta, GA, USA
32 JRC Photovoltaic Geographical Information System (PVGIS) - European Commission.” [Online]. Available: https://re.jrc.ec.europa.eu/pvg_tools/en/.
33 NREL NSRDB data viewer https://nsrdb.nrel.gov/data-viewer 2022
34 Muñoz-Salcedo M. Peci-López F. Táboas F. An empirical correction model for remote sensing data of global horizontal irradiance in high-cloudiness-index locations Rem. Sens. 14 21 2022 5496 10.3390/rs14215496
35 Fuentes M. Nofuentes G. Aguilera J. Talavera D.L. Castro M. Application and validation of algebraic methods to predict the behaviour of crystalline silicon PV modules in Mediterranean climates Sol. Energy 81 11 2007 1396 1408 10.1016/j.solener.2006.12.008
36 Santoso S. Le H.T. Fundamental time-domain wind turbine models for wind power studies Renew. Energy 32 14 2007 2436 2452 10.1016/j.renene.2006.12.008
37 Agharabi A. Darzi M. Optimal location of microturbines in low-rise building blocks for sustainable wind energy utilization (case study: qazvin city) J. Environ. Stud. 48 4 2023 461 479 10.22059/JES.2022.346825.1008346
38 Dodds P.E. Hydrogen and fuel cell technologies for heating: a review Int. J. Hydrogen Energy 40 5 2015 2065 2083 10.1016/j.ijhydene.2014.11.059
39 Sanjari M.J. Karami H. Optimal control strategy of battery-integrated energy system considering load demand uncertainty Energy 210 2020 10.1016/j.energy.2020.118525
40 ATECYR Guía técnica de procedimientos y aspectos de simulación de instalaciones térmicas en edificios 2008 Madrid-España
41 IRNEA Renewable power generation costs in 2021 [Online]. Available: https://www.irena.org/-/media/Files/IRENA/Agency/Publication/2018/Jan/IRENA_2017_Power_Costs_2018.pdf 2022
42 The Boston Consulting Gro Evolución Tecnológica y Prospectiva de Costes de las Energías Renovables. Estudio Técnico PER 2011-2020 2011 Madrid-España
43 Naumann G. Schropp E. Gaderer M. Life cycle assessment of an air-source heat pump and a condensing gas boiler using an attributional and a consequential approach Procedia CIRP 105 2022 351 356 10.1016/j.procir.2022.02.058
44 Nicholson S. Heath G. Life cycle emissions factors for electricity generation technologies [Online]. Available: https://data.nrel.gov/submissions/171 2021
45 Precios CO2 - Sendeco2.” https://www.sendeco2.com/es/precios-co2 (accessed January 15, 2023).
46 Ministry of Industry CO2 emission factors and step coefficients to primary energy from different final energy sources consumed in the building sector in Spain (in Spanish) [Online]. Available: http://www.minetad.gob.es/energia/desarrollo/EficienciaEnergetica/RITE/Reconocidos/Reconocidos/Otros 2016 documentos/Factores_emision_CO2.pdf
47 A. U. Metering, PowerLogic TM ION8650 Series Technical Datasheet. pp. 1–11.
48 CEN EN 15459: Energy Performance of Buildings-Economic Evaluation Procedure for Energy Systems in Buildings 2007 48 Brussels
49 BPIE Cost Optimality - Discussing Methology and Challenges within the Recast EPBD 2010 40
50 Sanjari M.J. Karami H. Analytical approach to online optimal control strategy of energy storage devices in energy system J. Energy Storage 29 September 2019 2020 10.1016/j.est.2020.101328
51 Fu A. Narasimhan B. Boyd S. CVXR: an R package for disciplined convex optimization J. Stat. Softw. 94 14 2020 1 34 10.18637/JSS.V094.I14
52 Disciplined Convex Optimization • CVXR.” https://www.cvxgrp.org/CVXR/(accessed February. 4, 2023).
53 Ashfaq A. Ianakiev A. Cost-minimised design of a highly renewable heating network for fossil-free future Energy 152 2018 613 626 10.1016/j.energy.2018.03.155
54 Imdahl C. Blume C. Blume S. Zellmer S. Gensicke M. Herrmann C. Potentials of hydrogen technologies for sustainable factory systems Procedia CIRP 98 2021 583 588 10.1016/j.procir.2021.01.158
55 Rodríguez X.A. Regueiro R.M. Doldán X.R. Analysis of productivity in the Spanish wind industry Renew. Sustain. Energy Rev. 118 November 2019 2020 10.1016/j.rser.2019.109573
56 MEER “Atlas Eólico del Ecuador Con Fines de Generación Eléctrica,” Quito, Ecuador [Online]. Available: https://es.scribd.com/document/355204005/ATLAS-EOLICO-ECUADOR-MEER-2013-pdf 2013
57 Abbes D. Martinez A. Champenois G. Life cycle cost, embodied energy and loss of power supply probability for the optimal design of hybrid power systems Math. Comput. Simul. 98 2014 46 62 10.1016/j.matcom.2013.05.004
