Design of profitable networks of biogas plants in Chile

Locations for profitable biogas plant networks for the generation of electric power were investigated. A population-based location algorithm was developed. Using information regarding biogas power and plants cost found in the literature, together with data on the location and number of dairy cows of 572 farms in southern Chile, economic analises were made. Each farm was evaluated as a potencial location for a biogas plant, both alone and as part of different combinations. The algorithm starts with a population of one-plant combinations and generates new iterations by inserting additional biogas plants as long as the NPV increases. In each iteration, only a diverse subset of the combinations is selected. This approach is compared to the application of the ArcGIS Network Analyst (NA) function for the set cover problem, usually employed in the literature for biogas plant network location problems. Using the technical parameters for the operation of biogas plants found in the literature, we show that the proposed algorithm gives better results than the NA algorithm in terms of profit. Biogas plant networks were obtained for different scenarios of biomass availability (40–80%), energy sale prices (90–100 USD/MWh) and transport costs (0.3–0.4 USD/tkm). The results indicate that 18 of the 572 farms would be good candidates to site a biogas plant in at least one of the scenarios. A maximum of eight farms appear in a scenario with 80% of biomass availability and a transport cost of 0.3 USD/tkm. This solution reaches a NPV of USD 3,538,394, which exceeds by more than 70% the USD 2,075,057 obtained with the solution retrieved by the NA function. As the algorithm presented obtained better results than the ArcGIS network analyst, it can be used as an appropriate design tool for biogas plant networks.


Introduction
Livestock production is a source of Greenhouse Gases (GHG). Emissions from this source will increase over the next 40 years as a result of increased food production [1]. Between 2005 and 2015, global milk production grew by 30% generating an 18% increase in GHG emissions from the dairy sector associated with an 11% increase in the dairy herd [2]. When not treated, animal manure becomes a major source of air and water pollution, nutrient leaching, and pathogens [3]. Animal manure purines have the greatest impact on the environment [4]. Air pollutants include odours, methane, nitrous oxide and ammonia emissions [5]. One well-known alternative is to produce biogas from the manure and slurry of dairy cows, which produces cheap energy and helps to decrease GHG emissions [2].
In this context, it is necessary to develop new technologies, as well as new ways to implement existing ones costeffectively [1]. One option is to obtain biogas for electricity production. This process causes a significantly lower environmental impact than do conventional energy sources, contributing to the objectives of supply security and environmental sustainability. The magnitude of this contribution and the economic viability of its implementation depend on the particularities of each country. The exploitable potential of renewable resources, and their allocation by geographic information systems, reveals that the reality and characteristics of energy markets vary locally [6]. However, only one percent of the world's manure production has been used for biogas generation [7].
Several countries, including Chile, have pursued the strategic incorporation of renewable energies in their power grid [8]. Following this line, installing biogas plants is a reasonable alternative as this technology mitigates environmental effects [9]. Moreover, the generation of electricity from biomass waste is a viable option that presents significant economic advantages in relation to the direct use of biogas [10]. Nevertheless, there are conditions that make it difficult to set up biogas plants; one of these is the lack of specifications for the transportation of substrates since the sources are generally dispersed, which limits the economies of scale and the sale of energy [11]. The absence of a distribution network in the case of biogas for use in household heating is another point to consider.
The anaerobic digestion of biomass is a complex, dynamic, and highly nonlinear process, on which hundreds of microbial populations intervene [12]. Process simulators like SIMBA#Biogas [13] and others mentioned in [14], which use mathematical models that make continuous predictions in time, have allowed to improve the understanding of this process and can be used to improve the performance of digesters [15].
While these tools are suitable for improving the efficiency of one digester in a particular scenario, to evaluate the economic efficiency of networks of biogas plants, it is necessary a methodology that, even if not as precise, allows to consider the different levels of substrate availability and transport cost (which increases with the distances) of the multiple candidate locations of the plants that can comprise the network, and the possible ways on which the available substrate must be assigned to each one of them, identifying the economies of scale.
Location models provide a criterion for choosing where to install facilities considering the location and demand of clients-in this case manure supplying farms-that have to be reached. According to [16], these can be divided into four great categories: analytic models, continuous models, network models and discrete location models, which assume that there is a discreet set of demands I, and a discrete set of candidate locations J. The problems related to these models often consist on minimizing the total weighed distance between the nodes of demand in set I and the facilities in set J. Normally, the demands are assigned to the nearest facility, as long as there is no consideration of the capacities, economies of scale or restrictions of costs, which may make more convenient to assign demands to more distant facilities [17].
Although many authors emphasize in the financial considerations of biogas plant operations, these are seldom included in the evaluation function to be optimized. Location-allocation models in the renewable energy literature tend to focus on the spatial distribution of demand [18]. In particular, functions of location allocation provided in programs like the ArcGIS Network Analyst of ESRI, try to find optimal locations for multiple facilities on a geographic area to decrease the weighed sum of the transport costs or in the travel distances between the demand points and their closest open facility [19] or, alternatively, find the minimum number of facilities required to cover all demands, given a maximum coverage radius.
Among the works developed that use this methodology are [20] who analysed the spatial distribution and amount of potential biomass for biomethane production to find the optimal location, size and number of biogas plants in southern Finland. The study concluded that the number of plants was 49, and its methodology used a radius of up to 40 km. [21] considered the location of centralized biogas plants in 139 municipalities of the Japanese island of Hokkaido, evaluating the production cost of electricity from cow manure, and concluded that its development was not possible given the cost of purchase of this type of energy in that country. He obtained the locations of the centralized biogas plants, also using ArcGIS Network Analyst's, for minimizing the number of facilities considering a coverage radius of 10 km. [22] proposed a mixed-integer mathematical model to find the optimal location of raw material collection centres and biomethane gas plants; Franco [23] proposed a combined Analytical Hierarchy Process and Fuzzy Weighted Overlap Dominance methodology to identify the most suitable sites for building biogas plants; Bojensen [24] combines a location assignment model with a production-restricted spatial interaction model that addresses the dual problem of determining optimal location and production capacity; Velázquez-Martí [25] presented an algorithm that identifies possible points where a bioenergy plant can be located with a minimum logistic cost of supplying consumers, finding an optimal location around the points using linear programming techniques.
In Chile, according to research in the dairy sector by [26,27], cattle effluents are used as nutrient sources through direct application to grasslands and/or supplementary crops, and just a small part of such effluents is used as base substrate for biogas generation. Given the rainfall conditions of Chile's south, almost half the volume of the slurry generated in the dairy farms is due to the use of washing water and the contribution of rainwater. Besides, the farms work mainly under a grazing system, with a low degree of animal confinement, which usually takes place when milking the cows, and before or after this activity, in a feeding yard; therefore, a high percentage of the generated slurry is retained in the prairie.
In the south of Chile, they have used three types of digesters for the anaerobic digestion of dairy manure [28]: covered lagoon, piston flow, and complete mixing. A covered lagoon refers to tanks with an airtight cover installed to capture biogas. This design is often used for solid contents under 2% and operates at room temperature. Those of flow piston are nonmixed systems in which the waste flows semicontinuously, like a piston through a horizontal reactor that usually handles 10-14% of solid contents and operates at mesophilic temperatures. HRT hydraulic retention times range from 20 to 30 days. Finally, the full mix digesters, also called continuous stirred tank reactors (CSTR), are mixed systems in which the content of the digester is mixed by means of mechanical stirring, effluent recirculation, or biogas recirculation, and operate at mesophilic temperatures. The TRH range from 20 to 25 days [29]. It is the latter that we have considered for our research.
The total GHG emissions of the country were equivalent to 109,909 Gg of CO2 in 2013. The agriculture and livestock sector accounted for 12.5% (13,735 Gg CO2eq) of these emissions, corresponding mainly to 59.2% nitrous oxide (N2O) and 40.8% methane (CH4) [30].
In the Chilean regions of Los Ríos and Los Lagos, 53 dairy farms have been evaluated at the pre-feasibility level, for the development of larger biogas projects [28], with powers of up to 100 kW in farms having between 90 and 1000 cows. The results of these studies have not been positive, as in Chile there are no incentives associated to the abatement of GHG. Also, at the farm level there is a shortage of trained human resources; there have been problems in the design, construction and operation of biodigesters; and data from dairy production systems are not available to technology providers [28]. So, it is important to study and promote associative business [31]. This confirms what was stated by [10] who recommends considering the option of the centralized use of manure as substrate. Small farms are not encouraged to develop their own plants [32].
While Chile does not have specific promotion instruments for biogas plants, it has a complex incentive policy for renewable energies. For power plants below 9 MW connected to the distribution grid, like the ones analysed in this work, applies the PMGD scheme. This scheme allows plants operators to self-dispatch and access to a stabilized price in the electric market [33].
Considering the geographic and economic conditions of Chile, and the little availability and quality of the slurry, it is necessary a model that goes beyond the limitations of the models provided in geographic information systems. The model should allow to discard isolated farms when it is not profitable to add them to the network and capture the VPN accurately. Having in mind the low profit margin that is expected under these conditions complex factors, like the efficiency of the generators which increases with the amount of biomass, should be included. As the size of the plant increases the investment costs per kW of capacity decrease [34], therefore, clients should not necessary be assigned to the nearest open facility.
The aim of our work to determine the actual economic viability of a network of biogas plants in southern Chile. For this purpose, a model that considers the details previously indicated was developed, along with an algorithm suitable for finding efficient sets of locations with this model.

Proposed location algorithm
We developed an algorithm for the financially efficient location of a network of biogas plants, evaluating the plant-farm NPV in the different plant configurations, according to the following optimization model.

Optimization model
Let the set I = {1..N} give the potential biogas plant locations, and let set J = {1..M} be the farms potentially supplying the network. Let: Sets J and I are assumed to be equal, as each farm is considered a potential location for a plant. d i j corresponds to the Euclidean distance between the two points.
Configuration c, is a set of farm indices P ⊂ J that supply an enabled biogas plant p * ∈ I. p * is called plant farm in this configuration.
Collision occurs when two configurations a and b include the same farm.
Combination a combination C is a set of configurations. A combination is valid if there are not collisions between their configurations, as shown in Figure 1.
Profit function the profit of a given combination. In this case, the NPV is used according to [35]. Although it only depends on constant factors, cowmeters(c) , and cows(c) , w j = livestock units on farm j. d ij = distance between potential plant i and farm j. this dependency is nonlinear as the reactor efficiency increases with the amount of biomass [36]. This nonlinearity implies that the assumption that it is optimal to assign each farm to the nearest plant does not always hold.
Total profit function The sum of the profits of the configurations that lead to the maximization of a combination. This is equivalent to the minimum number of kilometres required to move the coordinates of the plant farm in the configurations of one combination to obtain the coordinates of the plant farms of the other combination. This relation is symmetric and is completely geographic.
To calculate this amount, an assignment problem must be solved which consists in finding for each plant farm in this first combination, a match in the second combination, so that the sum of the distances between each pair of corresponding plant farms is the smallest possible. The Hungarian Method was used for this purpose [38].

Computing the NPV of a given configuration
For a configuration c=(P, i) , the total number of livestock units reached is given by: The sum of the distance travelled to connect each livestock unit to the network is: In summary, the resulting problem is: where C is the set of all possible combinations:

Proposed search algorithm
We propose a search heuristic to find the best combination C for the model described. Below we define the initialization process, generation of new solutions and stopping criteria for the procedure.

Obtaining initial combinations
For each farm, we seek the configuration which produces the highest profit. We start with a configuration that includes only the plant farm in question, and all the other farms are added progressively according to their distance from that farm. Of all the configurations tested, the one with the highest profit is chosen: and P ik are the indices of the k farms closest to farm i. These best configurations are recorded as they will be used later to expand a set of stored combinations, which we refer to as the pool. Then, for each best configuration, a combination is created that only includes that configuration. These combinations form the basis for the first generation of combinations:

Generation of new combinations
In each iteration of the algorithm, up to P combinations are chosen from the current generation trying to maximize the dissimilitude between pairs.
The selected combinations form the pool of this generation and are then used to build the next generation. This approach is similar to a beam search [39] but tree branches are not only chosen by profit but also ensuring diversity between them in a disperse construction process using the reduction method explained in Sect. 2.2.4 To form the next generation, derived combinations are obtained for each combination of the pool by adding, separately and one at a time, configurations of BC to each combination. These new combinations pass to the next generation if they increase their total profit, as: The Add function inserts c into p modifying the configurations to manage the collisions.

Add function, collision management
Given a valid combination p (without collisions), if a new configuration c needs to be added to combination p, all colliding farms are assigned to the new configuration c. Then, they are sorted from the most relatively close to the most relatively distant in relation to the configuration in which they formerly were in p, using the coefficient between their distance to the plant farm of the new Reduce(B n ) = arg max where i is the plant farm of c and p(j) is the plant farm of p assigned to the colliding plant j.
In this order, the process checks whether the colliding farm j should return to p(j), comparing the total profit (TPF) before and after return.

Reduction method
The group of combinations to be reduced is sorted according to the TPF, from highest to lowest. Then, the dissimilitude is calculated, using the method described above, between each combination and a range R of the following combinations.
We look for the smallest dissimilitude recorded between the two combinations that provoke it, and we eliminate the combination that produces the lower total profit. Subsequently, new dissimilitudes are calculated so that, after the deletion, each solution still has its dissimilitude computed for the next R solutions. This procedure, which constitutes an approximation to a pseudo-clustering algorithm, continues until only P combinations remain.

Stopping criteria
The execution ends after M iterations, after P M is calculated. Finally, the combinations of each pool are combined, and the best are retrieved.

Programming language, software and equipment used
This approach was implemented using the C++ language, the code is available online 1 . The implementation retrieves the quantity, power generation and configurations of the best combinations found. This information was then imported into ArcGIS in order to obtain the corresponding geographic projections. The tables and maps presented in the following section were generated.

Search parameter settings
In order to balance computational feasibility and quality of solutions, P was set to 1000; and M to 20. The best one hundred solutions were analysed. As the computing capacity available is limited, the range used was: This was done to reduce the computing cost implied by calculating the dissimilitude between all pairs, since it is assumed that the geographical similarity between two configurations, specifically their plant farms, results in an economic similarity.

Databases
Farm locations and numbers of cows were obtained from Chile's Livestock and Agriculture Service (SAG), responsible for keeping livestock statistics. We used data from its most recent complete database [40]. ]. The farms were filtered in order to consider only those that have 100 or more dairy cows. The total number of georeferenced farms is 572, with a combined total of 173,631 cows. The farms are distributed across three regions in southern Chile as shown in Fig. 2. These regions cover an area of 98,885.4 square kilometres [41]. Only the number of dairy cows and the geographical coordinates of the farms were considered.

Parameters
We assume an animal weight of 600 kg and a daily manure production of 10% of body weight, with 4 h of confinement per day [42]. A project life cycle of 20 years is considered, with an accelerated depreciation of 3 years, and a percentage for contingencies of 15% of the initial investment; working and investment capital of 20%, and income tax at 20%. Percentage of transmission cost over income from the sale of electric power: 5%; maintenance and repair costs of equipment: 60,000 USD/yr; salaries and social security contributions: 20,000 USD/yr; other costs: 5000 USD/yr per plant/yr [36]. Sale values per MWh are assessed according to references [43,44]. The land required for the projects is 4 hectares within the farm, regardless of the size of the plant, in order to facilitate the change of land use; the area can therefore be used for larger plants [23]. The average value of the land is 40,667 USD/plant [45]. It is estimated that the transport cost per ton kilometre is 0.3 USD [46] In each iteration, we consider an economic analysis calculating NPV according to reference [35]. As indicated in [36], the following percentages were considered: total solids amount to 24.5% of the cow manure; the volume of biogas generated is considered 55.0% methane and 45.0% carbon dioxide (this assumption is also made by [28]); 90.0% days per year that energy is generated; 15.0% energy demanded by the plant; molecular weight of methane, 16; and of carbon dioxide, 44; methane calorific value of 9.96 kWh/m3. It is considered an estimated production of 88.2 m3 of biogas, equivalent to 112.6 kg and around 483 kWh. The sale of caloric energy was not considered due to the high cost of transportation lines and logistics. The commercialization of bioslurry was not included either, since the absorption capacity of the soils varies among farms, and its inclusion is better left as a future work.
The minimum investment cost was set to 1,050,166 USD with a power of 500 kW, an investment growth factor of 2,100.332 USD per unit of additional power (kW) was considered, according to data from biogas plants equipped with post-digesters shown in [35,36], the cost of the whole facility, including the storage tank, is included in this cost.
The relationship between the efficiency coefficient and the generator size was obtained from [36], and a logarithmic regression was applied to obtain a continuous function, which retrieves an efficiency of 0.422 for a 500 kW generator and 0.455 for a 3000 kW generator.
Energy sale prices were considered constant for each scenario analysed, since calculating the precise sale tariff offered by the PMGD scheme would require a complex analysis for each location and plant characteristics, specified in [33].
The values of the parameters in the mass balances of waste were considered fixed, which could be achieved operationally by installing equalizing ponds in the plants in order to improve performance.

Scenarios
To find the location, power generation and NPV of combinations of biogas facilities, we consider scenarios with biomass availability between 40 and 80%, energy sale prices between 90 and 100 USD/MWh, and transport costs of 0.3 and 0.4 USD/tkm. These are outlined in Table 1.

Results
We run two set of experiments to validate the algorithm. In Sect. 4.1, a comparison is made with ArcGIS Network Analyst for a specific set of operational conditions. Then, in Sect. 4.2, we apply the algorithm to the different scenarios mentioned previously.

Benchmark results
For comparison, the Minimize Facilities function of the ArcGIS Network Analyst [47] (NA) was used for selecting the plant farms, establishing the cover radius parameter at 10 km, 19 km, 25 km, and 50 km according to [21]; the resulting facilities were evaluated using our model. The plants that, without collisions, resulted in a negative NPV were always discarded. Even so, some configurations resulted in a negative NPV when in the combination, as they lost some farms to other plant farms. Table 2 shows a comparison of the results obtained by both the Network Analyst and our algorithm in the most profitable scenario tested (80% biomass, 0.3 USD/ tkm transport cost, and 100 USD/MWh). The TPF column shows the resulting value of the combination, while the TPF (only NPV>0) column shows the same value but discarding the configurations that have negative NPV within the combination. Figure 3 shows the best combination obtained using our algorithm in the most profitable scenario. Farms included in the configurations are shown as green dots and are connected to their assigned plant farm using blue lines. Figure 4 shows the combination obtained using the ArcGIS NA with a cover radius of 25 km, which gave the most profitable results for this approach. The farms of the configurations that resulted in a negative NPV are shown in red. Figure 5 shows the resulting combinations when the cover radius is set to 50 km.  Table 3 shows the details of the best combination of facilities obtained by our algorithm for each of the scenarios tested. Each row represents one scenario and the best combination of plant farms found for that scenario. Among these, 18 farms were consistently selected to be plant farms, so, one column is used for each one of them. The inner cells show the power produced by that plant farm in that scenario, when it is present. The left hand columns show the percentage of available biomass (%BIO), the selling price per MWh (USD/ MWh) and the transport cost for each tkm (USD/tkm), for each scenario. The right-hand columns show the number plant farms (n.plants), the total power (Total KW) and the NPV (NPV USD) of the best combination found. Scenarios in which no plant was profitable were omitted from the table. Figures 6,7,11,8,12,9,13,10,and 14 show the geographic distributions of the combinations shown in Table 3. Each figure shows the best combination of one or more scenarios with the same percentage of available biomass and transport cost, but increasing the energy prices in order of reading, from top to bottom and from left to right.

Biogas plant network design for different scenarios
In the figures that show more than one scenario, namely Figs. 6, 7, 8, 9, 10, 12, 13, and 14, it can be seen that a higher energy price allows to open more facilities, increasing the coverage of the network.

Discussion
The presented algorithm allows us to obtain the location of plants and the assignment of farms to them such that the profit of each group is positive while the overall profitability is maximized. This method also allows us to identify those farms whose production level, distance to plants and cost structure do not justify their inclusion in the network. Potentially, the method could enable us to determine the threshold for them to become profitable. As expected, the expansion of the network in terms of number of plants, farms, cows and average distance (coverage radius) is heavily influenced by the economic and operational conditions of the system in terms of energy price, transport and operational cost, and biomass availability. Although our algorithm retrieves up to 100 solutions sorted in decreasing TPF for each scenario, we only analysed the best one obtained. The plant-farm indices of these best combinations were always a subset of 18 recurrent indices (Table 3). In the best-case scenario, the network includes eight plants (Fig. 10), while in the worstcase scenario, that is still profitable, the number falls to only one (Fig. 6).
It can be seen from Table 2 and Figs. 3, 4 and 5 that, in the most profitable scenario, the proposed method allowed us to find a network of plants and farms with up to 70% more profitability than the usual method for assigning biogas plant locations in the literature, which relies on the ArcGIS NA as used by [21], and similarly by [20].
The use of location-allocation models, available in GIS, in the renewable energy literature has tended to be focus on the spatial distribution of demand and potential facility locations are evaluated manly by this factor [48].  Our results prove that the economic efficiency of a biogas project should be included in the model that is being optimized for a more efficient decision making. Although GIS provides accessible optimization tools and techniques, these are often used without understanding the underlying models and methods [49] and require more flexible models [19].
According to the methodology used, the production of biogas for the generation of electric power would be a profitable option in the prevailing situation in Chile, in agreement with [10]; however, high energy sale prices and low transportation costs are required. If these conditions are not met, it would be necessary to install a public policy to stimulate generation of this type of renewable energy. In order to extract the resource efficiently, the allocation of plants should be limited to strategic locations, as proposed in this research.
In a real scenario, the estimated power values should be adapted to the closest values of the engines available for purchase. This model does not consider the complex human interactions that could arise from the fact that it is not possible to impose a certain investment on the farm owner as this action depends on the will of stakeholders involved in the framework of a national cooperation policy. Nor is there any consideration of payment for the purchase of waste or a fee for its removal, since this will be defined by the type of contract between the parties. This can result in a higher or lower profitability than calculated.
In the light of the results, it would be valuable to carry out a study with networks of biogas plants using co-digestion, and to analyse the incorporation of policies oriented towards the support of cooperative networks, in addition to using the algorithm to determine optimal locations of dairy processing plants associated with small producers. We expect to develop these topics in future publications.

Conclusion
While GIS are an accessible alternative for location analysis thanks to their capability for modelling and solving classical facility location problems, it is necessary to develop precise models and the specialized algorithms they require-like the one presented in this work-to consider more complex factors and limitations that can appear on real applications. This in order to support decision making in accordance with the reality, and the technical and economic difficulties that may be present in the studied geographic area. For the conditions of Chile, in the best scenario tested (80% biomass, 100 dollars per MWh and a transport cost of 0.3 USD/tkm), our heuristic method obtained locations that result in a NPV 70% higher than when using locationallocation functions provided in GIS, as do most network analyses in the biogas literature.
In this regard, our model and algorithm represent a contribution to the design of profitable biogas networks. To the authors' knowledge, this is the first time that the economic gain, including complex factors inherent to biogas generation in the VPN, of a whole network has been optimized.
The production of biogas for the generation of electric power in Chile requires high energy sale prices and low transportation costs. In order to extract the resource efficiently, the allocation of plants should be limited to strategic locations, as proposed in this research.  Fig. 7 Location of the configurations of the best combination found, with 50% biomass availability scenario, transport cost of 0.3 USD/tkm and energy price of 94, 96, 98, and 100 USD/MWh, in order of reading ◂ Fig. 8 Location of the configurations of the best combination found, with 60% biomass availability scenario, transport cost of 0.3 USD/tkm, and energy price of 90, 92, 94, 96, 98 and 100 USD/MWh, in order of reading