Implementing ADM1 for benchmark simulations in Matlab/Simulink C. Rosen * , D. Vrecko *,** , K.V. Gernaey * and U. Jeppsson * * Department of Industrial Electrical Engineering and Automation, Lund University, Box 118, SE-22100 Lund, Sweden. (E-mail: christian.rosen@iea.lth.se, krist.gernaey@iea.lth.se, ulf.jeppsson@iea.lth.se) ** Jozef Stefan Institute, Jamova 39, SI-1000 Ljubljana, Slovenia. (E-mail: darko.vrecko@ijs.si) Abstract The IWA Anaerobic Digestion Model No.1 (ADM1) was presented in 2002 and is expected to represent the state-of-the-art model within this field in the future. Due to its complexity and stiffness the implementation of the model is not a simple task and several computational aspects need to be considered, in particular if the ADM1 is to be included in dynamic simulations of plant- wide or even integrated systems. In this paper, the experiences gained from a Matlab/Simulink implementation of ADM1 into the extended COST/IWA Benchmark Simulation Model (BSM2) are presented. Aspects related to ODE vs DAE implementations, system stiffness and varying time constants, model interfacing with the ASM family, mass balances, acid-base equilibrium and algebraic solvers for pH and other troublesome state variables, numerical solvers and simulation time are discussed. The main conclusion is that if implemented properly, the ADM1 will produce high-quality results also in dynamic plant-wide simulations including noise, discrete sub-systems, etc. without imposing any major restrictions due to extensive computational efforts. Keywords ADM1; anaerobic digestion; benchmark; BSM2; modelling; simulation. INTRODUCTION A wastewater treatment plant should be considered as a unit, where all sub-processes are linked together and are operated and controlled not only on a local level as individual processes but by supervisory systems taking into account all the interactions between the processes. Otherwise, sub- optimisation will be an unavoidable outcome leading to reduced effluent quality and/or higher operational costs. The development of plant-wide modelling in the wastewater treatment field is attractive to many researchers as it provides a holistic view of the process and it allows for a more comprehensive understanding of the interactions between the various unit processes. Further, the impact of dynamic changes in the process can be explored as these changes relate to all unit processes that may be present in a treatment layout. Plant-wide modelling is an important tool for development and testing of new control and monitoring schemes for wastewater treatment. Substantial efforts have been directed towards the development of standardized simulation benchmarks, which allow for unbiased evaluation of different control strategies under realistic conditions. The development of the Benchmark Simulation Model no 1 (BSM1) (Copp, 2002) has proven successful and is today widely used in the research community as a benchmark system for the activated sludge process. As a continuation of that work, a plant-wide simulation benchmark (BSM2) is being developed that includes the most common unit processes in a treatment plant (Jeppsson et al., 2005). The BSM2 definition consists of the model, an associated control system, a benchmarking procedure and evaluation criteria. The model includes primary clarifier, a five-tank activated sludge system with a (non-reactive) secondary clarifier, a sludge thickener, an anaerobic digester and a dewatering unit (Figure 1). In contrast to BSM1, whose influent characteristics are provided as a data file, a model including urban drainage and sewer system effects (Gernaey et al., 2005) generates the influent wastewater characteristics.