DOI: 10.3303/CET2188107 Paper Received: 2 May 2021; Revised: 16 July 2021; Accepted: 8 October 2021 Please cite this article as: Éles A., Heckl I., Cabezas H., 2021, Modeling Renewable Energy Systems in Rural Areas with Flexible Operating Units, Chemical Engineering Transactions, 88, 643-648 DOI:10.3303/CET2188107 CHEMICAL ENGINEERING TRANSACTIONS VOL. 88, 2021 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš Copyright © 2021, AIDIC Servizi S.r.l. ISBN 978-88-95608-86-0; ISSN 2283-9216 Modeling Renewable Energy Systems in Rural Areas with Flexible Operating Units András Élesa,*, István Heckla, Heriberto Cabezasb a Department of Computer Science and Systems Technology, University of Pannonia, Veszprém, Hungary b Research Institute of Applied Earth Sciences, University of Miskolc, Miskolc, Hungary eles@dcs.uni-pannon.hu Designing energy systems becomes more and more important as distributed and renewable energy production gains attention. As distributed systems have quite different challenges than centralized ones, novel solution methods are in demand and have been proposed. Sustainability is an ever increasingly important factor for decision makers. The aim is to utilize renewable energy sources like wood, grass, manure, etc., while keeping in mind that their transportation for long distances is impractical. Revitalization of local and regional economy is also a priority. Previous work applied the P-Graph methodology to design an energy system based on biomass in a rural region. A more recent extension of the P-Graph framework is the utilization of operating units with flexible input materials, which makes more accurate equipment models possible. This flexibility is important because certain operating units can tolerate some change in the ratio of their input materials and others cannot. In this work, a method is proposed to design an energy system in a rural area. The notion of flexible operating units is applied to a case study, giving us the possibility to identify optimal composition of biomass feeds and plant size. Our model includes the collection and transportation of local renewable resources, fermenters and combined heat and power (CHP) plants, in order to optimize profit from generated heat and electricity. The case study shows that this modeling technique results in 31% more profit with a considerably lower computational effort. 1. Introduction Sustainability plays an increasing role in decision making, as more and more people recognize that the depletion of natural resources can cause serious problems. A common direction toward sustainability is to satisfy demands for goods, energy and services locally. This can not only improve cost-efficiency by reducing transportation needs, but also supports an economically and environmentally friendly attitude. Different types of biomass can be used to produce biofuel or to meet heating and electricity demands. For example, it is possible to produce biogas with the use of fermenters, then feed it to local furnaces or CHP plants. On the other hand, such projects would require vast investments with long payoff times, therefore the legal background and incentives play an important role. Energy is also in competition with food in terms of arable land, which further makes decision making nontrivial, needing computational support. Optimization of supply chains is conventionally done intuitively, but systematic optimization methods can reveal better system designs with reduced costs and/or increased profits. But the high complexity of these systems makes optimization tools crucial. One option for optimization is the usage of mathematical programming models. These require expertise to formulate, but in general a wide range of system elements can be adequately modeled. Mixed-Integer Linear Programming (MILP) models are a common choice, and have been used to design supply chains and other systems (Sharma et al., 2013). Another possibility is the usage of combinatorial tools. One example for such a tool is the P-Graph framework, which is used to formulate and solve Process Network Synthesis (PNS) problems optimally (Friedler et al., 1992). There is a wide range of problems the P-Graph framework is suitable for (Klemeš and Varbanov, 2015). Some authors proposed a combination of P-Graph and MILP-based tools to design a biomass supply chain (How et al., 2016). 643 Recent work proposed methods for assessing the specific modeling issue of flexible input ratios for operating units in P-Graphs. This is a key novelty, because operating units in a traditional P-Graph have fixed consumption ratios. For that reason, modeling units with flexible ratios require a sophisticated procedure. Initially, modeling of operating units with flexible inputs was performed by supporting the model with mathematical programming tools (Szlama et al., 2016). More recently, a modeling technique was proposed for this problem within the P- Graph framework itself, which also made the representation of arbitrary linear constraints possible (Éles et al., 2020). This is important as the biomass supply is inherently flexible, and the PNS problem has already been modeled and optimized (Niemetz et al., 2012), using a set of fixed input compositions. Our goal was to investigate whether the notion of flexible inputs from the P-Graph framework can be used to improve models originally designed with fixed input compositions. As a solution, MILP models were formulated for convenience and testing reasons, although utilizing the recent results on P-Graphs, an equivalent PNS problem could also be formulated. 2. Methodology This work is based on the case study performed by Niemetz et al. (2012), which involves the optimization of biomass-based heat and electricity generation in a small rural area. Our work can be summarized as follows.  Reproduction of the original PNS model from the case study as a MILP model.  Substitution of model data that depend on biomass composition with linear estimations.  Creation of a new MILP model by changing traditional operating units to flexible ones, where inputs are based on the obtained parameter estimations. This model is the main novelty of our work. 2.1 Biomass supply chain model The original case study involves several individual suppliers spatially distributed in a small area. From these suppliers, four types of biomass (manure, intercrops, energy grass and silage corn) can be transported to three possible processing locations (L1 to L3) for fermentation. Transportation costs depend on distance and transported amounts. On the processing locations, multiple fermenters and CHP plants can be built, in fixed sizes. CHP plant sizes are 80 kW, 160 kW, 250 kW, 500 kW, which denote electrical output for the full 7800 load hours in a single year. For each CHP plant size, there is a corresponding fermenter size to choose, which is capable of supplying just enough biogas to the corresponding CHP plant, represented by CH4 content in the model. For example, an 80 kW fermenter with full load can feed an 80 kW CHP exactly, although any combination of fermenters and CHP plants are allowed. Moreover, these are not required to work for the maximal possible 7800 hours. One key property of the model is that there are 8 a priori determined compositions of fresh matter for the four types of raw materials (see Table 1). Overall, 32 fermenter types were regarded (all 8 compositions, in all 4 possible sizes). Heating demand and investment cost of the fermenter is calculated for each composition and size individually. Other parameters like operating costs and CHP plant data do not depend on the input composition of the fermenter. Table 1: Fixed input material compositions for fermenters, in percent Raw material Available Mix1 Mix2 Mix3 Mix4 Mix5 Mix6 Mix7 Mix8 Manure 15,501 m3 30 30 50 50 75 75 75 100 Intercrops 5,300 t 70 50 20 25 15 Grass 2,820 t 10 10 Corn 2,418 t 70 20 25 Fermenter heating can be provided by a CHP plant on the same location, or a local wood chip furnace. Heat and biogas from the processing locations can be transported to a central municipality through their own pipes, where heat is directly used, and biogas can be fed into central CHP plants. The system is depicted in Figure 1. Optimization should decide the type and number of fermenters and CHP plants to build at each place, taking into consideration supporting equipment like pipes, silos, transformers, and from which source and in what composition the fermenters should be fed by the four types of biomass. Yearly profit is maximized assuming a 15 years long payoff period for the investments. 644 Figure 1: Structure of the biomass-based system to be optimized The original case study proposed a PNS based solution method. In this work, a MILP model was formulated instead because of the convenience of modeling special constraints, although PNS would also be an option. 2.2 Linear estimation of fermenter data based on feed composition In order to make flexible inputs possible for fermenters, heating requirements and investment costs are needed to be expressed in terms of the composition of input materials, for each size. There are many other parameters for both fermenters and CHP plants, but these do not depend on input composition. The exact method of calculation of the original data was unavailable, therefore a multiple linear regression was performed based on the data for the 8 fixed input compositions. The independent variables are introduced for each material type as follows. Regression was performed in 5 scenarios in total (see Table 2). Heating is almost perfectly linear to plant size. For this reason, a single scenario was used based on data for the 80 kW fermenter, and then heating requirement for any of the four sizes are obtained by a multiplication with fermenter size. Specifically, a weighted sum of the independent variables by fresh matter amounts, times fermenter size results the heating requirement. Investment costs on the other hand are not so close to linear, therefore the regression for investment costs was performed for each of the four sizes independently. A weighted sum of the independent variables by fresh matter amounts (assuming full load) results in the investment cost of the fermenter. Table 2: Coefficients for fermenter parameters obtained from regression – units are determined by the intended calculation formula for heating requirement and investment cost Raw material Heating requirement (MW / FM unit × kW) Investment cost (€ / FM unit) 80 kW 160 kW 250 kW 500 kW Manure 0.041157306 59.2935312 55.9482542 47.6665275 47.1898419 Intercrops 0.035344135 187.1176501 152.0278047 122.0870749 103.1706932 Grass 0.015781997 246.8401822 196.9822356 153.4781289 88.5872099 Corn 0.041589403 267.4696723 210.5407610 178.7759041 134.8730663 Constant terms were not required in either case. Heating requirement is scaled by load and is purely proportional to amounts fed. Investment costs disregard load, those actually depend on size and the feed ratios, the sum of the latter is always one. 2.3 Modeling flexible inputs In the third step, a new MILP model was developed to allow flexible input materials for the fermenters. The method is motivated by the P-Graph model for flexible inputs (see Figure 2), the advantage of which is twofold.  Equipment capacity can be arbitrarily distributed among different raw materials.  Further linear constraints on the input can be specified in the P-Graph framework. Application of this technique is more natural in the case of MILP models which are used in the present work, but as recent results show, flexible inputs can be modeled within the tools of the P-Graph framework as well.  In the original formulation, integer variable 𝑢𝑘,𝑚,𝑙 𝑓𝑒𝑟𝑚 denoted how many fermenters of size 𝑘 and input composition 𝑚 should be built at processing location 𝑙. An upper bound for 𝑢𝑘,𝑚,𝑙 𝑓𝑒𝑟𝑚 was 3, allowing at most three fermenters of the same kind, although this limit could be arbitrarily chosen. 645  In the new formulation, a binary variable 𝑣𝑘,𝑖,𝑙 𝑓𝑒𝑟𝑚 is used, where 𝑘 denotes fermenter size and 𝑙 denotes processing location as before, but 𝑖 is an index introduced for distinct fermenters of the same size, at the same place. The index 𝑖 had two possible values, allowing two distinct fermenters. This could be adjusted but turned out to be sufficient. Note that this technique, per size and location, uses 2 flexible fermenters instead of 8 fermenters with fixed input compositions. Figure 2: Schematic P-Graph representation of a Fermenter with flexible inputs – the arbitrarily distributable capacity is modeled by the blue parts, and a linear constraint for inputs is modeled by the red parts In the modified model, for each fermenter and raw material 𝑡 a single variable 𝑤𝑘,𝑖,𝑙,𝑡 𝑖𝑛 denotes the amount of material 𝑡 fed into a particular fermenter, expressed in fresh matter amounts. As the inputs are flexible, the ratios of these inputs are not fixed, therefore each 𝑤𝑘,𝑖,𝑙,𝑡 𝑖𝑛 can be chosen by the model independently. The heating requirement and investment cost are the two parameters depending on these ratios, and are calculated from the coefficients obtained from the regression in the following manner. Heating requirement is provided for a fermenter with full load. However, this is scaled down to actual load hours over the year. As a result, the heating requirement for each fermenter is simply proportional to the inputs, as shown in Eq(1), where 𝐶𝑘,𝑡 ℎ𝑒𝑎𝑡,𝑟𝑒𝑞 is the coefficient from the linear estimation, and ℎ𝑘,𝑖,𝑙 𝑟𝑒𝑞 is the total heating requirement for the fermenter. ℎ𝑘,𝑖,𝑙 𝑟𝑒𝑞 = ∑ 𝑤𝑘,𝑖,𝑙,𝑡 𝑖𝑛 𝑡 ⋅ 𝐶𝑘,𝑡 ℎ𝑒𝑎𝑡,𝑟𝑒𝑞 ∀ 𝑘, 𝑖, 𝑙 (1) Investment costs are more problematic, because these are not scaled down even if the fermenter does not work at full capacity. Because of economies of scale, scaling down would result in unacceptable inaccuracy, as investing into a half-used 160 kW fermenter would be better than a fully utilized 80 kW one. Exact investment cost calculations would be nonlinear. For this reason, a penalty is applied to the investment costs which estimates the actual costs from above in the following way. Investment costs are calculated proportionally based on the actual input material amounts. If the fermenter has remaining capacity, which is measured in missing CH4 production, then that production is assumed to be satisfied with the most expensive material available when calculating the investment costs. Note that this refers to investment costs per CH4 produced rather than investment costs per fresh matter, therefore the most expensive material is not necessarily the one with the highest coefficient in the corresponding column of Table 2. It is actually manure, due to its low dry matter content. 𝑐𝑘,𝑖,𝑙 𝑓𝑒𝑟𝑚,𝑖𝑛𝑣 = 𝑤𝑘,𝑖,𝑙 𝑠𝑙𝑎𝑐𝑘 ⋅ 𝐶𝑘,Manure 𝑖𝑛𝑣 + ∑ 𝑤𝑘,𝑖,𝑙,𝑡 𝑖𝑛 𝑡 ⋅ 𝐶𝑘,𝑡 𝑖𝑛𝑣 ∀ 𝑘, 𝑖, 𝑙 (2) 𝑀𝑘 𝑓𝑒𝑟𝑚,𝐶𝐻4 ⋅ 𝑣𝑘,𝑖,𝑙 𝑓𝑒𝑟𝑚 = 𝑤𝑘,𝑖,𝑙 𝑠𝑙𝑎𝑐𝑘 ⋅ 𝜆Manure 𝐶𝐻4 + ∑ 𝑤𝑘,𝑖,𝑙,𝑡 𝑖𝑛 𝑡 ⋅ 𝜆𝑡 𝐶𝐻4 ∀ 𝑘, 𝑖, 𝑙 (3) These rules are shown in Eq(2-3), where the calculated investment cost is 𝑐𝑘,𝑖,𝑙 𝑓𝑒𝑟𝑚,𝑖𝑛𝑣, 𝐶𝑘,𝑡 𝑖𝑛𝑣 is the coefficient obtained from the linear estimation, 𝑤𝑘,𝑖,𝑙 𝑠𝑙𝑎𝑐𝑘 is the amount of manure which would be needed to fill the capacity denoted by 𝑀𝑘 𝑓𝑒𝑟𝑚,𝐶𝐻4, and 𝜆𝑡 𝐶𝐻4 is a conversion coefficient from fresh matter to CH4 content. Note that plant sizes 𝑘 to choose from can be 80 kW, 160 kW, 250 kW or 500 kW, these remained fixed for both fermenters and CHP plants, for two main reasons. First, economies of scale in terms of investment costs are apparent from both original and estimated data, making linearization attempts inaccurate. Second, regulations 646 support smaller plant sizes through feed-in tariffs. Particularly, a 500 kW CHP plant would receive only 185 €/MWh for electricity, while smaller sizes receive 205 €/MWh. Finally, due to a regulation, the ratio of manure was required to be at least 30 % in fermenters. This is apparent from the original fixed compositions, and is implemented in the flexible model as an additional constraint. The P-Graph framework also makes this option possible. 3. Results and discussion Each of the three MILP models was implemented in GNU MathProg, and solved by GLPSOL v4.65 on a ThinkCentre M83 desktop PC with i7-4770 CPU and 16 GB RAM under Ubuntu 18.04.5 LTS. Model and data files for our case study can be downloaded from our site (Éles et al., 2021). 3.1 First MILP model: original case study The goal in the implementation of the first MILP model was to reproduce the results of the original case study for which the tools of PNS were used. The obtained optimal solution can be described as follows.  One 160 kW and one 250 kW CHP plant is built in the central area, and one 80 kW plant at L1, all working at full capacity.  Two 250 kW fermenters are built at L1, both working at roughly 96 % capacity. A biogas pipe is installed from this location to the centre.  Revenue is 783,510 €/y from electricity, and 93,015 €/y from heating. Operating costs throughout the whole system are 460,928 €/y. Total of investment costs is 2,715,790 €, for which a payoff period of 15 years is assumed. Overall, the optimal profit is 234,544 €/y.  100 % of manure, 75 % of intercrops, 84 % of energy grass and 74% of the total available corn is used. 5 of the 8 supplier sites contribute with their full availability, and some provide only a part. Of course, this could be balanced on demand in exchange for additional transportation costs. This solution coincides with the findings of the original case study in terms of the core decisions, and only minor discrepancies are observed in the exact quantities. Most of these could be attributed to numerical errors. 3.2 Second MILP model: non-flexible inputs with linear estimations In the second model, only the data for the fermenters were changed. The linear estimations were performed based on the heating requirement and investment costs of the 8 fixed fermenter compositions, then these were recalculated and substituted into the model. The development of this second model as an intermediate step was necessary to provide a fair basis for evaluating the effect of the third model with flexibility. The difference between the original data and their linear estimations varied between -7.8 % and +6.5 % from the original values. The obtained second solution was directly compared to the first one to test the accuracy of the estimations. The resulting solution consists of exactly the same decisions. The same facilities are built, and exactly the same amounts of goods are transported and produced. Only the costs and the resulting objective is somewhat different, which was expected due to the slightly changed parameters (see Table 3). Model complexity is also the same. Table 3: Comparison of the models using original data and linear estimations Composition-specific data Fermenter heating Total investment costs Objective Original 70.36 MW 2,715,790 € 234,544 €/y Estimation 71.81 MW 2,737,360 € 233,033 €/y 3.3 Allowing flexible inputs The novel MILP model was implemented with flexible inputs, and it was then solved provided with the data obtained from the linear estimations. This resulted in a substantially different solution with better objective value, summarized in Table 4. The main difference is that when operating units with flexible inputs are allowed, one large 500 kW fermenter is sufficient instead of two smaller 250 kW at L1 with fixed compositions. This also results in a better utilization of all available biomass in the region. There is 80 kW more throughput in case of flexible fermenters, resulting in a slightly larger investment cost, but 31 % more profit in the end. The 80 kW CHP plant at L1 is used for part of the fermenter heating in both cases. Note that one 500 kW CHP plant instead of two 250 kW plants would not be advantageous despite the economies of scale, because of the lower feed-in tariff for larger CHP plants at the time of the study. 647 Table 4: Comparison of the models with non-flexible and flexible inputs for fermenters Non-flexible units (original model) Flexible units (new model) Core decisions two 250 kW fermenters at L1, an 80 kW CHP plant at L1, a 160 kW and a 250 kW CHP plant at the centre an 80 kW and a 500 kW fermenter, and an 80 kW CHP plant at L1, two 250 kW CHP plants at the center, everything at full capacity Revenues from electricity: 783,510 € from heat: 93,015 € from electricity: 927,420 € from heat: 105,300 € Investment costs 2,737,360 € 2,770,220 € Profit 233,033 € 306,711 € Raw material usage 100 % manure, 75 % intercrops, 84 % grass, 74 % corn 100 % manure, intercrops and grass, 90 % corn Model size 661 columns, 128 integer variables, 16 of which are binary, solved in 3.9 s 301 columns, 56 integer variables, 40 of which are binary, solved in 0.5 s 4. Conclusions MILP models were developed based on data from a real-world case study involving multiple biomass feed types, fermenter and CHP units in different available sizes. The main difference between the two models was whether compositions of fermenter inputs are chosen from a fixed set, or can be flexibly chosen by the optimization procedure. Our computational results show that the model with flexible inputs outperforms the fixed case in terms of the objective (+31 % total profit), resource utilization and also in terms of computational complexity (less constraints, continuous and integer variables, -87 % runtime). This suggests that performing the optimization procedure with flexible inputs and designing the fermenters according to the obtained compositions might be more prosperous than determining a set of fixed compositions and then letting the optimization procedure utilize them. Note that these solutions are based on estimations which should be precise enough, and must be validated. This modeling technique is designed to be applicable in purely P-Graph based approaches directly, which is planned in the future. Acknowledgements We acknowledge the financial support of Széchenyi 2020 under the EFOP-3.6.1-16-2016-00015. This research was supported from the Thematic Excellence Program 2019 the grant of the Hungarian Ministry for Innovation and Technology. (Grant Number: NKFIH-843-10/2019) The research contribution by H. Cabezas was carried out in the GINOP-2.3.2-15-2016-00010 framework “Development of enhanced engineering methods with the aim at utilization of subterranean energy resources” project at the Research Institute of Applied Earth Sciences of the University of Miskolc, the Széchenyi 2020 Plan, partially funded by the European Union, cofinanced by the European Structural and Investment Funds. References Éles A., Heckl I., Cabezas H., 2020, Modeling technique in the P-Graph framework for operating units with flexible input ratios, Central European Journal of Operations Research, 29, 463–489. Éles A., Heckl I., Cabezas H., 2021, P-Graph and MILP, flexible inputs, Bad Zell biomass supply chain case study (2021), model and data files, accessed 28.06.2021. Friedler F., Tarjan K., Huang Y.W., Fan L.T., 1992, Graph-Theoretic Approach to Process Synthesis: Axioms and Theorems, Chemical Engineering Science, 47, 1973–1988. How B.S., Hong B.H., Lam H.L., Friedler F., 2016, Synthesis of multiple biomass corridor via decomposition approach: a P-Graph application, Journal of Cleaner Production, 130, 45–57. Klemeš J.J., Varbanov P., 2015, Spreading the message: P-Graph enhancements: implementations and applications, Chemical Engineering Transactions, 45, 1333–1338. Niemetz N., Kettl K.H., Szerencsits M., Narodoslawsky M., 2012, Economic and Ecological Potential Assessment for Biogas Production Based on Intercrops, Chapter In: Sunil Kumar (Ed.), Biogas, IntechOpen Limited, London, UK, 173–190. Sharma B., Ingalls R.G., Jones C.L., Khanchi A., 2013, Biomass supply chain design and analysis: Basis, overview, modeling, challenges, and future, Renewable and Sustainable Energy Reviews, 24, 608–627. Szlama A., Heckl I., Cabezas H., 2016, Optimal design of renewable energy systems with flexible inputs and outputs using the P-Graph framework, AIChE Journal, 62, 1143–1153. 648