A wastewater treatment MPC control trajectory target keeping projection method to a heterogeneous equipment constraint set
Patent Information
- Application Number
- CN202611370363.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-10-13
AI Technical Summary
这种异构性要求投影算法能够根据约束违反程度动态调整对控制目标的保持力度,而现有技术缺乏这种自适应机制
[0077](1)保持控制性能目标:通过提取MPC原始优化问题的全轨迹目标梯度向量,将其嵌入投影问题的目标函数中,使投影后的控制轨迹不仅满足物理约束,还保持与原始控制意图的一致性。相比传统最近点投影仅考虑几何距离,本发明在投影过程中保留了出水水质、能耗经济性等控制目标的优化方向,显著降低了投影对控制性能的损失。
Smart Images

Figure CN122902503A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automatic control technology for wastewater treatment, specifically relating to a method for projecting the wastewater treatment MPC control trajectory onto a set of constraints for heterogeneous equipment while maintaining a target. Background Technology
[0002] Model Predictive Control (MPC) is an advanced control strategy widely used in industrial process control. It achieves predictive regulation of multivariable systems by continuously optimizing the control trajectory in the future time domain. In the field of wastewater treatment, MPC can handle the coupling relationships between multiple operational variables (such as aeration rate, chemical dosage, and return flow rate) and consider the balance between effluent quality targets and energy consumption constraints, thus having significant application value.
[0003] However, the practical application of MPC in wastewater treatment faces severe constraints and feasibility issues. Wastewater treatment equipment has complex physical constraints, including upper and lower limits of actuator amplitude, action rate limits (equipment start-up and shutdown frequency constraints), and cumulative usage constraints in the prediction time domain (such as the upper limit of total dosage per shift). Mathematically, these constraints exhibit time-coupled characteristics: rate constraints correlate control quantities at adjacent times, and cumulative constraints globally restrict the control trajectory throughout the prediction time domain. If all physical constraints are fully modeled in the MPC optimization problem, the dimension of the constraint matrix will increase dramatically, making it difficult to meet real-time control requirements in online solution time.
[0004] To improve online computation speed, existing techniques typically simplify constraints in MPC optimization problems, such as retaining only magnitude constraints while ignoring rate constraints, or relaxing the modeling precision of cumulative constraints. While this simplification strategy speeds up the solution process, it can lead to control trajectories output by the MPC that violate real physical constraints, making them unsuitable for direct execution and posing safety risks in engineering practice.
[0005] To address the aforementioned constraint violation issues, traditional methods typically employ a nearest-point projection strategy, projecting the control trajectory violating the constraints to the nearest point within the feasible region. However, this projection method focuses solely on geometric distance, completely missing the control performance objective information inherent in the MPC optimization problem. Wastewater treatment MPC optimization objectives often involve a weighted trade-off of multiple dimensions, including effluent quality compliance, energy efficiency, and operational stability. Nearest-point projection significantly deviates from the original control intent, leading to degraded control performance. Particularly under time-coupled constraints (rate constraints, cumulative constraints), the projection process requires coordinating control adjustments across multiple time points, and traditional methods lack a goal-oriented mechanism for this time-dimensional coordination.
[0006] Furthermore, existing constraint handling methods do not adequately consider the heterogeneous constraint characteristics of different equipment types. In wastewater treatment systems, aeration equipment is mainly constrained by rate (frequent adjustments affect equipment lifespan), dosing equipment is mainly constrained by cumulative constraints (total amount of chemicals per shift is limited), and return pumps are constrained by both rate and cumulative constraints. This heterogeneity requires projection algorithms to dynamically adjust the strength of maintaining the control objective based on the degree of constraint violation, but existing technologies lack such an adaptive mechanism.
[0007] Therefore, how to maintain the optimization target characteristics of the original MPC control trajectory to the greatest extent possible while ensuring the feasibility of constraints, and effectively coordinate the adjustment of control quantities at multiple time points under time coupling constraints, is a technical problem that urgently needs to be solved in the application of MPC in wastewater treatment engineering. Summary of the Invention
[0008] To address the aforementioned technical problems, a sequential estimation method for physiological parameters based on combined information from multiple respiratory cycles is provided, specifically including the following steps:
[0009] 1. A method for projecting a wastewater treatment MPC control trajectory onto a constraint set of heterogeneous equipment while maintaining a target, characterized by comprising the following steps:
[0010] S1. Obtain the original control trajectory output by the MPC controller of the wastewater treatment system. ;
[0011] in, To predict the length of the time domain, For a moment The control vector of the MPC controller is used to ensure online solution speed when solving optimization problems by employing a simplified constraint model.
[0012] S2. Obtain the actual physical constraint set of each heterogeneous actuator in the wastewater treatment system. The real physical constraints include the device's amplitude hard constraints, time-related rate constraints, and cumulative constraints in the prediction time domain. The real physical constraints are more stringent than the simplified constraint model inside MPC or include real-time change constraints that are not considered when solving MPC.
[0013] S3 Extracts the MPC Optimization Objective Function In the original trajectory The full trajectory target gradient vector at [location] ;
[0014] The full trajectory target gradient vector is: A dimensional vector, where The dimension of the control vector at a single time moment is the dimensionality of the target gradient vector across the entire trajectory. Each block Characterizing time The degree of influence of the control quantity on the overall optimization objective;
[0015] S4 detects violations of the original control trajectory under real physical constraints at each time step. and each device Calculate the amount of constraint violation ,when Time indicates the moment. In the equipment There is a constraint violation;
[0016] If there are no constraint violations at any time on all devices, S5 will directly output the original control trajectory. Otherwise, proceed to step S6;
[0017] S6 constructs a target-preserving projection problem that simultaneously imposes a set of constraints across the entire prediction time domain and coordinates the projection directions at each time step using the target gradient vector across the entire trajectory: ;
[0018] satisfy:
[0019] ;
[0020] ;
[0021] ;
[0022] The first term is the projection distance minimization term, and the second term is the target preservation term. For vector dot product operation, The weighting coefficients are maintained for the target; the rate constraint equation reflects the temporal coupling relationship, i.e., time... The projection will affect the time through this constraint. The feasible region; the cumulative constraint equations embody the budget coupling relationship, i.e., the preceding... The projection at a given moment will affect the available budget at subsequent moments through this constraint;
[0023] S7 performs a global solution to the target-preserving projection problem to obtain the projected control trajectory. The global solution process implicitly encodes the importance weights of each time step through the full trajectory target gradient vector, so that when there is a conflict in the propagation of temporal constraints, the time step with the larger gradient is protected first.
[0024] S8 outputs the projected control trajectory Execution is performed on various heterogeneous execution devices.
[0025] In step S1, the simplified constraint model adopted by the MPC controller includes at least one of the following cases:
[0026] (1) Use the relaxed upper and lower limits of the device constraint instead of the real hard constraint, and the boundary of the relaxed upper and lower limits has a safety margin from the boundary of the real hard constraint.
[0027] (2) Ignore the rate constraints or cumulative constraints of some devices to reduce the complexity of the optimization problem;
[0028] (3) It does not include constraint changes that occur temporarily during execution, including additional restrictions caused by equipment failure, temporary disablement during maintenance, or dynamic limits adjusted according to real-time operating conditions.
[0029] In step S3, the full trajectory target gradient vector The extraction method is as follows:
[0030] When the MPC optimization objective function is a quadratic objective function At that time, among them For system output, For reference trajectory, and The weight matrix is the target gradient vector of the entire trajectory obtained by applying the weights to the original trajectory. Taking the partial derivative yields: ;
[0031] in The sensitivity matrix of the system output to the control input is calculated using the prediction model within the MPC.
[0032] In step S4, the constraint violation amount The calculation method is as follows:
[0033] For equipment At any moment Amplitude constraints ;
[0034] The amplitude violation amount is: ;
[0035] For equipment At any moment Rate constraints ;
[0036] The rate violation is: ;
[0037] For equipment Cumulative constraints in the prediction time domain ;
[0038] The cumulative number of violations is: ;
[0039] The time In the equipment The total number of constraint violations is: ;
[0040] In step S6, the target maintains the weight coefficients. The constraint violation is adaptively determined based on the degree of constraint violation across the entire trajectory: ;
[0041] in As the benchmark weighting coefficient, For sensitivity parameters, The sum of constraint violations across the entire trajectory and all devices. This represents the sum of the control magnitudes of the original trajectory; when the proportion of the constraint violation to the control magnitude increases... Increase the size to better maintain the optimization target and avoid excessive deviation of the projection from the optimization intent of MPC.
[0042] In step S7, the global solution employs a sequential quadratic programming method, specifically including:
[0043] S7.1. Initialize iteration variables Number of iterations ;
[0044] S7.2. At the current iteration point At this point, the rate constraint and accumulation constraint are linearized to construct a quadratic programming subproblem:
[0045] ;
[0046] satisfy: ;
[0047] ; ;
[0048] in For rate constraints The linearization coefficient at the point, For cumulative constraints The linearization coefficient at the point;
[0049] S7.3. Solve the quadratic programming subproblem to obtain a new iteration point. ;
[0050] S7.4. Determine the convergence condition If the maximum number of iterations is reached, then output the result. ;
[0051] Otherwise Then return to step S7.2.
[0052] In step S7, the full trajectory target gradient vector The mechanism by which this process works in the global solution process is as follows:
[0053] At that moment The projection causes the moment When the feasible region shrinks, if ;
[0054] The optimization problem tends to involve more adjustment times. The control variable satisfies the constraints, thereby protecting moments with larger gradients. ;
[0055] When cumulative constraints lead to the previous When the projection at a given moment encroaches on the available budget at subsequent moments, the target preservation term... ;
[0056] It will guide the projection direction to consume more budget when the gradient is small and retain the budget when the gradient is large, thereby coordinating the budget allocation across the entire prediction time domain.
[0057] After step S8, the method further includes:
[0058] S9. Calculate the objective function value of the projected control trajectory. Objective function value of the original trajectory Differences:
[0059] ;
[0060] S10. Determine the difference in the objective function values. Does it exceed the preset target degradation threshold? ;
[0061] S11. If ;
[0062] Then, an over-constraint alarm signal is sent to the upper-level decision module, indicating that the difference between the current real physical constraints and the simplified constraint model of MPC is too large, and suggesting recalibrating the constraint model inside MPC or relaxing the temporary constraints of some devices; if Then the projection control trajectory will be executed normally.
[0063] And a wastewater treatment MPC control trajectory target holding projection system, comprising:
[0064] The MPC controller module is used to generate the original control trajectory using a simplified constraint model based on the prediction model and optimization objective function of the wastewater treatment process. It outputs the full trajectory target gradient vector corresponding to the original trajectory. ;
[0065] The Real Constraint Library module stores the set of real physical constraints for each heterogeneous actuator in the wastewater treatment system. The real physical constraints include amplitude hard constraints, rate constraints and cumulative constraints. The real physical constraints are more stringent than the simplified constraint model inside MPC or include constraints that change in real time.
[0066] The constraint violation detection module is used to receive the original control trajectory. and the set of real physical constraints Calculate the constraint violation amount of each device at each time point. And determine whether projection needs to be performed;
[0067] The target-preserving projection solver module is used to receive the original control trajectory. The full trajectory target gradient vector and the set of real physical constraints Construct and solve the target-preserving projection problem, and output the control trajectory after projection. ;
[0068] Its features are:
[0069] The projection problem solved by the target-preserving projection solver module is simultaneously subject to rate constraints and cumulative constraints in the entire prediction time domain. The rate constraints reflect a temporal coupling relationship, and the cumulative constraints reflect a budget coupling relationship.
[0070] The objective function of the projection problem includes a distance minimization term. Keep the target item ;
[0071] The full trajectory target gradient vector It implicitly encodes the degree of influence of each time step on the optimization objective, so that the global solution process prioritizes protecting the time step with the larger gradient when there are conflicts in the propagation of time constraints.
[0072] It also includes a target degradation monitoring module, which is used for:
[0073] Calculate the control trajectory after projection Compared with the original control trajectory Difference in objective function values ;
[0074] When the difference exceeds a preset threshold, an over-constraint alarm signal is generated, indicating that the difference between the MPC simplified constraint model and the real physical constraints is too large;
[0075] The alarm signal is sent to the MPC controller module to trigger the recalibration process of the constraint model.
[0076] Compared with the prior art, the present invention has the following beneficial effects:
[0077] (1) Maintaining control performance objectives: By extracting the full trajectory objective gradient vector of the original MPC optimization problem and embedding it into the objective function of the projection problem, the projected control trajectory not only satisfies physical constraints but also maintains consistency with the original control intent. Compared with traditional nearest-point projection, which only considers geometric distance, this invention retains the optimization direction of control objectives such as effluent water quality and energy consumption economy during the projection process, significantly reducing the loss of control performance caused by projection.
[0078] (2) Improve the feasibility assurance capability of constraints: A two-layer architecture is adopted to separate the online computing burden. The MPC layer uses a simplified constraint model to achieve fast solution, while the projection layer performs accurate correction for the real physical constraints. The constraint set modeling of the projection layer covers the upper and lower limits of actuator amplitude, the rate limit of adjacent time moments, and the cumulative usage limit in the prediction time domain, ensuring that the control commands output to the execution device strictly meet all physical constraints and eliminating the engineering risks brought about by constraint simplification.
[0079] (3) Effective Coordination of Temporal Coupling Constraints: Addressing the coupling between adjacent time points caused by rate constraints and the full-time-domain coupling caused by cumulative constraints, this invention solves the time-coupled projection problem using a sequential quadratic programming algorithm. This ensures both local rate constraints and global cumulative constraints, achieving coordinated optimization of control quantity adjustments across multiple time points. The sensitivity matrix information contained in the target gradient vector enables the projection process to identify differences in the contribution to the control target at different times, prioritizing the protection of control quantities at times with a greater impact on the target.
[0080] (4) Adaptive adjustment of target holding strength: Through an adaptive weight coefficient mechanism driven by constraint violation, the weight ratio of the target holding term and the distance term is dynamically adjusted according to the degree of violation of the current control trajectory. When the constraint violation is severe, the weight coefficient increases, and the projection algorithm focuses more on maintaining the control target; when the constraint violation is slight, the weight coefficient decreases, and the projection algorithm focuses on fast regression to the feasible region. This adaptive mechanism takes into account both the strictness of constraint satisfaction and the preservation of control performance.
[0081] (5) Adapting to the constraints of heterogeneous equipment: This invention addresses the constraints of different equipment types in wastewater treatment systems. For aeration equipment, the focus is on treatment rate constraints to avoid frequent adjustments; for dosing equipment, the focus is on cumulative constraints to control the dosage per shift; for return pumps, both treatment rate and cumulative constraints are addressed. The projection algorithm, through a unified constraint set expression framework, can flexibly adapt to heterogeneous constraint combinations of different equipment.
[0082] (6) Maintaining online computational efficiency: Compared to directly modeling complete constraints in the MPC optimization problem (which leads to an exponential increase in solution time), this invention shifts the constraint processing task to the projection layer. The objective function of the projection problem is a simple quadratic form, and the constraints are linear inequalities, which have significantly lower computational complexity than the original MPC problem. The separation of computational burden in the two-layer architecture enables the system to meet real-time requirements while ensuring constraint feasibility and control performance.
[0083] In summary, this invention, through target-preserving projection mechanism, time-coupled coordination processing, and adaptive weight adjustment, maximizes the preservation of the original control performance target while ensuring that the MPC control trajectory of wastewater treatment strictly meets physical constraints, thus providing an effective technical solution for the engineering application of automatic control in wastewater treatment. Attached Figure Description
[0084] Figure 1 This is an overall flowchart of the physiological parameter sequential estimation method based on multi-respiratory cycle joint information of the present invention. Detailed Implementation
[0085] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0086] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0087] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0088] Example 1
[0089] This embodiment provides a complete application example of a target-preserving projection method for wastewater treatment MPC control trajectory to a heterogeneous device constraint set. It demonstrates the entire process from the output of the original trajectory by the MPC controller to the output of the projected trajectory to the execution device, and elaborates in detail how the target gradient vector coordinates the temporal coupling constraints during the projection process.
[0090] A municipal wastewater treatment plant uses the activated sludge process to treat combined wastewater discharged from an industrial park, with a treatment capacity of 10,000 cubic meters per day. The primary control objectives are to ensure that the effluent's chemical oxygen demand (COD) and ammonia nitrogen concentrations meet the national Class A discharge standards, while minimizing energy and chemical costs. The plant's control system is equipped with a Model Predictive Controller (MPC) to coordinate the actions of multiple actuators to achieve these control objectives. The control cycle is set to 2 hours, and the MPC's prediction time domain is set to 6 control cycles, i.e., the next 12 hours. This setting means that at the beginning of each control cycle, the MPC optimizes the control trajectory for the next 12 hours based on the current state and influent water quality predictions, but only executes the actions for the first control cycle. It then re-optimizes at the start of the next control cycle, forming a rolling time-domain optimization mechanism.
[0091] This wastewater treatment system comprises three types of heterogeneous actuators, whose physical characteristics and constraint sets differ significantly. The first type is the aeration equipment, which uses a Roots blower to supply oxygen to the aeration tank; the controlled quantity is the aeration flow rate, denoted as... The unit is cubic meters per minute. The actual physical constraints of this equipment include: amplitude constraints are... The flow rate is set at cubic meters per minute, with the lower limit of 5 determined by the minimum stable operating flow rate of the blower, and the upper limit of 30 determined by the rated power of the blower and the dissolved oxygen saturation limit of the aeration tank. The rate constraint is that the absolute value of the flow rate change between adjacent control cycles does not exceed 3 cubic meters per minute. This constraint stems from the mechanical inertia of the blower and the response speed limitations of the inlet and outlet valves; rapid changes in flow rate can lead to pipe vibration and equipment wear. There is no cumulative constraint on this equipment because aeration is a continuously energy-consuming process and does not involve material storage.
[0092] The second category is dosing equipment, which uses metering pumps to add polyaluminum chloride (PAC) to the biological treatment tank to enhance phosphorus removal. The controlled dosage is the dosage within a single control cycle, denoted as... The unit is kilograms. The actual physical constraints of this device include: amplitude constraints are... The dosage is capped at kilograms, with a lower bound of 0 indicating no dosage is required and an upper bound of 15 determined by the maximum single output of the metering pump and the saturated concentration of the pesticide in the biological treatment tank. The rate constraint is that the absolute value of the dosage change between adjacent control cycles does not exceed 5 kilograms. This constraint stems from the tolerance of microorganisms in the biological treatment tank to sudden changes in reagent concentration; drastic fluctuations in dosage can inhibit microbial activity, leading to a decrease in treatment efficiency. The cumulative constraint is that the total dosage over the six control periods in the prediction time domain should not exceed 60 kg. This constraint stems from the limitations of the drug storage tank capacity and the procurement cycle. The tank capacity is 100 kg, the current remaining quantity is 60 kg, and the next drug delivery is expected to arrive in 12 hours. Therefore, the total amount of drug available within the forecast time domain is limited. The existence of this cumulative constraint causes the drug dosage decisions at each time point to be coupled, with the dosage at earlier time points crowding out the available budget at later time points.
[0093] The third type is the reflux pump equipment, used to reflux the effluent from the secondary sedimentation tank back to the anoxic tank to provide the nitrate nitrogen required for denitrification. The controlled quantity is the reflux flow rate, denoted as... The unit is cubic meters per hour. The actual physical constraints of this equipment include: amplitude constraints are... The flow rate is defined as cubic meters per hour, with a lower limit of 50 determined by the minimum recirculation ratio required to maintain denitrification in the anoxic tank, and an upper limit of 200 determined by the rated flow rate of the recirculation pump and the volume limit of the anoxic tank. The rate constraint is that the absolute value of the flow rate change between adjacent control cycles does not exceed 40 cubic meters per hour. This constraint stems from the impact of frequent pump start-stop cycles on the motor and the effects of hydraulic impact on the pipeline. There are no cumulative constraints on this equipment.
[0094] The MPC controller employs a simplified constraint model to ensure fast online solution, a common practice in actual MPC deployments for wastewater treatment. For aeration equipment, the amplitude constraints within the MPC are set as follows: The rate constraint is cubic meters per minute. Compared to the real hard constraint, which leaves a safety margin of 2 cubic meters per minute at both ends, the rate constraint is not explicitly modeled within MPC to reduce the complexity of the optimization problem.
[0095] For dosing equipment, the amplitude constraint inside the MPC is set as follows: The cumulative constraint is set to a total dosage of no more than 70 kg within the prediction time domain, which is 10 kg less than the actual constraint to improve the feasibility of the MPC optimization problem. The rate constraint is not explicitly modeled within the MPC. For the reflux pump equipment, the constraints within the MPC are consistent with the actual constraints. The above simplified constraint model reduces the number of constraints in the MPC optimization problem from 54 (6 time points × 3 devices × 3 constraint types) including all actual constraints to 30 (18 amplitude constraints + 1 relaxed cumulative constraint + 11 other auxiliary constraints). On an industrial control computer configured with an Intel i7 processor and 8GB of memory, the solution time for a single MPC optimization problem is reduced from 4.5 seconds including all actual constraints to 0.8 seconds.
[0096] The MPC controller uses a weighted combination of an economic objective function and a tracking objective function. The economic objective function reflects operating costs, while the tracking objective function reflects the degree to which the treated water quality meets standards. Specifically, it takes the following form:
[0097] ;
[0098] in For a moment The control vector, , For a moment The system output vectors represent the effluent COD concentration, effluent ammonia nitrogen concentration, and dissolved oxygen concentration in the aeration tank, respectively. The reference trajectory vector is set as follows. The reference values for COD and ammonia nitrogen correspond to the upper limit of the national Class A emission standard. The dissolved oxygen setting value of 2.5 mg / L is the empirical optimal value for the activated sludge process. Too low a value will lead to insufficient microbial activity, while too high a value will result in energy waste.
[0099] The output weight matrix is set as follows This weighting configuration reflects that the environmental risks and economic penalties (unit price of fines) for exceeding ammonia nitrogen standards are higher than those for exceeding COD standards, while the penalties for deviating from the set value for dissolved oxygen are relatively smaller. The control weight matrix is set as follows: This weighting configuration reflects that the cost of chemicals is higher than the cost of electricity, so the optimization process tends to adjust aeration and recirculation more to reduce the dosage of chemicals.
[0100] System output With control input The relationships between them are established through a predictive model. This predictive model adopts a linearized state-space model form, which is obtained by linearizing the nonlinear activated sludge model near the current operating point. Specifically, the system state includes five state variables: COD concentration, ammonia nitrogen concentration, dissolved oxygen concentration, nitrate nitrogen concentration, and activated sludge concentration in the aeration tank. The state-space form of the predictive model is as follows: The output equation is ,in Here is the state transition matrix. To control the input matrix, The perturbation input matrix is... This is the influent water quality disturbance vector (including predicted values of influent COD, influent ammonia nitrogen, and influent flow rate). This is the output matrix. In this embodiment, the matrix... The specific values were obtained offline from historical operating data using a system identification method. These values will not be elaborated upon here, but it is worth noting the sensitivity matrix of the system output to the control input. It can be directly calculated using this linearized model.
[0101] At the start of a certain control cycle, the measured aeration tank conditions are: COD concentration 80 mg / L, ammonia nitrogen concentration 12 mg / L, and dissolved oxygen concentration 2.0 mg / L. Influent water quality prediction indicates that over the next 12 hours, the influent COD concentration will gradually increase from the current 300 mg / L to 400 mg / L, and the ammonia nitrogen concentration will increase from the current 40 mg / L to 55 mg / L. This corresponds to a typical pattern of increased production activity in industrial parks during the daytime. Based on the current conditions, influent prediction, and optimization objective function, the MPC controller solves the optimization problem under a simplified constraint model to obtain the original control trajectory. uMPC. This trajectory contains control variables for the next 6 control cycles, specifically:
[0102] Time 1: ;
[0103] Time 2: ;
[0104] Time 3: ;
[0105] Time 4: ;
[0106] Time 5: ;
[0107] Time 6: ;
[0108] The physical meaning of this trajectory is that MPC predicts peak influent loads at times 3 and 4 (approximately 4-8 hours in the future). Therefore, at these two times, the aeration flow rate is significantly increased to 25.5 and 28.0 cubic meters per minute, and the chemical dosage is increased to 13.8 and 15.0 kilograms, respectively, to ensure that the effluent quality still meets standards under load shocks. Times 1 and 2 are the preparation phase for the load increase, and the control parameters are moderately increased. Times 5 and 6 are the recovery phase for the load decrease, and the control parameters are gradually reduced. This trajectory is feasible under the simplified constraint model within MPC, but it is violated under real physical constraints.
[0109] Following step S1, after obtaining the original control trajectory, the process proceeds to step S2 to obtain the actual physical constraint set for each heterogeneous actuator. The actual physical constraints have been described in detail above; here they are presented in mathematical form as a constraint set. (Constraint set for aeration equipment) Including amplitude constraints and rate constraints | Constraint set of dosing equipment Including amplitude constraints Rate constraints Cumulative constraints Constraint set of the reflux pump equipment Including amplitude constraints and rate constraints These real constraints are more stringent than the simplified constraints within MPC or contain constraint types not modeled by MPC (such as precise limits for rate constraints and cumulative constraints).
[0110] Proceed to step S3, extract the full trajectory target gradient vector of the MPC optimization objective function at the original trajectory. Based on the quadratic structure of the objective function, at time... Target gradient block of t The calculation is as follows:
[0111] ;
[0112] The formula contains two terms. The first term... To control the gradient of the cost term, it is shown that increasing the control quantity directly increases operating costs. The second term... To track the gradient of the error term, we can see how increasing the control input reduces the tracking error penalty by improving effluent quality. The algebraic sum of the two terms determines the marginal benefit of the control input at that moment: a positive gradient means that increasing the control input at that moment will increase the objective function (deteriorate performance), while a negative gradient means that increasing the control input will decrease the objective function (improve performance). The norm of the gradient... This reflects the sensitivity of the control quantity to the overall objective function at that moment. The larger the gradient norm, the more significant the impact of a small change in the control quantity at that moment on the objective function.
[0113] Now we calculate the specific values of the target gradient at each time step. Taking time step 3 as an example, we will explain the calculation process in detail. The control vector at time step 3 is... The first control cost gradient is:
[0114] ;
[0115] The second tracking error gradient needs to be calculated first from the system output. and sensitivity matrix According to the prediction model within MPC, the predicted output at time 3 under the original trajectory is: (COD slightly exceeds the standard, ammonia nitrogen exceeds the standard, dissolved oxygen is slightly higher than the set value). Output deviation is... Sensitivity matrix The physical meaning of this matrix is the influence coefficient of the control variable change at time 3 on the output at time 3. This matrix is calculated using the state-space form of the prediction model. Specifically, increasing the aeration flow rate by 1 cubic meter per minute will increase dissolved oxygen by approximately 0.15 mg / L, accelerate the COD degradation rate, thereby reducing effluent COD by approximately 0.8 mg / L, and have a smaller impact on ammonia nitrogen, reducing it by approximately 0.3 mg / L; increasing the dosage by 1 kg will reduce COD by approximately 1.2 mg / L through flocculation and sedimentation, with a smaller impact on ammonia nitrogen and dissolved oxygen; increasing the return flow rate by 1 cubic meter per hour will increase the nitrate nitrogen supply in the anoxic tank, thereby reducing ammonia nitrogen by approximately 0.02 mg / L, with minimal impact on COD and dissolved oxygen. This is summarized as a sensitivity matrix:
[0116] ;
[0117] The first row corresponds to the sensitivity of COD to each control variable (the negative sign indicates that increasing the control variable will decrease COD), the second row corresponds to ammonia nitrogen, and the third row corresponds to dissolved oxygen. Now calculate the gradient of the second term:
[0118] ;
[0119] Therefore, the target gradient at time 3 is:
[0120] ;
[0121] The physical meaning of this gradient vector is as follows: Increasing the aeration flow rate and dosage at time 3 will significantly reduce the objective function value (the gradient is negative and the absolute value is large). This is because time 3 corresponds to the peak influent load, and increasing these two control variables can significantly improve the effluent quality, thereby reducing the tracking error penalty. The benefits far outweigh the increase in control costs. Increasing the return flow rate has a smaller marginal benefit (the gradient is positive) because the main issues at time 3 are COD and dissolved oxygen, while the return flow rate mainly affects ammonia nitrogen, and the current ammonia nitrogen exceedance is not severe. The gradient norm is:
[0122] ;
[0123] The target gradient norm at other time points was calculated using a similar method. Detailed calculations are omitted; only the results are presented below. , , , , The gradient norm peaks at times 3 and 4, at 680.2 and 750.8 respectively, corresponding to the peak inflow load periods. The control variables at these two times have the greatest impact on the overall objective function. The gradient norm is lowest at time 1, at 185.3, corresponding to the initial period of lower load. This gradient norm distribution will play a crucial role in the subsequent projection process: when the projection requires adjusting the control variables to meet constraints, times with smaller gradient norms will bear more of the adjustment, while critical times with larger gradient norms will be prioritized for protection.
[0124] Proceed to step S4 to detect violations of the original control trajectory under real physical constraints. Check the constraints of each device at each time point one by one.
[0125] Regarding the amplitude constraints of the aeration equipment, the aeration flow rates at times 1 to 6 are 18.5, 22.0, 25.5, 28.0, 26.0, and 20.0 cubic meters per minute, respectively, all of which meet the requirements. The amplitude constraint, therefore the amplitude violates the quantity. ;
[0126] For rate constraints on aeration equipment, it is necessary to check the flow rate changes between adjacent time points. Assuming the aeration flow rate at the end of the previous control cycle was 16.0 cubic meters per minute (this value is read from historical data), then the change at time 1 relative to the previous cycle is: cubic meters per minute, not violating rate constraint 3.
[0127] The change at time 2 relative to time 1 is cubic meters per minute, exceeding the rate constraint of 3, the rate violation is... cubic meters per minute.
[0128] The change at time 3 relative to time 2 is cubic meters per minute, the rate violation amount is cubic meters per minute.
[0129] The change at time 4 relative to time 3 is The flow rate is cubic meters per minute, which does not violate the rate constraint.
[0130] The change at time 5 relative to time 4 is as follows The flow rate is cubic meters per minute, which does not violate the rate constraint.
[0131] The change at time 6 relative to time 5 is as follows cubic meters per minute, exceeding the rate constraint of 3, the rate violation is... cubic meters per minute.
[0132] The aeration equipment violated the rate constraint at times 2, 3, and 6.
[0133] Regarding the amplitude constraints of the dosing equipment, the dosage amounts at times 1 to 6 are 8.2, 11.5, 13.8, 15.0, 12.5, and 9.0 kg, respectively. The dosage amount of 15.0 kg at time 4 just reaches the upper limit of the amplitude constraint, which is not violated but has no safety margin.
[0134] For the rate constraint of the dosing equipment, assuming the dosage in the previous control cycle was 7.0 kg, then the change at time 1 relative to the previous cycle is: kilograms, not violating rate constraint 5.
[0135] The change at time 2 relative to time 1 is Kilograms, no violation of rate constraints.
[0136] The change at time 3 relative to time 2 is Kilograms, no violation of rate constraints.
[0137] The change at time 4 relative to time 3 is Kilograms, no violation of rate constraints.
[0138] The change at time 5 relative to time 4 is as follows Kilograms, no violation of rate constraints.
[0139] The change at time 6 relative to time 5 is as follows Kilograms, no violation of rate constraints.
[0140] The amplitude and rate constraints of the dosing equipment are both satisfied.
[0141] For the cumulative constraint of the dosing equipment, the total dosage is predicted over 6 time-domain periods. The cumulative violation amount is 60 kg, exceeding the cumulative constraint limit. kilogram.
[0142] The physical meaning of this violation is: if the original trajectory is followed, 70 kg of reagent will be consumed in the predicted time domain, but the current tank only has 60 kg remaining, which will cause the reagent to run out at a certain point in the execution and cannot be added again.
[0143] The calculation of cumulative violations can be decomposed into time intervals, time intervals... The cumulative number of violations is:
[0144] ;
[0145] The physical meaning of this formula is before inspection. Does the cumulative dosage at any given time exceed the amount that should be allocated to the first few according to the principle of uniform distribution? Budget share at each moment.
[0146] Calculate the cumulative violation at each time point: Time 1 is... ;
[0147] Time 2 is ;
[0148] Time 3 is ;
[0149] Time 4 is ;
[0150] Time 5 is ;
[0151] Time 6 is .
[0152] It can be seen that the accumulated violations gradually become apparent starting from time 3, and reach the maximum accumulated violation amount of 11.0 kg at time 5.
[0153] For the reflux pump equipment, assuming the reflux flow rate in the previous control cycle was 110 cubic meters per hour, the reflux flow rates from time 1 to time 6 are 120, 150, 165, 175, 160, and 130 cubic meters per hour respectively, all of which satisfy the amplitude constraint. Rate constraint check: The change at time 1 relative to the previous period is The flow rate was cubic meters per hour, which did not violate the rate constraint of 40.
[0154] The change at time 2 relative to time 1 is The flow rate is cubic meters per hour, which does not violate the rate constraint.
[0155] The adjacent variations from time 3 to 6 are 15, 10, 15, and 30 cubic meters per hour, respectively, none of which violate the rate constraint. All constraints of the reflux pump equipment are satisfied.
[0156] Summary of constraint violations: The aeration equipment had rate constraint violations at times 2, 3, and 6, with violations of 0.5, 0.5, and 3.0 cubic meters per minute, respectively; the dosing equipment had cumulative constraint violations, with a total violation of 10.0 kg, and the cumulative violations gradually appeared starting from time 3; the return pump equipment had no constraint violations.
[0157] Since there is a constraint violation, the judgment condition of step S5, "there is no constraint violation at all times on all devices", is not met, and the process proceeds to step S6 to construct the target-preserving projection problem.
[0158] Before constructing the projection problem, it is necessary to determine the objective preservation weights. The weighting coefficients are adaptively determined based on the degree of constraint violation across the entire trajectory.
[0159] Calculate the total constraint violation amount across the entire trajectory and all equipment: The total rate violation amount of the aeration equipment is... The cumulative violation of the dosing equipment is 10.0 kg per cubic meter per minute (cumulative violations at different times are not counted repeatedly, as cumulative violations are essentially the same constraint manifested at different times), and the total violation is... ;
[0160] At this point, the violation amount is normalized to a relative violation amount. The relative violation amount of aeration flow rate is: ;
[0161] The relative violation of the dosage is ;
[0162] Total relative violation amount ;
[0163] Calculate the sum of the control amplitudes of the original trajectory (after normalization): The sum of aeration flow rates is cubic meters per minute, normalized to ;
[0164] The total dosage was 70.0 kg, normalized to... The total return flow rate is 900 cubic meters per hour, normalized to... The total normalized control quantity is ;
[0165] The ratio of the violation amount to the control amount is Take the benchmark weighting coefficient. Sensitivity parameters ;
[0166] The weighting coefficients are calculated as follows: ;
[0167] The physical meaning of this weighting coefficient is as follows: If the current constraint violation is relatively minor (relative violation rate of only 2.9%), the weighting coefficient is close to the baseline value of 0.3, and the projection process will maintain a relative balance between satisfying the constraints and preserving the optimization objective. If the constraint violation is very severe (relative violation rate exceeding 10%), the weighting coefficient will increase significantly, and the projection process will be more inclined to adjust along the target gradient direction to maximize the preservation of the MPC optimization intention.
[0168] Based on step S6, the objective-preserving projection problem is constructed. The mathematical form of this projection problem is:
[0169] ;
[0170] The constraints include amplitude constraints, rate constraints, and cumulative constraints at each time step.
[0171] Expand the first distance minimization term of the objective function:
[0172] ;
[0173] The physical meaning of this term is to penalize the square of the Euclidean distance between the projected trajectory and the original trajectory, so that the projection is as close as possible to the original trajectory.
[0174] Expand the second objective-preserving term of the objective function:
[0175] ;
[0176] in The target gradient vector The Each component.
[0177] The physical meaning of this term is the projected distance along the target gradient direction, when When (increasing this control variable will decrease the objective function), this term will encourage (Increase control quantity); when At that time, this will encourage (Reduce the amount of control).
[0178] The strength of the encouragement is related to the absolute value of the gradient and the weight coefficient. It is directly proportional. This is precisely the mathematical mechanism of goal preservation: projection not only pursues the shortest distance, but also considers which direction of projection can better preserve the optimal goal.
[0179] Proceed to step S7, and solve the projection problem using the Sequential Quadratic Programming (SQP) method. Initialize the iteration variables to the original trajectory. Number of iterations The core idea of the SQP method is to linearize the nonlinear constraints at the current iteration point, construct and solve a quadratic programming subproblem to obtain the search direction, and then update the iteration point along that direction.
[0180] First iteration ( The current iteration point is the original trajectory. Amplitude constraints are linear constraints and do not require linearization. Rate constraints and accumulation constraints are also mathematically linear constraints; the rate constraint is... Cumulative constraints are However, to demonstrate the iterative mechanism of SQP, linear constraints are still constructed at the current point according to the SQP framework.
[0181] The linearized form of the rate constraint is: The constraint matrix is used to define the constraint matrix. The structure is a difference matrix, where each row corresponds to a rate constraint, such as the behavior corresponding to the rate constraint of the aeration device at time 2. ;
[0182] The fourth position corresponds to 1. The 5th position corresponds to -1. Right-hand vector The corresponding element is the upper bound of the rate, 3.
[0183] The linearized form of the cumulative constraint is ;
[0184] The corresponding behavior of the constraint matrix ;
[0185] The 4th to 9th positions are 1, corresponding to the sum of the drug dosage at 6 time points. The corresponding element of the right-hand vector is the cumulative upper bound of 60.
[0186] Construct a quadratic programming subproblem: ;
[0187] satisfy: ;
[0188] ; ;
[0189] This quadratic programming problem is a standard convex optimization problem, which can be solved using the mature QP solver.
[0190] The trajectory after the first iteration is obtained by solving the problem. Since the objective function includes an objective gradient term, the solver will tend to move along the negative gradient direction (i.e., the descent direction of the objective function) while minimizing the distance, provided that the constraints are satisfied.
[0191] Specifically, the solution result of the first iteration is:
[0192] Time 1: (The aeration flow rate was slightly reduced by 0.3, and the dosage was reduced by 0.7).
[0193] Time 2: (The aeration flow rate is reduced by 1.0 to meet the rate constraint, and the dosage is reduced by 1.5).
[0194] Time 3: (The aeration flow rate was reduced by 1.5 to meet the rate constraint, and the dosage was slightly reduced by 0.3).
[0195] Time 4: (Aeration flow rate decreased by 1.0, and dosage decreased by 0.2).
[0196] Time 5: (Aeration flow rate decreased by 0.5, and dosage decreased by 1.3).
[0197] Time 6: (The aeration flow rate was increased by 2.5 to meet the rate constraint, and the dosage was significantly reduced by 6.0 to meet the cumulative constraint.)
[0198] Check whether the constraints of the trajectory are satisfied.
[0199] Rate constraint of aeration equipment: The change at time 2 relative to time 1 is cubic meters per minute, satisfying rate constraint 3; the change at time 3 relative to time 2 is: cubic meters per minute, just reaching the rate constraint boundary; the change at time 6 relative to time 5 is... The flow rate is cubic meters per minute, which precisely satisfies the rate constraint. Cumulative constraint for the dosing equipment: the total dosage is... kilograms, which exactly satisfies the cumulative constraint of 60.
[0200] The iterative result satisfies all real physical constraints, but the SQP algorithm needs to check the convergence condition.
[0201] Calculate the iteration update amount ;
[0202] Its norm is ;
[0203] Set the convergence threshold to ;
[0204] because The convergence condition has not been met, and further iterations are needed.
[0205] Second iteration ( The current iteration point is: Reconstructing the quadratic programming subproblem and solving it yields... Since the trajectory after the first iteration already satisfies all constraints and is relatively close to the optimal solution, the adjustment range for the second iteration is smaller.
[0206] The solution results are as follows: the control vectors at times 1 to 6 are respectively , , , , , ;
[0207] Calculate the norm of the update quantity in the second iteration: ;
[0208] because When the convergence condition is met, the algorithm terminates and outputs the projected trajectory. The final result of the projected trajectory is:
[0209] Time 1: ;
[0210] Time 2: ;
[0211] Time 3: ;
[0212] Time 4: ;
[0213] Time 5: ;
[0214] Time 6: ;
[0215] The trajectory was verified to satisfy all real physical constraints. All amplitude constraints of the aeration equipment were satisfied.
[0216] Rate constraint check: The change from time 1 to 2 is Time 2 to 3 is Time 3 to 4 Time 4 to 5 Time 5 to 6 All of them meet the rate constraint of 3 cubic meters per minute.
[0217] Cumulative constraint of dosing equipment: Total dosage is This exactly satisfies the cumulative constraint. All constraints of the reflux pump equipment are satisfied.
[0218] The core mechanism of this invention is to analyze how the target gradient vector is coordinated and adjusted at different times during the projection process. By comparing the original trajectory and the projected trajectory, the adjustment amounts of each device at each time step are calculated:
[0219] Adjustment amount of aeration equipment: Time 1 is Time 2 is Time 3 is Time 4 is Time 5 is Time 6 is ;
[0220] Negative values indicate reduced flow, while positive values indicate increased flow.
[0221] Adjustment amount for dosing equipment: Time 1 is Time 2 is Time 3 is Time 4 is Time 5 is Time 6 is ;
[0222] Adjustment amount for the reflux pump: 0 at all times, because the reflux pump does not violate constraints and no better balance of the objective function was found by adjusting the reflux pump during the optimization process.
[0223] Observing the distribution of adjustment amounts reveals a significant pattern: moments with smaller gradient norms bear more adjustment amounts, while critical moments with larger gradient norms are relatively protected. Specifically:
[0224] The gradient norm at time 1 is 185.3 (minimum). The aeration flow rate is adjusted by 0.3 and the dosage is adjusted by 0.7, with the total adjustment range being moderate.
[0225] The gradient norm at time 2 is 310.5, with an adjustment of 1.0 for aeration flow rate and 1.6 for dosage, resulting in a relatively large total adjustment range. This is because the aeration rate constraint at time 2 is violated, requiring adjustment. Although the gradient norm at time 2 is not the minimum, it is not a critical moment either, thus allowing for a significant adjustment.
[0226] The gradient norm at time 3 is 680.2. The aeration flow rate was adjusted by 1.5, and the dosage by only 0.4, resulting in a relatively small total adjustment. Although the aeration flow rate at time 3 also needed to meet the rate constraint (decreasing from 22.0 to 21.0 and then increasing to 24.0, so that the change from 2 to 3 is exactly 3.0), the dosage was prioritized for protection, with an adjustment of only 0.4 kg. This reflects the protective effect of the target gradient: time 3 corresponds to the period of rising influent load, and the target gradient indicates that the control quantity at this time has a significant impact on the overall objective function; the projection process tends to keep the control quantity at this time close to its original value.
[0227] At time 4, the gradient norm is 750.8 (maximum), the aeration flow rate is adjusted by 1.0, and the dosage is adjusted by only 0.3, resulting in the smallest total adjustment range. This is the most critical moment, corresponding to the peak influent load, and the projection process protects the control parameters at this moment to the greatest extent.
[0228] The gradient norm at time 5 is 430.2. The aeration flow rate is adjusted by 0.5 and the dosage is adjusted by 1.4, with the total adjustment range being moderate.
[0229] The gradient norm at time 6 is 280.1, and the aeration flow rate is adjusted accordingly. Adjustment of drug dosage (Significantly reduced), with the largest overall adjustment. This phenomenon requires a deeper explanation of its mechanism.
[0230] The dosage at time 6 was drastically reduced from 9.0 kg to 3.4 kg, a decrease of 62%. This directly reflects the budget allocation mechanism caused by the cumulative constraint. The cumulative constraint requires that the total dosage over the six times not exceed 60 kg. The original trajectory's total dosage was 70 kg, requiring a reduction of 10 kg. The projection process needs to decide "at which times to reduce the dosage".
[0231] The target gradient implicitly encodes the degree of influence on the optimization objective at each time step. Time steps with large gradients are more sensitive to the objective function, and reducing the dosage will lead to a significant performance degradation. Therefore, reduction should be prioritized at time steps with small gradients. The gradient norm at time 6 is 280.1. Although it is not the minimum, time 6 corresponds to the recovery phase where the influent load has already dropped, so reducing the dosage has a relatively small impact on the effluent quality.
[0232] More importantly, time 6 is the last time in the prediction time domain. Its control action is executed only once and then replaced by the new optimization result of the next control cycle. Therefore, the actual impact of budget reduction at time 6 is mitigated by the re-optimization in subsequent cycles.
[0233] In contrast, times 3 and 4 correspond to peak loads and are the midpoints of the prediction time domain. Their control actions have a greater impact on the water quality trajectory throughout the prediction time domain. Therefore, the projection process prioritizes protecting the dosage at these two times, shifting the reduction pressure to time 6. This is precisely the mechanism by which the target gradient coordinates budget allocation under cumulative constraints.
[0234] The aeration flow rate at time 6 actually increased by 2.5 cubic meters per minute to compensate for the decrease in phosphorus removal capacity caused by the significant reduction in the dosage. Reducing the dosage from 9.0 to 3.4 would decrease the COD removal capacity at time 6 by approximately [missing information]. To maintain the effluent quality up to standard, it is necessary to compensate by increasing aeration. Increasing the aeration flow rate by 2.5 cubic meters per minute can further reduce COD by approximately [missing information]. .
[0235] Although the compensation is incomplete, the performance degradation is within an acceptable range due to the relatively small gradient norm at time 6. This decision to increase aeration also reflects the effect of the target preservation term: the component of the target gradient corresponding to aeration guides the projection process to partially mitigate performance loss by increasing aeration while reducing dosing.
[0236] The specific mechanism of temporal coupling will now be demonstrated by selecting adjacent time pairs from time 2 to time 3 for detailed analysis.
[0237] The initial aeration flow rate at time 2 was 22.0 cubic meters per minute, and the initial aeration flow rate at time 3 was 25.5 cubic meters per minute. The changes between the two are as follows: This violates rate constraint 3.0.
[0238] If we simply keep the flow rate at time 2 unchanged and only adjust the flow rate at time 3, the flow rate at time 3 needs to be reduced to... However, doing so would cause the control quantity at time 3 to deviate from the original value by 1.5 cubic meters per minute. Considering that the gradient norm at time 3 is as high as 680.2, this adjustment would lead to a significant increase in the objective function value.
[0239] Another option is to adjust the flow rate at time 2, reducing it from 22.0 to... This allows time 3 to be maintained at 25.5 cubic meters per minute. However, this is not the optimal solution, because the decrease in flow rate at time 2 will affect the rate constraint between time 1 and time 2 (although it was not violated originally, it may approach the boundary after adjustment), and time 2 itself also has a certain gradient norm.
[0240] The projection method of this invention adopts global optimization and considers the target gradient at all times. A coordination scheme is found: the volume is reduced by 1.0 cubic meters per minute at time 2 and by 1.5 cubic meters per minute at time 3, so that the change from time 2 to time 3 is exactly 3.0 cubic meters per minute.
[0241] The advantage of this scheme lies in distributing the adjustment amount inversely proportional to the gradient. The gradient norm of 310.5 at time 2 is relatively small, and the increase in the objective function due to an adjustment of 1.0 cubic meters per minute is approximately... Here, 0.318 is the objective preservation weight coefficient, which reflects the weight of the gradient term in the objective function.
[0242] The gradient norm of 680.2 at time 3 is relatively large, and the increase in the objective function due to the adjustment of 1.5 cubic meters per minute is approximately... ;
[0243] If the aforementioned "adjust only time 3" scheme is adopted, time 3 needs to be adjusted by 2.5 cubic meters per minute, and the objective function increment is... It is far greater than the total increment of the coordination plan. .
[0244] This numerical comparison clearly demonstrates the effectiveness of the objective gradient coordination mechanism: by globally considering the gradient information at each time step, it minimizes the performance loss of the objective function while satisfying the rate constraint.
[0245] Further analysis was conducted on the rate constraint coordination between time 3 and time 4. In the original trajectory, time 3 was 25.5 and time 4 was 28.0, a change of 2.5, which did not violate the rate constraint. However, after projection, time 3 decreased to 24.0 and time 4 decreased to 27.0, a change of 3.0.
[0246] This adjustment may seem to "waste" some of the margin of rate constraint, but it is actually the result of global optimization: both time 3 and time 4 require a reduction in flow rate to match the reduction of cumulative constraints of the dosing equipment (after the dosing rate is reduced, aeration needs to be reduced simultaneously to maintain the carbon-nitrogen ratio balance). The projection process minimizes the adjustment range of these two high gradient times while maintaining the rate constraint boundary.
[0247] Adjusting the value by 1.5 at time 3 and by 1.0 at time 4 results in reductions of 5.9% and 3.6% respectively compared to their original values. These are the minimum reductions that can be achieved while satisfying the constraints.
[0248] The rate constraints between time 5 and time 6 also reflect the coordination mechanism. In the original trajectory, time 5 was 26.0 and time 6 was 20.0, which changed to... This severely violates the rate constraint. After projection, time 5 is 25.5 and time 6 is 22.5, a change of exactly [missing value]. ;
[0249] What's special about this coordination is that the flow rate at time 6 increases (from 20.0 to 22.5), which is the opposite of the previous trend (the flow rate decreases at most times).
[0250] This is because time 6 requires increased aeration to compensate for the significant reduction in pesticide dosage, and this increased aeration also alleviates the rate constraint violation between times 5 and 6. The global optimization characteristics of the target-preserving projection problem make this "win-win" coordination possible: the target gradient guides the projection to increase aeration at time 6 to compensate for the performance loss, while the rate constraint limits this increase to no more than 3.0 cubic meters per minute, ultimately achieving... A precise balance.
[0251] Proceed to step S8, project the control trajectory. Output to various heterogeneous execution devices.
[0252] The aeration equipment receives a flow command of 18.2 cubic meters per minute at time 1. This command meets the amplitude and rate constraints of the equipment. The blower frequency converter adjusts the motor speed to achieve the target flow rate.
[0253] The dosing equipment receives a dosing instruction of 7.5 kg at time 1, and the metering pump adds the amount of drug evenly within a 2-hour control cycle.
[0254] The reflux pump receives a flow command of 120 cubic meters per hour at time 1, and the pump frequency converter adjusts the speed.
[0255] After the control cycle ends, the system remeasures the current state, and the MPC controller optimizes the control trajectory in the next prediction time domain based on the new state and water inflow prediction, repeating the above projection process.
[0256] Proceed to step S9 to calculate the difference in objective function values between the projected trajectory and the original trajectory. Substitute the projected trajectory into the MPC prediction model to calculate the system output at each time point in the prediction time domain, and then calculate the objective function value.
[0257] The objective function value of the original trajectory is The objective function value of the projected trajectory is The difference in objective function values is Relative growth is ;
[0258] The physical meaning of this performance degradation is that, compared with the original trajectory, the projected control trajectory predicts a slight deterioration in the effluent quality (a slight increase in COD and ammonia nitrogen concentrations) and a slight increase in operating costs (although the cost of chemical dosing is reduced, the total cost of aeration adjustment is slightly increased), resulting in an increase of 47.7 in the objective function value.
[0259] Determine whether the difference exceeds a preset target degradation threshold. According to step S10, set the target degradation threshold as follows: This is equivalent to allowing the objective function value to increase by about 8%.
[0260] because If the judgment condition of step S11 is met, the system will normally execute the projection control trajectory and will not trigger an alarm.
[0261] The threshold is set based on engineering experience: in wastewater treatment control, if the difference between the simplified constraints and the actual constraints in MPC causes a performance degradation of more than 8% after projection, it indicates that the constraint model is too simplified and the constraint parameters inside the MPC need to be recalibrated or the accuracy of constraint modeling at the MPC level needs to be increased.
[0262] The 3.81% performance degradation in the current case demonstrates that the architecture of separating constraint levels is reasonable. The simplified constraint model of MPC ensures the solution speed while the difference from the real constraints does not lead to excessive performance loss.
[0263] This embodiment fully demonstrates the entire process of the target-preserving projection method, including constraint modeling of three types of heterogeneous devices, the difference between MPC simplified constraints and real constraints, calculation of the target gradient vector of the whole trajectory, constraint violation detection, projection problem construction, SQP iterative solution, and the most critical target gradient coordination mechanism.
[0264] By comparing the distribution of adjustment amounts at each time point with the target gradient norm, the coordination mechanism is as follows: critical times with large gradient norms (times 3 and 4) are given priority protection and bear smaller adjustment amounts; non-critical times with small gradient norms (times 1, 2, and 6) bear more adjustment amounts; the temporally coupled rate constraint distributes the adjustment amounts inversely proportional to the gradient between adjacent times through global optimization; the cumulative constraint budget allocation transfers the reduction pressure to time 6, which has a small gradient and is located at the end of the prediction time domain.
[0265] The projected trajectory satisfies all real physical constraints while controlling the performance loss of the optimization objective to 3.81%, which is significantly better than the simple projection method that does not consider the objective gradient.
[0266] Example 2
[0267] This embodiment elaborates on the coordination mechanism of the target gradient vector under temporal coupling constraints. Through mathematical derivation and numerical analysis, it demonstrates how rate constraints and cumulative constraints produce a coupling effect on the time axis, and how the target gradient across the entire trajectory guides the projection process to intelligently allocate adjustment amounts between adjacent time points, coordinating the budget allocation across the entire time domain under cumulative constraints. This embodiment is based on the same scenario and data as Embodiment 1, focusing on the intrinsic mechanism of the projection process.
[0268] First, we analyze the temporal coupling mechanism caused by rate constraints. We select the aeration equipment at times 2 and 3 in Example 1 as the analysis objects. The aeration flow rate at time 2 in the original trajectory is... cubic meters per minute, the aeration flow rate at time 3 is cubic meters per minute, the change in both is cubic meters per minute, exceeding the upper limit of the rate constraint. The flow rate is cubic meters per minute, and the violation is 0.5 cubic meters per minute. The projection problem requires adjusting the flow rate at these two moments to meet the rate constraint, even the projected flow rate. and satisfy .
[0269] The mathematical properties of the rate constraint dictate that the projections at time 2 and time 3 are not independent. Let the adjustment for time 2 be... The adjustment amount at time 3 is Rate constraint requirements:
[0270] ;
[0271] After unfolding and organizing, we get:
[0272] ;
[0273] ;
[0274] ;
[0275] This set of inequalities reveals the essence of temporal coupling: the adjustment at time 3 must be at least 0.5 cubic meters per minute smaller than the adjustment at time 2 (in the direction of decreasing flow rate, i.e., This means that the decrease at time 3 must be at least 0.5 greater than the decrease at time 2. In other words, the adjustment amounts at the two times cannot be chosen independently; there is a linear constraint between them.
[0276] Without target gradient guidance (i.e.) The closest point projection), the projection problem only seeks to minimize the distance. Under rate constraints Under these conditions, the optimization problem tends to make the adjustments at two moments as close to zero and as equal as possible (to minimize the sum of squared distances). However, the rate constraint requires them to maintain a certain difference, so the optimization problem will make the adjustments as uniform as possible within the constraints. In the comparative experiment 2 of Example 2, the nearest point projection gives a solution where the rate decreases by 1.0 cubic meters per minute at time 2 and by 0.5 cubic meters per minute at time 3 (corresponding to the drug dosage adjustment), which is a relatively uniform distribution.
[0277] After introducing the target gradient, the objective function of the projection problem becomes:
[0278] ;
[0279] The dosage of the drug at time 2 and time 3 is denoted as ( and (device subscript omitted)
[0280] ;
[0281] in and Let these be the target gradient components corresponding to the dosage at times 2 and 3. From the gradient calculation in Example 1, the dosage component of the target gradient vector at time 2 is approximately... (A negative value indicates that increasing the drug dosage will decrease the objective function value, i.e., improve performance.) The drug dosage gradient component at time 3 is approximately... (A larger absolute value indicates that time 3 is more sensitive to the objective function).
[0282] Record adjustment amount and The objective function becomes:
[0283] ;
[0284] Due to the need to reduce drug application to meet cumulative constraints, the adjustment amount... And gradient ,therefore and The objective gradient term is positive. The physical meaning of this positive term is "reducing the performance loss caused by drug administration." When... When increased, the performance loss increment is (because and ).same, The performance loss increment caused by increasing is .
[0285] Compare the total increment of the objective function (including the distance term and the objective gradient term) resulting from adjusting the drug dosage by 1 unit at each of the two time points. At time 2, reducing the drug dosage by 1 kg results in the following increment of the objective function: At time 3, the dosage is reduced by 1 kg, and the increment of the objective function is... Since the absolute value of the gradient is larger at time 3, the increase in the objective function due to reducing the dosage by one unit at time 3 is larger. Therefore, if the cumulative constraint requires a total reduction of 2 kg of dosage, the optimization problem will tend to "reduce more at time 2 and less at time 3", with the specific allocation ratio determined by the inverse proportion of the gradient.
[0286] The target gradient guides the optimization problem to intelligently allocate adjustment amounts between two coupled moments, so that critical moments with large gradients are given priority protection, while non-critical moments with small gradients take on more adjustment.
[0287] Further analysis of the budget allocation mechanism under the cumulative constraint. (Cumulative constraint) The requirement is that the total dosage over six time points should not exceed 60 kg, while the original trajectory's total dosage is 70 kg, necessitating a reduction of 10 kg. How to distribute this 10 kg reduction across the six time points is a budget allocation problem under cumulative constraints. If the target gradient is not considered, the nearest point projection will tend to distribute the dosage evenly, with a reduction of approximately [amount missing] kg per time point. Kilograms. However, after introducing the target gradient, the allocation will be inversely proportional to the gradient: the allocation reduction is small when the gradient norm is large, and the allocation reduction is large when the gradient norm is small.
[0288] The reduction weights at each time step are defined as the reciprocal of the gradient norm. The gradient norms at times 1 to 6 are 185.3, 310.5, 680.2, 750.8, 430.2, and 280.1, respectively, with corresponding weights of... , , , , , The normalized weights (so that their sum is 1) are: , , , , , Based on this weighting, the 10 kg reduction amount is allocated as follows: At time 1, the theoretical reduction amount is... Kilograms, 1.86 kg at time 2, 0.85 kg at time 3, 0.77 kg at time 4, 1.34 kg at time 5, and 2.06 kg at time 6.
[0289] Comparing the actual reduction amounts in the projection results (Example 1): Time 1: 0.7 kg reduction; Time 2: 1.6 kg reduction; Time 3: 0.4 kg reduction; Time 4: 0.3 kg reduction; Time 5: 1.4 kg reduction; Time 6: 5.6 kg reduction. The actual reduction amounts are consistent with the theoretical predictions in trend (Times 3 and 4, being high-gradient times, have smaller reduction amounts, while Time 6 has the largest reduction amount), but there are numerical differences. The actual reduction amount of 5.6 kg at Time 6 is much larger than the theoretically predicted 2.06 kg. This is because Time 6 is located at the end of the prediction time domain and has special characteristics: its control action is executed only once and then replaced by re-optimization in the next control cycle. Therefore, the long-term impact of excessive reduction at this time is mitigated by the rolling time domain optimization mechanism. The projection problem implicitly considers this factor, transferring more reduction pressure to Time 6. The actual reduction amount of 0.7 kg at Time 1 is less than the theoretically predicted 3.12 kg. This is because Time 1 is the current time, and its control action will be executed immediately. Excessive reduction will immediately affect the system state, so the projection tends to conservatively adjust this time.
[0290] This embodiment elucidates the coordination mechanism of the target gradient vector under temporal coupling constraints through mathematical derivation and numerical analysis. The rate constraint establishes a linear coupling relationship between adjacent time steps. This prevents adjustments at two time points from being made independently. The target gradient is achieved by introducing a gradient inner product term into the objective function. The sensitivity of each time step to the optimization objective is encoded as marginal cost, guiding the projection process to allocate adjustment amounts inversely proportional to the gradient while satisfying rate constraints, thus protecting critical moments. Budget allocation under cumulative constraints follows a similar principle: moments with larger gradient norms are allocated less reduction, while moments with smaller gradient norms and those at the end of the prediction time domain bear more reduction pressure.
[0291] Example 3
[0292] This embodiment provides three sets of comparative experiments to verify the design necessity of the method of the present invention, and to answer the following three technical questions: Why is it necessary to simplify the separation of constraints and real constraints through MPC instead of directly including all real constraints within MPC? Why is it necessary to maintain the projection of the target instead of using the conventional nearest-point projection? And what is the specific role of the target gradient term in the projection process? All three sets of comparative experiments are based on the same wastewater treatment scenario and the same operating conditions in Embodiment 1 to ensure the fairness of the comparison.
[0293] First, a comparative experiment was conducted to verify the necessity of constraint hierarchy separation. This experiment compared two architectures: Architecture A is a single-layer architecture where the MPC contains all real physical constraints, and Architecture B is a two-layer architecture where the MPC uses simplified constraints plus post-projection (i.e., the method of this invention). Both architectures were run under the same conditions, and their solution time and final performance were compared.
[0294] The MPC optimization problem of architecture A includes 6 control times, 3 control devices, and a total of 18 control variables. Constraints include: 18 amplitude constraints for each device at each time time (one constraint for the upper and lower bounds of each control variable); 6 rate constraints for the aeration device (6 rate upper and lower bounds for times 1 to 6 relative to the previous time, which, even simplified to absolute value constraints, still require 12 inequality constraints, but can be reduced to 6 by introducing auxiliary variables); 6 rate constraints for the dosing device; 6 rate constraints for the return pump device; and 1 cumulative constraint for the dosing device, for a total of 54 constraints (18 amplitude constraints + 18 rate constraints with upper and lower bounds + 1 cumulative constraint; in actual implementation, the rate constraint...). It needs to be broken down into and Two inequalities, therefore the rate constraint actually consists of 36 inequalities. The mathematical form of the MPC optimization problem is a standard quadratic programming problem (QP), and the dimension of its KKT optimality conditions is... (Number of variables plus number of constraints). Using the interior-point method to solve this QP problem, each iteration requires solving a 72-dimensional linear system, and the number of iterations is typically 10 to 15.
[0295] The MPC optimization problem in Architecture B uses a simplified constraint model, reducing the number of constraints to 30, and the KKT condition dimension to 48. Under the same industrial PC and solver configuration, the average solution time for a single MPC optimization is 0.78 seconds. After obtaining the original trajectory, the projection layer is entered. The projection problem is also a QP problem, with 18 variables (the same as MPC) and 54 constraints (the same as the MPC constraints in Architecture A). However, the initial point of the projection problem is the original trajectory output by MPC, which is very close to the feasible region (with only minor violations of some constraints). Therefore, the SQP iterations for the projection problem are typically 2 to 4, far fewer than the iterations required for MPC optimization from scratch. The average solution time for the projection problem is 0.38 seconds. The total computation time for Architecture B is... Second.
[0296] Comparing the computational efficiency of the two architectures, Architecture B reduces the solution time by 74.3% compared to Architecture A, achieving a speed increase of 3.9 times. The engineering significance of this time difference lies in the fact that although the control cycle is 2 hours (7200 seconds), 4.52 seconds and 1.16 seconds seem much shorter than the control cycle. However, in actual deployments, industrial control computers need to execute multiple tasks concurrently, including data acquisition every 10 seconds, state estimation every 30 seconds, real-time monitoring interface refresh, and communication with the host computer. These tasks compete for CPU resources. Under extreme conditions (such as sudden changes in influent water quality or equipment failure), the nonlinearity of the prediction model increases, and the solution time for the optimization problem may suddenly increase from the average to 2 to 3 times the average. In this case, the solution time of Architecture A may reach more than 10 seconds, and excessive CPU resource consumption will affect the execution of other real-time tasks. More importantly, Architecture A may encounter situations where the optimization problem is infeasible under certain operating conditions: when the actual constraints are too strict and the influent load changes abruptly, there may not be a single control trajectory that can simultaneously satisfy all constraints and the effluent water quality requirements. In this case, the MPC optimization problem is unsolvable, requiring manual intervention to relax the constraints or downgrade the control objective. Architecture B improves the feasibility of the MPC optimization problem by simplifying the constraint model. Even if the trajectory under simplified constraints is infeasible under the actual constraints, the projection layer can correct it into a feasible trajectory. This layered architecture is more robust in engineering deployment.
[0297] To compare the control performance of the two architectures, the actual effluent quality of both architectures after one control cycle under the same operating conditions in Example 1 was recorded. The trajectory output by Architecture A is (since it includes all constraints, the trajectory directly satisfies the actual constraints): control vector at time 1. The control vectors at times 2 to 6 are respectively , , , , The trajectory satisfies all true constraints, and the objective function value is... The projected trajectory output by architecture B has been given in Example 1, and the objective function value is... Architecture A performs slightly better than Architecture B, the difference being... The relative difference is 1.0%. This is because architecture A directly considers all constraints during optimization, finding the optimal solution within the constraint space. In contrast, architecture B first optimizes within a simplified constraint space and then projects it onto the real constraint space, exhibiting a suboptimal nature compared to "optimizing directly under the real constraints." However, this 1.0% performance loss is acceptable, in exchange for a 3.9x increase in computational speed and greater deployment robustness.
[0298] The results of the comprehensive comparison with Experiment 1 verify the necessity of the constraint hierarchy separation architecture design: at the cost of a 1.0% performance loss, a 3.9-fold increase in computing speed and enhanced robustness of the optimization problem's feasibility are achieved, which is a reasonable trade-off in engineering deployment.
[0299] Experiment 2, a comparative experiment, verifies the advantages of target-preserving projection over nearest-point projection. This experiment compares two projection methods: Method A is nearest-point projection, where the projection problem only includes the distance minimization term and not the target gradient term; Method B is target-preserving projection, which is the method of this invention. Both methods use the original trajectory from Example 1. Using the same real physical constraints as input, project the trajectory and compare the performance of the projected trajectory with the constraint satisfaction.
[0300] The mathematical form of the projection problem of method A is: ;
[0301] The constraints are the same as in Example 1. This problem is also solved using the SQP method, and the projected trajectory after convergence is:
[0302] Time 1: ;
[0303] Time 2: ;
[0304] Time 3: ;
[0305] Time 4: ;
[0306] Time 5: ;
[0307] Time 6: ;
[0308] Verify that the trajectory satisfies all real physical constraints. Cumulative constraint check of the dosing equipment: Total dosage is... Kilograms, satisfying the cumulative constraint of 60. Rate constraint check: The changes in the aeration equipment at each adjacent moment are 3.0, 3.0, 3.0, 2.0, 3.0, and the changes in the dosing equipment at each adjacent moment are 2.5, 3.0, 2.0, 2.0, 4.3, both satisfying the rate constraint. The constraint satisfaction of this trajectory is the same as that of Method B (target-preserving projection).
[0309] Compare the control quantity adjustment distribution of the two methods. The dosage adjustment for method A at each time point is as follows: Time 1 adjustment... kilogram, time 2 adjustment kilogram, time 3 adjustment kilogram, time 4 adjustment kilogram, time 5 adjustment kilogram, time 6 adjustment Kilograms. It can be seen that the adjustment amount of Method A is relatively evenly distributed across time steps, with absolute values of 1.9, 2.7, 2.0, 1.2, 0.7, and 1.5 kg for times 1 to 6, respectively, and a standard deviation of 0.68 kg. In contrast, the adjustment amount of Method B (target-preserving projection) is distributed as 0.7, 1.6, 0.4, 0.3, 1.4, and 5.6 kg across time steps, with a standard deviation of 2.04 kg, significantly greater than Method A. The physical meaning of this comparison is: Method A tends to distribute the reduction pressure of the cumulative constraint evenly across time steps because its optimization objective only pursues distance minimization. Without other guidance, even reduction is an intuitive strategy to minimize the sum of squared total distances; Method B, on the other hand, tends to concentrate the reduction pressure at times with small gradients (such as time step 6) and protect critical times with large gradients (such as times 3 and 4), resulting in an uneven distribution of adjustment amounts, but more consistent with preserving the optimization objective.
[0310] Calculate the objective function values of the projected trajectories for both methods. Substitute the trajectory of Method A into the MPC prediction model to calculate the objective function value. The objective function value of method B has been given in Example 1. The performance improvement of method B compared to method A is: Relatively improved to This performance difference stems from the different allocation strategies for adjusting the dosage. Method A reduced the dosage by 2.0 and 1.2 kg at times 3 and 4, respectively. These two times correspond to peak influent loads, and reducing the dosage would lead to a significant increase in effluent COD and ammonia nitrogen concentrations. Specifically, the dosage at time 3 was reduced from 13.8 to 11.8, a decrease of 14.5%. According to the sensitivity matrix, this would result in an increase of approximately [missing information - likely related to COD]. mg / L, effluent ammonia nitrogen increases by approximately .
[0311] The dosage at time 4 was reduced from 15.0 to 13.8, a decrease of 8.0%, resulting in an increase of approximately 1.44 in effluent COD. This water quality deterioration directly increased the tracking error term of the objective function. Method B, guided by the objective gradient, reduced the dosage at times 3 and 4 to 0.4 and 0.3 kg, respectively, significantly reducing water quality deterioration at these two critical times. Although the cost was a greater reduction in dosage at time 6 (from 9.0 to 3.4), time 6 corresponds to the load decline phase and is located at the end of the prediction time domain. The impact of its water quality deterioration was mitigated by the re-optimization of subsequent control cycles, thus resulting in a better overall objective function value.
[0312] Further analysis is conducted to examine the robustness differences between the two methods under extreme conditions. A more stringent constraint scenario is designed: assuming the remaining amount of the reagent in the tank is further reduced to 50 kg, the cumulative constraint is tightened to... Kilograms. Under this constraint, the cumulative violation of the original trajectory increases from 10 kg to 20 kg. Projection is performed using methods A and B respectively. The projection result of method A is: the dosage at times 1 to 6 is 4.8, 6.5, 9.5, 11.5, 9.5, and 8.2 kg, respectively, totaling 50 kg. The trajectory satisfies the cumulative constraint, but the objective function value reaches... Compared to the original trajectory's objective function value of 1250.5, this represents a 21.6% increase, resulting in a significant performance degradation. The projection results of Method B are as follows: the drug dosages at times 1 to 6 are 6.8, 9.2, 13.0, 14.5, 6.0, and 0.5 kg, respectively, totaling 50 kg. The objective function value for this trajectory is... The trajectory improved by 10.8% compared to the original. Method B's performance improvement over Method A under extreme constraints is... This comparison demonstrates the importance of the target gradient when constraints tighten: as pruning pressure increases, the nearest point projection excessively prunes the control at critical moments, leading to severe performance degradation, while the target-keeping projection, guided by gradients, can more intelligently allocate pruning pressure, keeping performance loss within a smaller range.
[0313] The results of Experiment 2, when compared with those of Experiment 2, confirm the design necessity of target-preserving projection compared with nearest-point projection: under the same constraint conditions, the performance of target-preserving projection is 4.74% (standard condition) to 8.85% (extreme condition) better than that of nearest-point projection. This is because the target gradient implicitly encodes the degree of influence of each moment on the optimization objective, guiding the projection process to prioritize the protection of critical moments and transfer the adjustment pressure to non-critical moments.
[0314] In comparative experiment three, the target weight coefficients were verified. The effect. This experiment, conducted under the same scenario as Example 1, compared different Analysis of projection results under the given values How does this affect the trade-off between constraint satisfaction and goal preservation? (Testing) The values include 0, 0.1, 0.318, 0.5, and 1.0.
[0315] when When the projection problem degenerates into the nearest point projection, the results of which have been given in Comparative Experiment 2, with an objective function value of 1362.8. At that time, the weight of the objective gradient term is relatively small, and the projection results are as follows: the dosages from time 1 to 6 are 7.0, 9.5, 12.8, 14.2, 11.0, and 5.5 kg, respectively, totaling 60 kg. The objective function value of this trajectory is 1335.2, compared to... This represents an improvement of 2.03%. It demonstrates that even small target gradient weights can guide the projection process and adequately protect critical moments. When The results, as given in Example 1, show that the objective function value is 1298.2. At that time, the weight of the target gradient term is relatively large, and the projection results are as follows: the amount of medicine administered at times 1 to 6 are 7.8, 10.2, 13.5, 14.8, 10.5 and 3.2 kg respectively, totaling 60 kg.
[0316] The objective function value of this trajectory is 1285.6, compared to This represents a further improvement of 0.97%. However, observing the constraint fulfillment, it was found that the dosage at time 6 decreased to 3.2 kg, still with a margin from the lower limit of the amplitude constraint (0 kg). However, the aeration flow rate needed to be increased to 23.5 m³ / min to compensate for the reduced dosage, causing the aeration rate constraint at times 5 and 6 to approach the boundary (a change of 2.95 m³ / min, with only a 0.05 margin from the upper limit of the rate (3.0)). At that time, the weight of the objective gradient term was very large, and the projection process excessively pursued movement along the gradient direction, causing slight constraint violations at some intermediate iteration points during the SQP iteration process. Additional correction iterations were needed to converge to a feasible solution. The final objective function value of the projection result was 1278.3, compared to... It improved by 0.57%, but the aeration equipment reached the precise boundary of the rate constraint at time 5 to 6 (the change was exactly 3.0 cubic meters per minute). Any slight disturbance could cause the constraint to be violated, resulting in poor robustness.
[0317] Draw different The performance curve under the given values, with the horizontal axis being... The vertical axis represents the objective function value of the projected trajectory. The curve exhibits a decreasing trend. The time was 1362.8. The time was 1335.2. The value was 1298.2. The time was 1285.6. The value is 1278.3. The slope of the curve is... The increase is relatively large when it increases from 0 to 0.5 (significant marginal improvement). The improvement is smaller when increasing from 0.5 to 1.0 (diminishing marginal improvement). The physical meaning of this curve is: when the target gradient weight increases from 0, the performance improvement is initially faster because the nearest point projection completely ignores the target gradient information; introducing the gradient significantly improves protection at critical moments. As the constraint continues to increase, performance improvement gradually saturates because the constraint itself limits the degrees of freedom of projection; excessively large constraints will lead to performance degradation. This can lead to excessive pursuit of gradient direction in the projection, sacrificing constraint satisfaction margin. A good balance is achieved between performance and constraint satisfaction margin.
[0318] By comparing the results of Experiment 3, the target preservation weight coefficient was verified. Key role: As the projection speed increases from 0 to a reasonable range, the projection performance improves significantly. When the value is too large, performance improvement saturates and constraint satisfaction margin decreases; adaptive determination. The rules can automatically adjust the trade-off strategy based on the degree of constraint violation, maintaining stable performance under different operating conditions.
[0319] This embodiment verifies the necessity of the proposed method from three dimensions: computational efficiency, control performance, and robustness, through three sets of comparative experiments. Comparative experiment one verifies that the constraint hierarchy separation architecture significantly improves computational speed and deployment robustness while maintaining performance. Comparative experiment two verifies that target-preserving projection has significant performance advantages over nearest-point projection under both standard and extreme conditions. Comparative experiment three verifies the crucial role of the target gradient weight coefficients and the effectiveness of the adaptive determination rules. These three sets of experiments collectively support the innovation and practicality of the technical solution of this invention.
Claims
1. A method for projecting a wastewater treatment MPC control trajectory onto a constraint set of heterogeneous equipment while maintaining a target, characterized in that, Includes the following steps: S1. Obtain the original control trajectory output by the MPC controller of the wastewater treatment system. ; in, To predict the length of the time domain, For a moment The control vector of the MPC controller is used to ensure online solution speed when solving optimization problems by employing a simplified constraint model. S2. Obtain the actual physical constraint set of each heterogeneous actuator in the wastewater treatment system. The real physical constraints include the device's amplitude hard constraints, time-related rate constraints, and cumulative constraints in the prediction time domain. The real physical constraints are more stringent than the simplified constraint model inside MPC or include real-time change constraints that are not considered when solving MPC. S3 Extracts the MPC Optimization Objective Function In the original trajectory The full trajectory target gradient vector at [location] ; The full trajectory target gradient vector is: A dimensional vector, where The dimension of the control vector at a single time moment is the dimensionality of the target gradient vector across the entire trajectory. Each block Characterizing time The degree of influence of the control quantity on the overall optimization objective; S4 detects violations of the original control trajectory under real physical constraints at each time step. and each device Calculate the amount of constraint violation ,when Time indicates the moment. In the equipment There is a constraint violation; If there are no constraint violations at any time on all devices, S5 will directly output the original control trajectory. Otherwise, proceed to step S6; S6 constructs a target-preserving projection problem that simultaneously imposes a set of constraints across the entire prediction time domain and coordinates the projection directions at each time step using the target gradient vector across the entire trajectory: ; satisfy: ; ; ; The first term is the projection distance minimization term, and the second term is the target preservation term. For vector dot product operation, The weighting coefficients are maintained for the target; the rate constraint equation reflects the temporal coupling relationship, i.e., time... The projection will affect the time through this constraint. The feasible region; the cumulative constraint equations embody the budget coupling relationship, i.e., the preceding... The projection at a given moment will affect the available budget at subsequent moments through this constraint; S7 performs a global solution to the target-preserving projection problem to obtain the projected control trajectory. The global solution process implicitly encodes the importance weights of each time step through the full trajectory target gradient vector, so that when there is a conflict in the propagation of temporal constraints, the time step with the larger gradient is protected first. S8 outputs the projected control trajectory Execution is performed on various heterogeneous execution devices.
2. The method for projecting a wastewater treatment MPC control trajectory onto a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S1, the simplified constraint model adopted by the MPC controller includes at least one of the following cases: (1) Use the relaxed upper and lower limits of the device constraint instead of the real hard constraint, and the boundary of the relaxed upper and lower limits has a safety margin from the boundary of the real hard constraint. (2) Ignore the rate constraints or cumulative constraints of some devices to reduce the complexity of the optimization problem; (3) It does not include constraint changes that occur temporarily during execution, including additional restrictions caused by equipment failure, temporary disablement during maintenance, or dynamic limits adjusted according to real-time operating conditions.
3. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S3, the full trajectory target gradient vector The extraction method is as follows: When the MPC optimization objective function is a quadratic objective function At that time, among them For system output, For reference trajectory, and The weight matrix is the target gradient vector of the entire trajectory obtained by applying the weights to the original trajectory. Taking the partial derivative yields: ; in The sensitivity matrix of the system output to the control input is calculated using the prediction model within the MPC.
4. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S4, the constraint violation amount The calculation method is as follows: For equipment At any moment Amplitude constraints ; The amplitude violation amount is: ; For equipment At any moment Rate constraints ; The rate violation is: ; For equipment Cumulative constraints in the prediction time domain ; The cumulative number of violations is: ; The time In the equipment The total number of constraint violations is: .
5. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S6, the target maintains the weight coefficients. The constraint violation is adaptively determined based on the degree of constraint violation across the entire trajectory: ; in As the benchmark weighting coefficient, For sensitivity parameters, The sum of constraint violations across the entire trajectory and all devices. This represents the sum of the control magnitudes of the original trajectory; when the proportion of the constraint violation to the control magnitude increases... Increase the size to better maintain the optimization target and avoid excessive deviation of the projection from the optimization intent of MPC.
6. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S7, the global solution employs a sequential quadratic programming method, specifically including: S7.
1. Initialize iteration variables Number of iterations ; S7.
2. At the current iteration point At this point, the rate constraint and accumulation constraint are linearized to construct a quadratic programming subproblem: ; satisfy: ; ; ; in For rate constraints The linearization coefficient at the point, For cumulative constraints The linearization coefficient at the point; S7.
3. Solve the quadratic programming subproblem to obtain a new iteration point. ; S7.
4. Determine the convergence condition If the maximum number of iterations is reached, then output the result. ; Otherwise Then return to step S7.
2.
7. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, In step S7, the full trajectory target gradient vector The mechanism by which this process works in the global solution process is as follows: At that moment The projection causes the moment When the feasible region shrinks, if ; The optimization problem tends to involve more adjustment times. The control variable satisfies the constraints, thereby protecting moments with larger gradients. ; When cumulative constraints lead to the previous When the projection at a given moment encroaches on the available budget at subsequent moments, the target preservation term... ; It will guide the projection direction to consume more budget when the gradient is small and retain the budget when the gradient is large, thereby coordinating the budget allocation across the entire prediction time domain.
8. The method for target-preserving projection of wastewater treatment MPC control trajectory to a heterogeneous equipment constraint set according to claim 1, characterized in that, After step S8, the method further includes: S9. Calculate the objective function value of the projected control trajectory. Objective function value of the original trajectory Differences: ; S10. Determine the difference in the objective function values. Does it exceed the preset target degradation threshold? ; S11. If ; Then, an over-constraint alarm signal is sent to the upper-level decision module, indicating that the difference between the current real physical constraints and the simplified constraint model of MPC is too large, and suggesting recalibrating the constraint model inside MPC or relaxing the temporary constraints of some devices; if Then the projection control trajectory will be executed normally.
9. A wastewater treatment MPC control trajectory target holding projection system, characterized in that, To perform the method according to claims 1-8, comprising: The MPC controller module is used to generate the original control trajectory using a simplified constraint model based on the prediction model and optimization objective function of the wastewater treatment process. It outputs the full trajectory target gradient vector corresponding to the original trajectory. ; The Real Constraint Library module stores the set of real physical constraints for each heterogeneous actuator in the wastewater treatment system. The real physical constraints include amplitude hard constraints, rate constraints and cumulative constraints. The real physical constraints are more stringent than the simplified constraint model inside MPC or include constraints that change in real time. The constraint violation detection module is used to receive the original control trajectory. and the set of real physical constraints Calculate the constraint violation amount of each device at each time point. And determine whether projection needs to be performed; The target-preserving projection solver module is used to receive the original control trajectory. The full trajectory target gradient vector and the set of real physical constraints Construct and solve the target-preserving projection problem, and output the control trajectory after projection. ; The projection problem solved by the target-preserving projection solver module is simultaneously subject to rate constraints and cumulative constraints in the entire prediction time domain. The rate constraints reflect a temporal coupling relationship, and the cumulative constraints reflect a budget coupling relationship. The objective function of the projection problem includes a distance minimization term. Keep the target item ; The full trajectory target gradient vector It implicitly encodes the degree of influence of each time step on the optimization objective, so that the global solution process prioritizes protecting the time step with the larger gradient when there are conflicts in the propagation of time constraints.
10. A wastewater treatment MPC control trajectory target holding projection system according to claim 9, characterized in that, It also includes a target degradation monitoring module, which is used for: Calculate the control trajectory after projection Compared with the original control trajectory Difference in objective function values ; When the difference exceeds a preset threshold, an over-constraint alarm signal is generated, indicating that the difference between the MPC simplified constraint model and the real physical constraints is too large; The alarm signal is sent to the MPC controller module to trigger the recalibration process of the constraint model.