2.2. Anaerobic co-digestion
Co-digestion refers to processes where the organic matter consists of two or more different substrates. The use of different substrates can enhance fermentation and increase biogas yield, if the combination is performed strategically. Co-digestion can assist in regulating pH, improving carbon/nitrogen and carbon/phosphorus ratios, and increasing the availability of micro and macronutrients required for the metabolism of the microbial community.
Preliminary batch studies of the co-digestion of glycerol and a second substrate were performed by Aguilar
et al., [
22], using swine waste, with the results showing that biogas production and COD removal were favored by co-digestion.
The anaerobic process usually has four distinct stages [
7]: Hydrolysis; Acidogenesis; Acetogenesis and Methanogenesis. Acidogenesis and acetogenesis are also known as primary fermentation, while methanogenesis is secondary fermentation. In the presence of nitrate or sulfate, the hydrogen formed in the acidogenesis step acts as an electron donor for the reducing bacteria, producing sulfides and ammonia [
7].
Temperature is an important factor in the digestion process. Microorganisms are unable to regulate their internal temperature, which is therefore determined by the environment. The production of methane can occur in a wide temperature range up to 97 °C, while hydrogen formation occurs from 15 to 85 °C, and it is not possible to produce H2 under psychrophilic conditions [
7,
23]. According to Chernicharo [
7], the best temperatures for microbial growth and biogas production are in the mesophilic (30-35 °C) and thermophilic (50-55 °C) ranges, with thermophilic conditions generally providing higher hydrogen and methane production rates. Operating at around 55 °C requires the consumption of energy to transfer heat, which can make the process economically unfeasible. Therefore, most anaerobic digesters are operated under mesophilic conditions, which are easy to provide in tropical countries, such as Brazil [
7,
23]. Controlled fermentation processes can be performed in different types of reactors, which may be operated continuously or in batch mode [
7].
2.3. Artificial Neural Networks
Different artificial neural network architectures are described in the literature, although the most common is the multilayer perceptron (MLP), often incorrectly used as a neural network synonym. Other architectures include convolutional neural networks and recurrent neural networks, among others. According to Nelles [
15], the MLP can approximate any smooth function, with a degree of precision that varies with increase of the number of neurons in the hidden layer. Increasing the number of hidden layers makes the method more powerful, albeit more complex.
The structure of an MLP network can be described by Equation 1. There are “n” inputs (x), with each input being accompanied by a weighting (w
ij) that is a network adjustment parameter. In addition, there is a bias (w
i0) that provides a further degree of freedom for fitting the network response to experimental data, which can be considered an independent weighting (not associated with any input variable). All these parameters compose the “m” neurons of the hidden layer. The hidden layer neurons are usually composed of sigmoid (ϕ
i) logistic (Equation 2) and hyperbolic tangent (Equation 3) functions. These neurons are arranged in parallel and send signals to the neurons of the next layer, until reaching the output layer (in practice, one or two hidden layers are sufficient). In the output layer, the neurons are usually composed of linear functions (a linear combination) for adjusting the amplitude and the point of operation. This mathematical structure enables the MLP to be applied to different problems, demonstrating the universality of the method [
15].
making u= w
ij x
j:
2.3.1. Application of Neural Networks in biogas production
In order to optimize the development of bioenergy and make it attractive from both environmental and economic perspectives, different areas of research and technology have encouraged the use of artificial neural network resources for the prediction of biogas production scenarios using the co-digestion of different substrates. This methodology can assist in solving problems that are complicated to model, predicting outcomes in a more simplified way.
Jaroenpoj
et al., [
24] used a multilayer feedforward model to predict the production of biogas from co-digestion of leachate and pineapple peel. In comparison with experimental data, the simulation results had a squared error of 0.0267 and R2 of 0.9942, showing the effectiveness of this approach and its versatility in prediction applied to nonlinear problems.
Ghatak and Ghatak [
25] used artificial neural networks to model and optimize the production of biogas from co-digestion of cattle manure combined with bamboo dust, sugarcane bagasse, or sawdust, under mesophilic and thermophilic conditions. The results for biogas specific production presented R2 of 0.997 and accuracy of ±0.01, compared to experimental values. The simulations were performed using different temperatures of the substrates. The best biogas production was obtained using the co-digestion of cattle manure with sugarcane bagasse.
Özarslan
et al., [
26] used artificial neural networks to predict the production of methane from co-digestion of tea factory wastes and spent tea waste, comparing the results to experimental data from the co-digestion of these substrates for 49 days, in batch mode, under mesophilic conditions. The coefficient of determination (R
2) value obtained for the fit was 0.9982 and the best mixture for methane production was 65% tea production waste and 35% spent tea. The accumulated production of biogas obtained in the co-digestion was 183% higher than for anaerobic digestion of the substrates separately.
Gonçalves Neto
et al., [
27] investigated the digestion and co-digestion of food wastes (including fruits, vegetables, meats, and dairy products) using experiments in batch mode, under mesophilic conditions and with different organic loadings. In addition to the experimental values, the database included literature data that acted as a basis for implementing the logic of artificial neural networks. The input variables were the substrate mixture composition, reactor feed flow rate, reactor type, organic loading, pH, hydraulic retention time, volatile solids, temperature, and reactor volume. The output variable was the accumulated biogas production. The network provided R
2 values of 0.9929 for training, 0.8486 for testing, and 0.6167 for validation. It was found that the biogas pro-duction volume was higher under thermophilic conditions, with a local maximum for mesophilic temperatures. It was also concluded that the isolated digestion of fruits and vegetables produced a greater accumulated quantity of biogas, compared to the co-digestion of food wastes.
2.4. Fuzzy Logic
An alternative to artificial neural networks is the use of fuzzy logic, developed in 1965 by Lotfi A. Zadeh. The methodology was inspired by the vague and uncertain way in which human beings think and communicate, absorbing semiquantitative information in the description of a process [
15].
This approach is especially useful for complex systems. Advantages are that fuzzy logic is conceptually easy to understand and that the mathematical equations employed are relatively simple. Recent years have seen increasing use of fuzzy logic in the development of cameras, washing machines, microwaves, and industrial process control systems [
28].
The main concepts on which fuzzy logic is based are presented below.
In fuzzy logic, linguistic variables are non-numerical, being represented qualitatively by linguistic values (high, medium, and low). Consequently, they have a degree of uncertainty, since the numerical input data will be subdivided into linguistic values with a certain degree of adherence.
In fuzzy logic, membership functions (MF) describe the linguistic value intervals and the degree of belonging (degree of membership) of an element to these values. The membership functions can present different standard or customized curves, depending on the situation, with the most common being Gaussian, triangular, and trapezoidal.
A linguistic variable can have more than one linguistic value, with each linguistic value having its own function.
Based on the behavior of human thought, the heuristic rules of fuzzy logic are formulated according to the concept of cause and effect: “IF” there is a given input condition “THEN” there is a consequent specific response. The number of rules is a com-bination of the inputs and depends on the granularity (degree of detail) of the linguistic variables. Like artificial neural networks, fuzzy logic is a universal variable estimation tool [
15]
There are two different approaches that structure the “IF”...“THEN” rules. The Mamdani approach uses linguistic variables for the input (antecedent, “IF”) and the output (consequent, “THEN”), while the Takagi-Sugeno approach uses linguistic variables for the input and numerical variables for the output. In the Takagi-Sugeno approach, the numerical variables are normally calculated using a linear function. Examples of the approaches are as follows:
IF long period THEN high volume of CH4 (Mamdani)
IF long period THEN 5000 mL volume of CH4 (Takagi-Sugeno)
In cases of more than one linguistic variable in the antecedent of the rules, then these variables are combined using logical operators, typically “AND” and “OR”. The “AND” operator is applied when the two antecedent conditions need to occur, in order for the consequent action to be performed. The “OR” operator is used when only one of the antecedent conditions needs to occur, in order for the consequent action to be performed.
Each operator performs specific calculations combining the degrees of membership of the linguistic variables in the antecedent. According to Nelles [
15], this combination is called the degree of rule fulfillment or the triggering force of the rule, reflecting how well a created premise reflects the specific input value. If the combination of membership degrees (MDs) is equal to zero, then the rule is not active. The step where these operators are applied is denoted aggregation.
The “AND” operator combines MDs using the minimum or product methods (other methods exist, but these are the most common). The “OR” operator can also combine MDs in different ways, although the most common are the maximum and probabilistic OR methods.
After calculation of the degree of compliance with the rule, evaluation is made of the consequent of the rule. The commonest implication methods are truncation (using the minimum function) and scale reduction (using the product function). Use of a single rule is normally ineffective in solving the problem; therefore, it is necessary to evaluate the implication of the consequent for each rule, after which all the consequents are accumulated [
15,
28]. The commonest accumulation methods are the maximum, probabilistic, and weighted average methods. The maximum function evaluates the MFs point by point, selecting the highest value. The probabilistic function is indicated when there are only two rules, with calculation of the sum minus the product of each point of the MFs. The weighted average method performs the sum of all the points of the MFs and applies a weight to each value based on the MD.
In the Takagi-Sugeno approach, the combination of all the consequents provides the final result (output variable) of the problem. In the Mamdani approach, there is a final defuzzification step.
An excellent strategy that has increased the possible applications of fuzzy logic is its combination with neurocomputing and/or genetic algorithms. The ANFIS (Adaptive-Network-Based Fuzzy Inference System) methodology, developed by Jyh-Shing Roger Jang in 1993, functions in a similar way as artificial neural networks. It involves defining the parameters of a Takagi-Sugeno model, which enables the inference system to perform a mapping of the relationship between the inputs and the outputs, using im-plication rules. The parameters are adjusted using the backpropagation algorithm in combination with a statistical least squares method [
28].
2.4.1. Application of fuzzy logic in biogas production
Among the many applications for fuzzy logic, recent reports have described its use in the prediction of biogas production from the anaerobic digestion of different substrates.
Khayum
et al., [
29] used the Mamdani fuzzy logic approach to predict the performance of co-digestion of spent tea waste and cattle manure. The simulation employed a triangular membership function and five layers, with a total of 125 “IF”...“THEN” rules being inferred. The input variables were digestion time, pH, and carbon/nitrogen ratio. Comparison of the experimental and predicted values resulted in R² of 0.994, demonstrating the precision of the fuzzy logic data. It was found that the highest biogas pro-duction was achieved using a mixture of 70% cattle manure and 30% spent tea waste.
Heydari
et al., [
30] investigated the production of biogas from the anaerobic digestion of mint essential oil wastewater, under mesophilic conditions in a UASB reactor, adopting the Takagi-Sugeno approach and the ANFIS methodology. The simulations were per-formed using Matlab R2017b, with 19 samples and 10 input variables (influent COD, pH, suspended solids, volatile solids, oil and grease removal, turbidity removal, COD removal, phenol removal, effluent volatile acids, and alkalinity). For prediction of methane production, the data were grouped in pairs in the first layer and the model was divided into eight sub-networks, employing five layers. The model provided a satisfactory fit, with R² of 0.956 and low mean relative error of 0.315%.