Sewage treatment process prediction control method based on POD-LSTM
By applying POD-LSTM technology in sewage treatment, the system dimension is reduced and the MPC controller is designed, which solves the problems of high calculation cost of traditional control methods and is difficult to meet real-time control requirements, and realizes efficient sewage treatment process control .
Patent Information
- Application Number
- CN202411496824.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional sewage treatment process control methods, such as PID control and model predictive control (MPC), have problems such as high computational cost and difficult to meet real-time control requirements when dealing with complex nonlinear systems and multivariable coupled systems.
The sewage treatment process model prediction control method based on POD-LSTM is adopted, and the high-dimensional state space is reduced by eigen-orthogonal decomposition (POD) technology, a low-dimensional approximation model is constructed, and nonlinear approximation model is used to use LSTM neural network to perform nonlinear approximation modeling. , design MPC controller to achieve real-time optimization control.
It reduces the system's dimension and calculation cost, improves the control accuracy of the sewage treatment process, and can effectively track the set steady-state working points, providing a feasible and efficient pre-control strategy.
Smart Images

Figure CN119511699A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a sewage treatment process control method, and in particular to a sewage treatment process prediction control method based on POD-LSTM. Background Art
[0002] Wastewater Treatment Plants (WWTP) play an important role in treating urban and industrial wastewater, protecting the environment, improving public health, and promoting social and economic development. The wastewater treatment process involves multiple biochemical reactions and material transport processes, showing complex characteristics such as multivariable coupling, strong nonlinearity, and multiple constraints. Therefore, it is crucial to accurately control it to improve effluent quality and reduce energy consumption.
[0003] Traditional control methods, such as proportional-integral-derivative (PID) control, are widely used in sewage treatment processes due to their simplicity. However, PID control has many shortcomings when dealing with complex nonlinear systems and multivariable coupled systems, such as the difficulty in effectively handling dynamic constraints in the system and the lack of guarantee for optimal control performance. With the advancement of automated control technology, control technologies based on dynamic optimization, such as model predictive control (MPC), can achieve optimal control of current operations by predicting future system states in multi-constrained and multivariable systems, and have become an important method for solving multivariable optimization problems in sewage treatment processes. However, sewage treatment processes are usually described by a large number of nonlinear differential equations. For example, the benchmark simulation model BSM1 contains 145 state variables. When executing MPC control in each sampling period, a large-scale nonlinear optimization problem needs to be solved, resulting in high computational costs and difficulty in meeting real-time control requirements.
[0004] In order to reduce computational costs, model approximation methods have become a key strategy in recent years. They simplify models to approximate complex original systems, thereby reducing computational complexity. As an extension of model approximation methods, neural networks provide accurate modeling solutions for complex systems with their powerful nonlinear fitting capabilities and data-driven adaptability. However, when neural networks are used for data-driven modeling of large nonlinear systems such as WWTP, the number of neurons, the number of network layers, and the computational cost required for training will increase exponentially with the increase in the dimensions of input and output data. They may face the limitation of the curse of dimensionality, making it impossible for the obtained approximate model to fully reduce the computational cost of the MPC controller. Summary of the invention
[0005] The present invention proposes a model predictive control method for sewage treatment process based on POD-LSTM. The method reduces the high-dimensional state space of the sewage treatment system through the Proper Orthogonal Decomposition (POD) technology and constructs a low-dimensional approximate model to reduce the dimension and computational cost of the system. The LSTM neural network is used to perform nonlinear approximate modeling on the reduced-order model, and the MPC controller is designed to perform real-time optimization control on the key parameters of the sewage treatment process, so that the system output can track the set steady-state operating point, providing a feasible and efficient pre-control strategy.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] A sewage treatment process prediction control method based on POD-LSTM, the method comprising the following steps:
[0008] S1: Using the benchmark model BSM1 of the sewage treatment process, the state differential equation is constructed through the principle relationship of the mechanism model to generate the process state matrix X;
[0009] S2: The original benchmark wastewater treatment process with 145 state variables is reduced to construct a low-dimensional approximate process model using the proper orthogonal decomposition (POD) algorithm;
[0010] S3: Collect data, design a pseudo-random binary signal and apply it to the discretized first principle differential equation of sewage treatment, perform open-loop simulation to obtain open-loop dynamic response data of the sewage treatment process;
[0011] S4: preprocessing the collected data, including order reduction, and performing a maximum-minimum normalization (Max-Min normalization) operation on the reduced-order data, and then processing the normalized data using a sliding window method to generate training sample data for a deep learning model;
[0012] S5: Use data parameters to construct an LSTM model that approximates the low-latitude sewage treatment system;
[0013] S6: Combine the trained LSTM with a reduced-order neural network model and design an MPC controller based on it.
[0014] The sewage treatment process predictive control method based on POD-LSTM, the construction of the sewage treatment process state matrix specifically includes: by designing two control inputs K of the sewage treatment process L a5 and Q a Pseudo-random binary signals and their application to discretizing first principle differential equations for wastewater treatment To obtain the state matrix X of the sewage treatment process = [x(t1)x(t2)x(t3)…x(t N )].
[0015] The POD-LSTM-based sewage treatment process predictive control method uses the POD algorithm to reduce the order of the sewage treatment process, specifically including: performing singular value decomposition on the process state matrix, and the formula used is as follows:
[0016]
[0017] In the formula and are standard orthogonal vectors, respectively called left singular vectors and right singular vectors; is a diagonal matrix, each diagonal entry of the matrix is called a singular value; the singular values of X are non-negative numbers and are arranged in descending order, that is, σ1≥σ2≥···≥σ n The larger the value of σ, the more important the information present in the data captured by the basis vectors.
[0018] The POD-LSTM-based sewage treatment process predictive control method, the construction of the reduced-order model specifically includes: selecting a positive integer r less than the number of states n, using the first r singular values σ i That is, truncating Σ from the rth row and rth column to obtain the reduced-order matrix Therefore, select the first r columns of U and V T The first r rows of the matrix U r and A low-dimensional approximate system is obtained, and the formula used is as follows:
[0019]
[0020] make Then the reduced-order system model can be expressed as:
[0021]
[0022] where z(t) is an approximation of the state x(t) in a low-dimensional space consisting of the first r terms of the left singular vectors U of X, i.e.
[0023] The described POD-LSTM-based sewage treatment process predictive control method, the acquisition of the reduced-order data set specifically includes: using a PRBS input signal different from the generated snapshot matrix, and applying it to the discretized sewage treatment first principle differential equation, performing open-loop simulation to obtain the open-loop dynamic response of the sewage treatment process, and obtaining the state values at different times as open-loop data.
[0024] The method for predicting and controlling a sewage treatment process based on POD-LSTM, wherein the data preprocessing specifically includes: r The open-loop data is subjected to order reduction processing and the reduced-order data is subjected to Max-Min normalization operation. The formula used is as follows:
[0025] x norm =(xx min ) / (x max -x min )
[0026] Where x norm is the normalized value, x is the original value, and x min is the minimum value of the feature in the data set, x max It is the maximum value of the feature in the data set; the normalized data is divided into training set, validation set, and test set.
[0027] The POD-LSTM-based sewage treatment process predictive control method, the sliding window processing, specifically includes: selecting a fixed value K as the length of the window, and concentrating the data (T1, T2, T3, ..., T K ) The input and output data of the past K time steps are used as features, and the next time step (T K+1 ) as a label, making it a sample for LSTM neural network training, and then sliding the window along the time direction, taking the last data in the window as the previous prediction value, input the model again to get the prediction value of the next time node; and based on this principle, multiple groups of training samples are obtained.
[0028] The POD-LSTM-based sewage treatment process prediction and control method, the training LSTM neural network approximation model, specifically includes: adjusting the number of LSTM units, the training batch and the number of iterations, the number of network layers and the activation function to minimize the mean square error loss function.
[0029] The POD-LSTM-based sewage treatment process predictive control method, wherein the MPC controller is designed on the reduced-order neural network model, specifically comprises: under the condition of a given prediction range, the MPC controller is designed to track two outputs to an optimal steady-state point, the two outputs are slowly biodegradable and soluble substrates in the first reaction chamber and the second reaction chamber, represented as XS1 and XS2; tracking an optimal steady-state operating point (y s ,u s ) at a specific sampling time t i The tracking MPC expression under is optimized as follows:
[0030]
[0031] The above formula is the objective function, where N is a finite positive integer representing the prediction time domain, s(Δ) is a continuous piecewise function family with sampling time Δ, and y(t|t i ) and u(t|t i ) indicates the variable at the current time t i Prediction for future time t. Q is the weighted matrix of output deviation, R is the weighted matrix of input deviation, and P is the weighted matrix of terminal output deviation;
[0032]
[0033] The prediction of the above LSTM model is: The optimal control input is calculated by the MPC optimization algorithm and then inserted into the first principle differential equation to obtain the state trajectory and the reduced order state trajectory is obtained through the reduced order basis;
[0034]
[0035] The above formula is the time t i Initial condition values;
[0036] u(t)∈U
[0037] The above formula is the input constraint that needs to be satisfied within the entire prediction interval when solving the optimization problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic flow chart of a model predictive control method based on POD-LSTM provided in an embodiment of the present invention is shown;
[0039] Figure 2 A schematic diagram of a POD reduction process model construction process provided by an embodiment of the present invention is shown;
[0040] Figure 3 A schematic diagram of data preprocessing using a sliding window method provided by an embodiment of the present invention is shown;
[0041] Figure 4 A schematic diagram of the MPC controller design provided by an embodiment of the present invention is shown; DETAILED DESCRIPTION
[0042] For ease of understanding of the embodiments of the present application, some specific system structures and technical details are proposed in the following description, and these details are only used for illustration and not limitation. However, it should be understood by those skilled in the art that other embodiments of the present application can be implemented even without providing these specific details. In some cases, detailed descriptions of well-known systems, devices, circuits and methods are omitted to avoid unnecessary details interfering with the elaboration of the present application. Based on embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without carrying out creative work should belong to the protection scope of the present invention.
[0043] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0044] In order to solve the above technical problems, the embodiment of the present invention provides a model predictive control method for a sewage treatment process system based on POD-LSTM, and the flow chart is as follows: Figure 1 As shown, the method includes:
[0045] S1: Using the benchmark model BSM1 of the sewage treatment process, the state differential equation is constructed through the principle relationship of the mechanism model to generate the process state matrix X;
[0046] S2: The original benchmark wastewater treatment process with 145 state variables is reduced to construct a low-dimensional approximate process model using the proper orthogonal decomposition (POD) algorithm.
[0047] S3: Collect data, design pseudo-random binary signals and apply them to the discretized first principle differential equation of sewage treatment, and perform open-loop simulation to obtain the open-loop dynamic response of the sewage treatment process;
[0048] S4: preprocessing the collected data, including order reduction, and performing a maximum-minimum normalization (Max-Min normalization) operation on the reduced-order data, and then processing the normalized data using a sliding window method to generate training sample data for a deep learning model;
[0049] S5: Using offline data to train LSTM neural network to approximate the reduced-order model of sewage treatment process
[0050] S6: Combine the trained LSTM with a reduced-order neural network model and design an MPC controller based on it.
[0051] Specifically, in order to achieve model order reduction, the input vector u(k)=[K L a5,Q a The WWTP is stimulated by a pseudo-random binary signal (PRBS) of ]. The dynamic model of the WWTP is discretized with a sampling interval of 30 minutes, where KL The value of a5 is 19d-1 or 237d-1, Q a The value is 6567m3 / d or 91938m3 / d. For the two control inputs K L a5 and Q a The PRBS signal is designed and applied to the discretized first principle differential equation of sewage treatment to obtain the state snapshot matrix X of the sewage treatment process, which is expressed as:
[0052] X=[x(t1)x(t2)x(t3)···x(t N )]
[0053] in The snapshot matrix of process data is called the actual state at each sampling time, where n represents the number of state variables and N represents the number of sampling intervals. To ensure a sufficient number of samples, N is required to be much larger than n, that is, N>>n. The embodiment of the present application uses a pseudo-random binary signal of a control input as an input response signal of the sewage treatment system, so the method of obtaining the state snapshot matrix data does not constitute a limitation on the technical solution of the present application.
[0054] Further, in the embodiment of the present application, the process state snapshot matrix X is subjected to singular value decomposition (SVD) processing by the POD algorithm to decompose it into the product form of the obtained left singular vector U, the diagonal matrix ∑ and the right singular vector V, which is expressed as:
[0055]
[0056] in and are standard orthogonal vectors, respectively called left singular vectors and right singular vectors. is a diagonal matrix, and each diagonal entry of the matrix is called a singular value. The singular values of X are non-negative and arranged in descending order, that is, σ1 ≥ σ2 ≥ ··· ≥ σ n The larger the value of σ, the more important the information in the data captured by the basis vectors. Then, by selecting the reduced dimension r, the first r largest singular values in the singular value sequence are selected to retain the main dynamic information of the system. Specifically, starting from the r+1th row and r+1th column of the diagonal matrix ∑, only the first r singular values are retained, and a truncated diagonal matrix ∑ is obtained. r The corresponding intercepted singular vectors correspond to the selected first r singular values, and the first r columns are intercepted from the left singular vector matrix U to obtain the reduced-order left singular vector matrix U r ; Take the first r rows from the right singular vector matrix V to get the reduced right singular vector matrix
[0057] By choosing the matrix U r , diagonal matrix ∑ r and matrix A low-dimensional approximate system is obtained, and the formula used is as follows:
[0058]
[0059] make Then the reduced-order system model can be expressed as:
[0060]
[0061] where z(t) is an approximation of the state x(t) in a low-dimensional space consisting of the first r terms of the left singular vectors U of X, i.e.
[0062] The LSTM neural network is used to approximate the reduced-order sewage treatment system. First, two control inputs K L a5 and Q a A PRBS signal is designed and applied to the discretized first principle differential equation of sewage treatment. An open-loop simulation is performed to obtain the open-loop dynamic response of the sewage treatment process, and the state values at different times are obtained as open-loop data.
[0063] Use the simplest basis The obtained open-loop data set is passed through (r=25,30,35) to obtain the reduced-order data set. After normalizing the data set by the maximum and minimum values, the data set is divided into training set, validation set, and test set according to the ratio of (7:2:1). The divided data set is processed using a sliding window as follows Figure 3 As shown in the figure, the window length value K is set to 10, that is, the number of historical data to be referenced in the prediction process, and the historical data in the sliding window is input into the model to obtain the predicted value of the next time node of the window. Then the window is slid along the time direction, and the last data in the window is used as the previous predicted value. The model is input again to obtain the predicted value of the next time node. The data is reduced to the data of the past 10 time steps as the features of the samples for training the LSTM model through sliding window processing, and the data of the next time step is used as the label of the samples for training the LSTM model.
[0064] The long short-term memory (LSTM) network model was trained using the TensorFlow deep learning library. The optimal configuration of the model was determined by adjusting the number of network layers, the number of LSTM units, and the activation function. During the training process, the mean square error (MSE) was used as the loss function to measure the difference between the predicted state and the actual state in the training data set. To minimize the modeling error, the adaptive moment estimation algorithm (Adam) was used for optimization. The root mean square error (RMSE) was used as the performance evaluation indicator of the model. The precision and accuracy of the model were measured by calculating the difference between the observed value and the predicted value. The smaller the RMSE value, the better the fitting effect of the model.
[0065] Furthermore, an MPC controller is designed on the trained LSTM model of the approximate reduced-order sewage treatment system to control the sewage treatment process. In MPC, the control action is obtained by solving the finite-time optimal control problem online at each sampling time, where the initial state is the current state of the system. The optimization produces a finite control sequence, in which the first control action is applied to the system. The MPC controller is designed on the reduced-order neural network model, such as Figure 4 As shown, specifically, under the condition of a given prediction range, the MPC controller is designed to track two outputs to an optimal steady-state point, and the two outputs are slowly biodegradable and soluble substrates in the first reaction chamber and the second reaction chamber, represented by XS1 and XS2. Tracking an optimal steady-state operating point (y s ,u s ) at a specific sampling time t i The tracking MPC expression under is optimized as follows:
[0066]
[0067] The above formula is the objective function, where N is a finite positive integer representing the prediction time domain, s(Δ) is a continuous piecewise function family with sampling time Δ, and y(t|t i ) and u(t|t i ) indicates the variable at the current time t i Prediction for future time t. Q is the weighted matrix of output bias, R is the weighted matrix of input bias, and P is the weighted matrix of terminal output bias.
[0068]
[0069] The prediction of the above LSTM model is: The optimal control input is calculated by the MPC optimization algorithm and then inserted into the first principle differential equation to obtain the state trajectory and the reduced order state trajectory is obtained by the reduced order basis.
[0070]
[0071] The above formula is the time t i Initial condition value
[0072] u(t)∈U
[0073] The above formula is the input constraint that needs to be satisfied within the entire prediction interval when solving the optimization problem.
[0074] Finally, determine the prediction time domain length and preset control target of the MPC controller and set K L a5 and Q a The constraints of the two control inputs determine the weighted matrix Q of the output deviation, the weighted matrix R of the input deviation, the weighted matrix P of the terminal output deviation, etc. Specifically, the prediction time domain is set to 6, that is, N t =6, sampling time is 30min,, the output setting value is defined as XS1 = 96.7gCOD·m -3 and XS2 = 88.2 gCOD·m -3 , the input constraint is: 0≤Q a ≤5Q 0,stable [m 3 ·d -1 ]; 0≤K L a5≤240[d -1 ], where Q 0,stable =18446m 3 / d. The weight parameters are defined as Q = diag([100,100]), R = diag([100,100]), P = diag([900,900]). By solving the optimization problem, the optimal control input of the system is obtained.
[0075] It should be noted that the above embodiments do not limit the description of the present invention, and those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbols in brackets shall not be regarded as limiting the claims, and the term "comprising" or its variants shall not exclude the existence of elements or steps not listed in the claims, and relational terms such as "first" and "second" are only used to distinguish different entities or operations, and do not necessarily indicate an order or actual relationship, and may be interpreted as names.
[0076] Those skilled in the art will understand that, although some embodiments include some features of other embodiments but not other features, the feature combinations of different embodiments are still within the scope of protection of the present invention and may form different embodiments; without departing from the basic principles and spirit of the present invention, it is possible to make various changes, modifications, substitutions and variations to these embodiments, and any embodiment claimed for protection in the claims may be used in any combination, and the scope of protection of the present invention is defined by the attached claims and their equivalents.
[0077] The above content describes the present invention and its embodiments, but should not be regarded as limiting the present invention. The accompanying drawings show only a specific implementation of the present invention, and the actual structure is not limited thereto. In general, as long as a person skilled in the art, under the inspiration of the present invention, makes non-creative modifications or designs without departing from the spirit and basic principles of the present invention, and obtains a structure or implementation method similar to the present technical solution, it should be regarded as belonging to the protection scope of the present invention.
Claims
1. A predictive control method for sewage treatment process based on POD-LSTM, characterized in that: The method comprises the following steps: S1: Using the benchmark model BSM1 of the sewage treatment process, the state differential equation is constructed through the principle relationship of the mechanism model to generate the process state matrix X; S2: The original benchmark wastewater treatment process with 145 state variables is reduced to construct a low-dimensional approximate process model using the proper orthogonal decomposition (POD) algorithm; S3: Collect data, design a pseudo-random binary signal and apply it to the discretized first principle differential equation of sewage treatment, perform open-loop simulation to obtain open-loop dynamic response data of the sewage treatment process; S4: preprocessing the collected data, including order reduction, and performing a maximum-minimum normalization (Max-Min normalization) operation on the reduced-order data, and then processing the normalized data using a sliding window method to generate training sample data for a deep learning model; S5: Use data parameters to construct an LSTM model that approximates the low-latitude sewage treatment system; S6: Combine the trained LSTM with a reduced-order neural network model and design an MPC controller based on it.
2. A sewage treatment process prediction and control method based on POD-LSTM according to claim 1, characterized in that: The construction of the sewage treatment process state matrix specifically includes: designing two control inputs K of the sewage treatment process L a5 and Q a Pseudo-random binary signals and their application to discretizing first principle differential equations for wastewater treatment To obtain the state matrix X of the sewage treatment process = [x(t1) x(t2) x(t3)···x(t N )].
3. The sewage treatment process prediction control method based on POD-LSTM according to claim 1 is characterized in that: The POD algorithm is used to reduce the order of the sewage treatment process, specifically including: performing singular value decomposition on the process state matrix, and the formula used is as follows: In the formula and are standard orthogonal vectors, respectively called left singular vectors and right singular vectors; is a diagonal matrix, each diagonal entry of the matrix is called a singular value; the singular values of X are non-negative numbers and are arranged in descending order, that is, σ1≥σ2≥···≥σ n ; The larger the σ value, the more important the information in the data captured by the basis vector is.
4. A sewage treatment process prediction and control method based on POD-LSTM according to claim 3, characterized in that: The construction of the reduced-order model specifically includes: selecting a positive integer r less than the number of states n, using the first r singular values σ i That is, truncating Σ from the rth row and rth column to obtain the reduced-order matrix Therefore, select the first r columns of U and V T The first r rows of the matrix U r and A low-dimensional approximate system is obtained, and the formula used is as follows: Let x(t)≈U r z(t), Then the reduced-order system model can be expressed as: where z(t) is an approximation of the state x(t) in a low-dimensional space consisting of the first r terms of the left singular vectors U of X, i.e.
5. The sewage treatment process prediction control method based on POD-LSTM according to claim 1 is characterized in that: The acquisition of the reduced-order data set specifically includes: using a PRBS input signal different from that used to generate a snapshot matrix, and applying it to the discretized first-principle differential equation of sewage treatment, performing an open-loop simulation to obtain the open-loop dynamic response of the sewage treatment process, and obtaining state values at different times as open-loop data.
6. A sewage treatment process prediction control method based on POD-LSTM according to claim 1, characterized in that: The data preprocessing specifically includes the following steps: r The open-loop data is subjected to order reduction processing and the reduced-order data is subjected to Max-Min normalization operation. The formula used is as follows: x norm =(x-x min ) / (x max -x min ) Where x norm is the normalized value, x is the original value, and x min is the minimum value of the feature in the data set, x max It is the maximum value of the feature in the data set; the normalized data is divided into training set, validation set, and test set.
7. A sewage treatment process prediction and control method based on POD-LSTM according to claim 1, characterized in that: The sliding window processing specifically includes: selecting a fixed value K as the length of the window, and concentrating the data set (T1, T2, T3, ..., T K ) The input and output data of the past K time steps are used as features, and the next time step (T K+1 ) as a label, making it a sample for LSTM neural network training, and then sliding the window along the time direction, taking the last data in the window as the previous prediction value, input the model again to get the prediction value of the next time node; and based on this principle, multiple groups of training samples are obtained.
8. A sewage treatment process prediction and control method based on POD-LSTM according to claim 1, characterized in that: The training of the LSTM neural network approximation model specifically includes: adjusting the number of LSTM units, training batches and iterations, the number of network layers and the activation function to minimize the mean square error loss function.
9. The method for predicting and controlling a sewage treatment process based on POD-LSTM according to claim 1, characterized in that: The method of designing an MPC controller on a reduced-order neural network model specifically includes: under a given prediction range, the MPC controller is designed to track two outputs to an optimal steady-state point, the two outputs being slowly biodegradable and soluble substrates in the first reaction chamber and the second reaction chamber, represented by XS1 and XS2; tracking an optimal steady-state operating point (y s ,u s ) at a specific sampling time t i The tracking MPC expression under is optimized as follows: The above formula is the objective function, where N is a finite positive integer representing the prediction time domain, s(Δ) is a continuous piecewise function family with sampling time Δ, and y(t|t i ) and u(t|t i ) indicates the variable at the current time t i Prediction of future time t; Q is the weighted matrix of output deviation, R is the weighted matrix of input deviation, and P is the weighted matrix of terminal output deviation; The prediction of the above LSTM model is: The optimal control input is calculated by the MPC optimization algorithm and then inserted into the first principle differential equation to obtain the state trajectory and the reduced order state trajectory is obtained through the reduced order basis; The above formula is the time t i Initial condition values; u(t)∈U The above formula is the input constraint that needs to be satisfied within the entire prediction interval when solving the optimization problem.