Accurately characterizing the substrate used in anaerobic digestion is crucial for predicting the biogas plant's performance. This issue makes particularly challenging the application of modeling in codigestion plants. In this work, a novel methodology called substrate prediction module (SPM) has been developed and tested, using virtual codigestion data. The SPM aims to estimate the inlet properties of the substrate based on the reverse application of the anaerobic digestion model n1 (ADM1). The results show that, while the SPM can estimate some properties of the substrate based on certain output parameters, there are limitations in accurately determining all required variables.

  • Extensive substrate characterization is challenging, especially for codigestion.

  • A reverse modeling approach is proposed to estimate unknown substrate properties.

  • The substrate prediction module processes measured AD data based on the ADM1.

  • Two data processing strategies are assessed: 7-day moving block and daily data.

  • The SPM could estimate some substrate properties but there are limitations.

Anaerobic digestion (AD) is a consolidated technology that produces biogas, biomethane, and an organic alternative to chemical fertilizer. AD is expected to play a key role in fighting climate change since it can potentially reduce 10% of the world's current greenhouse gases (GHG) emissions through renewable energy generation and through avoided emissions from crop burning, deforestation, landfill gas, and fertilizer manufacture emissions (Morton & Thompson 2019).

Process modeling is the representation of a process through equations, where the most important phenomena that take place are considered (e.g. physiochemical or biological). In the context of an AD plant, mathematical modeling allows the operator to rely on a virtual prototype of the digester, which can run in parallel to the operation, providing a flexible tool for scenario predictions, optimization, and anticipation of process imbalance, among others. Modeling should become a central part of the monitoring and supervision of AD in the forthcoming years, given the increasing adoption of process instrumentation and automation, as well as the need for better control and supervision (Wu et al. 2021b). Mathematical modeling of the AD process has been studied for over 20 years, particularly since the Anaerobic Digestion Model No.1 (ADM1) was released (Batstone et al. 2002). The common practice of modeling in AD comprises model implementation, calibration with a certain set of data, and validation with an independent dataset, and then the model can be exploited (Donoso-Bravo et al. 2011). Over the years of modeling applications in AD, a big challenge has been lurking: the need for an extensive substrate characterization as model input, which is particularly critical when using the ADM1 (Wu et al. 2021a). The substrate characterization should comprise key parameters including the biodegradable and inert fractions of the influent, organic matter measured as COD (chemical oxygen demand), and the macromolecular composition (proteins, lipids, and carbohydrates) for both particulate and soluble fractions. Additionally, it is essential to include measurements of ammonia nitrogen, inorganic carbon, volatile fatty acids (VFAs), and other relevant parameters. A proper substrate characterization is required for the model to accurately predict the output variables such as biogas, VFAs, or ammonia. There have been some attempts for the adaptation of more conventional measurements, such as total COD, volatile solids (VS), alkalinity to the needs of the ADM1 model; however, those methodologies still fall short in covering all the required input variables while still demanding an excessive experimental workload (Kleerebezem & Van Loosdrecht 2006; Poggio et al. 2016). Therefore, this issue still lacks a solution and remains one of the main factors impeding the implementation of modeling applications in biogas plants (Wu et al. 2019). This situation can become even more problematic considering the increasing application of codigestion of different organic wastes, with different physicochemical characteristics from different origins, that are fed in the same digester.

All the experience with the ADM1 has left behind large sets of calibrated and validated parameters in the literature. Therefore, with a collection of experimental measurements, it may seem feasible to use the model to estimate the inlet characterization of the substrate in a reversed modeling application. Incipient attempts at doing this were presented in Donoso-Bravo et al. (2020) where the cationic and inert fractions were estimated from the data along with other conventional kinetic parameters. This study aims to assess the reverse engineering of the ADM1 for its exploitation as a soft sensor model to characterize the substrate fed into anaerobic digesters.

A novel methodology, called the substrate prediction module (SPM), is proposed. SPM provides an estimation of part of the substrate's properties, that are not measured onsite, after processing the measured inputs and outputs of the digester by a mechanistic modeling approach. The underlying hypothesis of the SPM is that the measured output(s) in the digester must be sensitive to some changes in the substrate properties; therefore, the properties could be estimated to some extent by the variation of the digester outputs.

General rationale

A general diagram for the application of the SPM in a real operation is presented in Figure 1. The application of SPM would enhance and refine the characterization of a substrate that undergoes treatment within an actual digester in the real world. To achieve this, the SPM uses the input information measured onsite along with an initial guess of the unmeasured input properties that are necessary to run the model. For instance, in a certain plant, the VS and inlet flow are measured onsite but the macromolecular composition of the organic matter is unknown so this set of values would be part of the unknown measured variables. Using these substrate properties, the SPM employs the ADM1 model for simulating the digestion process under identical operational conditions to its real-world counterpart. It then compares the simulation's results with the actual measured outputs from the digester, such as, biogas production, VFAs, or pH levels … Through an iterative optimization process, the SPM explores various values for the unknown properties until the simulation's output aligns with the real digester's output within a specified tolerance. Ultimately, this iterative process yields an estimated set of characterization values for the unknown values of the substrate.
Figure 1

Methodology of the SPM applied to estimate the unknown substrate characteristics.

Figure 1

Methodology of the SPM applied to estimate the unknown substrate characteristics.

Close modal

It is worth noting that the proposed approach would be valid only if the ADM1 model is correctly calibrated in all its parameters (e.g., kinetic parameters, yield coefficients, etc.). Therefore, an initial stage of model calibration should be carried out, as has been done in the literature.

Numerical evaluation of the concept

To prove the idea, in this work, the SPM was evaluated at a conceptual level by using a subrogated modeling approach. Instead of using data from a real digester, synthetic data generated from another ADM1-based model was used.

The models

Two ADM1-based models were employed to first generate synthetic operational data and secondly to test the SPM. To generate the data, a modified version of the ADM1 enabling the simulation of the codigestion process (AcoD) was used. A description of this model can be found in Donoso-Bravo et al. (2020). In other words, this model was used to generate the operating data that were afterwards used to test the actual SPM. For the SPM, the original ADM1 together with the parameters and model tweaks proposed by Rosen & Jeppsson (2006) was used. The utilization of slightly varied models for data generation and methodology testing imparts a heightened level of realism to the results.

The AcoD model and the SPM were implemented and simulated in Matlab 2021®. The solver ODE15s was used to solve the ordinary differential equations system. The initial conditions of the model for both the surrogate modeling and the SPM itself were obtained from prior simulations where steady-state conditions were reached, and process values were similar to the initial values of the experimental data.

The parameters estimation

Parameters estimation must be carried out for two different purposes. First and foremost, the model used in the SPM must undergo a parameter calibration procedure with the field data generated in the plant so that it can represent the actual digester as a digital twin. If this is not done, the results of the SPM will be inaccurate because neither the set of kinetic nor stoichiometric coefficients are adjusted by the SPM application. Second, the SPM is basically an optimization-based approach where the unknown parameters to be estimated correspond to the unmeasured properties of the substrate as inlet conditions. The difference between the simulated outputs from the SPM and the output coming from the virtual codigestion plant was minimized while adjusting the unknown inlet properties of the substrate. As optimization criteria, the least square criterion was used for the minimization procedure. The regular (Equation (1)) and normalized (Equation (2)) equations were used, respectively, when only one output was considered and when two or three outputs were used. The latter was selected to avoid an imbalanced influence of a particular output due to the different order of magnitude of the units (e.g. m3/day compared to mg/L).
(1)
(2)
where J is the cost function, viexp is the experimental (virtual) value of the output i, and visim is the simulated value of the output i obtained through the SPM.

The Matlab toolbox fminsearchbnd was used for the optimization procedure. Like fminsearch, fminsearchbnd implements the Nelder–Mead algorithm, but unlike fminsearch, it allows for bounds to be applied to the variables. fminsearch is suitable only for unbounded searches. Compared to fmincon, which is a gradient-based method, fminsearchbnd has less risk of getting trapped in local minima, offering greater stability and higher convergence success.

The operational conditions

A virtual digester of 13,600 m3 total volume (10% volume headspace) at mesophilic conditions (35 °C) treating sewage sludge (primary and secondary sludge) was simulated for a period of 365 days. For the virtual AcoD digester operation in continuous mode, two operating scenarios were considered: (1) the sporadic addition of a carbohydrate-rich wastewater as co-substrate up to day 250 and (2) the implementation of thermal hydrolysis (TH) of secondary sewage sludge leading to a stepwise increment of the proportion of soluble COD in the inlet after the day 250.

The output processing approaches

Two output processing data strategies were evaluated: daily data and moving blocks of 7-day data. The daily data strategy used the output data from a certain day to determine the input condition related to that day. The daily simulated data represent an average of the complete dataset generated during a day of simulation. The 7-day moving block strategy used the average value of the output calculated over seven consecutive days (days 1–7) to determine the input condition of day 1. The use of moving blocks was chosen and applied to minimize the effect of the variability of the daily data, assuming that taking a 7-day average is a compromise that smooths the data but gets results reasonably close to the actual events.

The rationale behind the selection of parameters to predict the substrate properties is given below and a representation of how these parameters relate to the substrate properties is shown in Figure 2. The inert fraction of the substrate (fin), in this study set to be equal for both the particulate and soluble fractions, closely related to the biodegradability extent, has been reported as a key parameter that needs to be known during the modeling practice (Batstone et al. 2009). The fractionation of the organic matter (fsCOD/tCOD) has been extensively studied as a factor that has an important effect on the digester performance (Souza et al. 2013). The macromolecular composition of the substrate is quite relevant considering the different degradation paths that each component takes during AD. Among them, the carbohydrate content (fCH) was chosen considering the simulated experimental conditions. All the other substrate properties are assumed known, with similar values to the ones used to generate the synthetic data.
Figure 2

COD fractionation of substrate and relationship with selected input variables in SPM numerical assessment.

Figure 2

COD fractionation of substrate and relationship with selected input variables in SPM numerical assessment.

Close modal

The experimental design comprised the use of three ADM1 output variables as input data for the SPM: biogas (B), VFAs, and pH, to predict three substrates' properties. Table 1 summarizes the assessed virtual experimental conditions for each of the nine experiments, called C1–C9.

Table 1

Experimental conditions assessed in the SPM

Estimated parameterInput data for SPM
BB, VFAsB, VFAs, pH
fin C1 C4 C7 
fin, fsCOD/tCOD C2 C5 C8 
fin, fsCOD/tCOD, fCH C3 C6 C9 
Estimated parameterInput data for SPM
BB, VFAsB, VFAs, pH
fin C1 C4 C7 
fin, fsCOD/tCOD C2 C5 C8 
fin, fsCOD/tCOD, fCH C3 C6 C9 

fin, inert fraction; fsCOD/tCOD, organic soluble fraction; fCH, carbohydrate fraction; B, biogas; VFAs, volatile fatty acids.

Virtual digester operation

The inlet conditions used for the operation of the virtual digester are shown in Figure 3, where the two operation scenarios are separated by a vertical dashed line. During the operating scenario 1, sudden increments of the organic loading rate (OLR) while drops in the hydraulic retention time (HRT) were induced by the addition of the co-substrate because it increased the amount of the organic matter added as well as the total flow of substrate (Figure 3(a)). At the same time, during this stage, the total COD slightly dropped because the co-substrate was more diluted than the sewage sludge whereas the soluble COD increased because the co-substrate added soluble matter (Figure 3(b)). During the operating scenario 2, the HRT and OLR remained stable since the total organic matter and flow did not change; however, the soluble COD increased as the proportion of thermally hydrolyzed sludge introduced in the substrate increased (Figure 3(b)).
Figure 3

Input data from the virtual digester modeled through the ADM1-AcoD: (a) organic loading rate and hydraulic retention time over time, and (b) total and soluble COD over time.

Figure 3

Input data from the virtual digester modeled through the ADM1-AcoD: (a) organic loading rate and hydraulic retention time over time, and (b) total and soluble COD over time.

Close modal
Figure 4 presents selected output data generated by applying the AcoD-ADM1 model, namely, biogas flow, methane content, pH, soluble COD, VFA, and ammonia. Only these outputs are shown because they represent the main operational variables typically monitored during digester operation. The biogas flows showed several spikes associated with the incorporation of the wastewater as co-substrate while the methane content of the biogas also shows to be sensitive to this codigestion conditions. Regarding this, up to around day 100, the methane content dropped when the co-substrate was added; however, as the operation continued, the methane content tended to increase along with the co-substrate addition. With respect to the variables measured in the digestate, the total VFAs showed the highest sensitivity to the operational conditions. The soluble COD increased steadily when the TH of the sludge was simulated.
Figure 4

Output data of the (a) biogas and (b) digestate line of the virtual digester modeled through the ADM1-AcoD under the operating conditions of codigestion and thermal hydrolysis.

Figure 4

Output data of the (a) biogas and (b) digestate line of the virtual digester modeled through the ADM1-AcoD under the operating conditions of codigestion and thermal hydrolysis.

Close modal

SPM assessment

7-day moving block strategy

The outputs from the virtual plant were used as inputs for the SPM. The results of the substrate property estimations, based on the three inlet parameters defined in Table 1, are shown in Figure 5. The fin shows some sensitivity to the measurement of the biogas production (C1) in the moments when the co-substrate was incorporated into the inlet of the digester. A downward trend is also observed during the TH operation (after day 250) as well as when the normal operation without TH was simulated (after day 320). Furthermore, the estimated value for fin is close to the actual value (dashed line). In general, although more significant during the first co-substrate additions, the parameter showed a drop in its value, followed by an increase until the co-substrate addition halted. The co-substrate used in this study was 100% biodegradable. Therefore, the observed behavior in data estimation could be attributed to the smoothing effect caused by averaging a block of 7 data points. This smoothing effect diminishes the initial increase in biogas production, resulting in reduced sensitivity to changes in this parameter and affecting the accuracy of the estimated values. During the TH process, there is an increase in soluble COD, which has an impact on biogas production, although this impact is much less significant compared to the effect of co-substrate addition. The SPM interprets this situation as a perturbation of fin, which is indirectly influenced by the thermal process because soluble COD is more readily degradable than particulate COD. The inclusion of the VFA (C4) as another output parameter kept the sensitivity of the fin, although its actual value is significantly underestimated. The inclusion of the pH in the cost function (C7) did not produce any improvement. However, the general sensitivity of fin to the operational conditions remained unchanged.
Figure 5

Substrate parameter values over a year of operation of the virtual digester estimated through the SPM tool using the 7-day moving block strategy. Dashed lines represent the exact values used in the simulation for data generation.

Figure 5

Substrate parameter values over a year of operation of the virtual digester estimated through the SPM tool using the 7-day moving block strategy. Dashed lines represent the exact values used in the simulation for data generation.

Close modal

When a second parameter related to the substrate properties is added to the estimation procedure, fin still shows some sensitivity to the biogas production (C2), although this sensitivity is less than the observed in C1. Conversely, fsCOD/tCOD cannot be accurately estimated under the evaluated conditions due to erratic behavior, especially during the TH period, where a downward trend was observed instead of the expected increase. When VFAs are included in the minimization function (C5), the sensitivity of both parameters improves, in terms of stability relative to the operational conditions. However, the actual value of fin is not properly estimated, similar to what was observed in C4. During the incorporation of TH, there is a delay in the estimation of fsCOD/tCOD, as the parameter does not show sensitivity at the start of the process. This can be explained by the averaging performed with the 7-day block strategy. Adding pH as an output parameter to the minimization procedure (C8) slightly improves the sensitivity of fsCOD/tCOD, while maintaining the sensitivity of fin. Additionally, it reduces the delay in fsCOD/tCOD sensitivity, compared to what was observed in C5.

A significant impact on the optimization procedure is observed when a third input parameter, such as fCH, is incorporated. Using only biogas production (C3), fCH cannot be determined throughout the entire evaluated period. The parameters fin and fsCOD/tCOD still exhibit some sensitivity, but the values estimated by the SPM deviate further from the actual ones. Interestingly, fsCOD/tCOD during the TH period is better predicted compared to when only two input parameters were estimated (C2, C5, and C8). The addition of VFA and pH as output values in the cost function (C6 and C9) has a significantly negative impact on the estimation of the input parameters, as no sensitivity is observed during the evaluated period.

Daily estimation

The estimation of the substrate properties in terms of the three inlet parameters is shown in Figure 6 for the daily data estimation strategy. fin cannot be properly determined using only biogas data, as convergence problems were encountered (C1). The estimated value fluctuates constantly between two different states with no relation to the actual simulated conditions. It is worth noting that this optimization was repeated three times to ensure consistent results. More stable results were obtained when VFA and pH were included in the cost function (C4 and C7). These results suggest that these output variables provide some stability to the estimation of fin, although the actual value of this parameter is underestimated (dashed line) and it is less sensitive compared to the 7-day moving block data (Figure 5, condition C4 and C7).
Figure 6

Substrate parameter values over a year of operation of the virtual digester estimated through the SPM tool using the daily data strategy. Dashed lines represent the exact values used in the simulation for data generation.

Figure 6

Substrate parameter values over a year of operation of the virtual digester estimated through the SPM tool using the daily data strategy. Dashed lines represent the exact values used in the simulation for data generation.

Close modal

When the second input parameter fsCOD/tCOD is incorporated, using only biogas as an output (C2), fin shows some sensitivity, and its estimated value is close to the actual one, whereas fsCOD/tCOD is not properly determined. Unlike the 7-day block strategy, fsCOD/tCOD is mostly stuck at the upper extreme of the optimization boundary, with random drops in its value. When the variables VFAs and pH are added to the cost function (C5 and C8), the estimation of the inlet parameters does not yield positive results, as a large dispersion of their values is obtained. This dispersion is more significant than that observed using the 7-day block strategy, where the sensitivity of the parameters was still visible and related to the operational events.

With the introduction of a third input parameter, fCH, the SPM demonstrates limitations in estimating trends in substrate properties correlated with the simulated operational conditions using daily estimation. This is especially noticeable for C6 and C9.

Key aspects and limitations

Several factors can affect the performance of this methodology. First, the mismatch between the HRT and the cadence of the data processing. Given that the HRT of digesters typically ranges from 30 to 35 days, the first data processing approach, based on a 7-day block of data, aims to leverage the inherent delay response and natural dynamics of the anaerobic digester process. AD processes are known to exhibit slower kinetics compared to aerobic activated sludge systems or high-rate anaerobic digesters such as upflow anaerobic sludge blanket (UASB) and expanded granular sludge bed (EGSB) reactors, which operate with HRTs in the order of hours. The daily data showed worse results as digesters may exhibit sensitivity to short-term variations in input (as noted from field experience by the author), this sensitivity alone does not appear to be adequate to reliably estimate unknown inputs.

A second aspect is the relationship between the number of outputs considered in the cost function and the number of inlet parameters being estimated. Including more outputs, such as ammonia or methane content could enhance the SPM's capacity to estimate additional inlet properties. A difficulty that arises is that these outputs are often not measured and if they are, they are not measured with the same frequency. Therefore, a post-processing data procedure needs to be assessed and implemented. A typical digester follow-up spreadsheet may contain the average data for a day of an online sensor and data points measured once a week or month to comply with regulations. In the cases where outputs such as, phosphate or H2S content are measured, model modifications would be required to include the biochemical reactions involved in generating these compounds, as the ADM1 does not currently incorporate these variables.

Overall, the SPM tool cannot accurately predict all the values of the inlet parameters characterizing the substrate, but it does show sensitivity to the variations in the data it uses as input (output data from the digester). A tool that can predict some properties of the substrate fed daily into the digester would be quite useful, as half of the recommendations for avoiding instabilities in the AD plant are related to the characteristics of the inlet conditions (Drosg 2013).

A novel methodology for estimating some properties of the substrate being fed to an anaerobic digester was developed and evaluated in this study. The methodology is based on the ADM1 model and an optimization procedure that adjusts substrate properties to minimize the difference between measured outputs. Three outputs and three substrate properties were assessed using two data collection and processing strategies: the 7-day moving block and daily data.

The 7-day moving block was demonstrated to be more effective in capturing the dynamic of the substrate properties affecting digester behavior, although averaging too much data could lead to unexpected results. A critical prerequisite for the effective application of this SPM is the prior comprehensive characterization of the digester through model calibration. Evaluating a set of different measured outputs could improve the estimation of inlet substrate properties, thereby enhancing the module's predictive capability.

All relevant data are included in the paper or its Supplementary Information.

The authors declare there is no conflict.

Batstone
D. J.
,
Keller
J.
,
Angelidaki
I.
,
Kalyuzhnyi
S. V.
,
Pavlostathis
S. G.
,
Rozzi
A.
,
Sanders
W. T. M.
,
Siegrist
H.
&
Vavilin
V. A.
2002
The IWA anaerobic digestion model No 1 (ADM1)
.
Water Science and Technology
45
,
65
73
.
Batstone
D. J.
,
Tait
S.
&
Starrenburg
D.
2009
Estimation of hydrolysis parameters in full-scale anaerobic digesters
.
Biotechnology and Bioengineering
102
(
5
),
1513
1520
.
Donoso-Bravo
A.
,
Mailier
J.
,
Martin
C.
,
Rodríguez
J.
,
Aceves-Lara
C. A.
&
Vande Wouwer
A.
2011
Model selection, identification and validation in anaerobic digestion: A review
.
Water Research
45
(
17
),
5347
5364
.
Drosg
B.
2013
Process Monitoring in Biogas Plants
.
IEA Bioenergy
,
Paris, France
, pp.
1
38
.
Kleerebezem
R.
&
Van Loosdrecht
M. C. M.
2006
Waste characterization for implementation in ADM1
.
Water Science and Technology
54
(
4
),
167
174
.
https://doi.org/10.2166/wst.2006.538
.
Morton
C.
&
Thompson
R.
2019
Global Potential of Biogas
.
World Biogas Association, London
.
Rosen
C.
&
Jeppsson
U.
2006
Aspects on ADM1 Implementation Within the BSM2 Framework 2, The IWA Benchmark Simulation Models
.
Department of Industrial Electrical Engineering and Automation, Lund University, Lund
,
Sweden
, pp.
1
35
.
Wu
D.
,
Li
L.
,
Zhao
X.
,
Peng
Y.
,
Yang
P.
&
Peng
X.
2019
Anaerobic digestion: A review on process monitoring
.
Renewable and Sustainable Energy Reviews
103
,
1
12
.
Wu
D.
,
Li
L.
,
Peng
Y.
,
Yang
P.
,
Peng
X.
,
Sun
Y.
&
Wang
X.
2021a
State indicators of anaerobic digestion: A critical review on process monitoring and diagnosis
.
Renewable and Sustainable Energy Reviews
148
,
111260
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY-NC-ND 4.0), which permits copying and redistribution for non-commercial purposes with no derivatives, provided the original work is properly cited (http://creativecommons.org/licenses/by-nc-nd/4.0/).