*2.7. Optimization Model Implementation*

The multi-objective optimization model was written in MATLAB® and successively implemented in mode FRONTIER® for scenario analysis. The selected parameters for the optimization process are summarized in Table 1. The range of modelled COD concentration was in line with the observed COD values in the analyzed territory, characterized by consistent wastewater dilution, due to mixed sewers and significant infiltrations from the aquifer. A wide range of treated flowrates was considered, to extend the validity of the obtained results to different scale WWTPs. The modelled flowrate range in WWTPs approximately corresponds to plant potentialities of 75,600–225,600 PE, consistent with most of medium scales WWTPs in Friuli-Venezia Giulia region (North-east of Italy). As for compressed air system characteristics, different combinations of pressure and volume were considered, to evaluate the influence of these parameters (both singularly and in combination) on the economic output.

**Table 1.** Selected input parameters considered in the multi-objective optimization model.


Separate simulations were conducted for scenario 1 (CAS integration without AD) and scenario 2 (CAS integration with AD). The relevant output parameters that were considered in the analysis were common economic indexes (PB, net present value (NPV)) and, in the case of scenario 2, meaningful environmental aspects (primary energy saving, PES). Since the main goal of this research was the implementation of a new technology in a WWTP following the DR perspective, the multi-objective optimization functions have been selected among those most representative from a sustainable perspective (Table 2). For the assessment of the economic advantages obtained through this intervention, the NPV maximization objective has been chosen. Regarding the environmental impact, the most meaningful objective was PES maximization.


**Table 2.** Selected output optimization functions considered in the multi-objective optimization model.

According to the stakeholders' interests, a constraint of 10 years has been applied to the PB output value.
