Chemical process optimization method and device, storage medium and electronic equipment

By reconstructing and solving the quadratic programming problem in chemical process simulation, and utilizing slack variables, penalty factors, and Lagrangian functions, combined with iterative refinement and the Kahan compensation algorithm, the ill-conditioned QP problem in chemical process simulation is solved, achieving efficient and accurate solutions for chemical process optimization.

CN120808930BActive Publication Date: 2026-02-03SUPCON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511311803.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2026-02-03
Estimated Expiration
2045-09-15

AI Technical Summary

Technical Problem

The existing chemical process simulation technology suffers from ill-conditioned QP problem, which limits the solution accuracy of chemical process optimization and thus affects the low efficiency of chemical process optimization.

Method used

The quadratic programming problem is reconstructed by introducing slack variables and penalty factors through a reconstruction step. It is then transformed into a system of quadratic programming equations that satisfy the KKT conditions using the Lagrangian function. The equations are solved using iterative refinement and the Kahan compensation algorithm, combined with an improved blocking constraint stabilization selection strategy, until the preset convergence condition is reached.

Benefits of technology

It improves the accuracy and stability of numerical calculations in chemical process simulation, avoids numerical reduction problems, ensures rapid response and real-time performance in chemical process optimization, and provides efficient and accurate optimization results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808930B_ABST
    Figure CN120808930B_ABST
Patent Text Reader

Abstract

The application provides a chemical process optimization method and device, a storage medium and an electronic equipment. A quadratic programming problem in a chemical process simulation is reconstructed to obtain a target quadratic programming problem in a reconstruction step. The target quadratic programming problem is converted into a quadratic programming equation group satisfying KKT conditions in a solving step. A preset strategy is used to solve the quadratic programming equation group to obtain a solving result of the quadratic programming equation group. In a selection step, an improved blocking constraint stable selection strategy is used to determine a blocking constraint based on the solving result of the quadratic programming equation group. The blocking constraint is used to determine whether a preset convergence condition is reached. In a repetition step, if the preset convergence condition is not reached, the solving step and the selection step are repeatedly executed until the preset convergence condition is reached. A solving result of the quadratic programming problem in the chemical process simulation is obtained. The solving result is used for a corresponding actual chemical process. The problem of low solving efficiency of simulation optimization of a chemical process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of solving quadratic programming problems in chemical process simulation, and more specifically, to an optimization method for chemical processes, an optimization device for chemical processes, a computer-readable storage medium, and an electronic device. Background Technology

[0002] The optimization of chemical processes relies on the accuracy and efficiency of their process simulation. Chemical process simulation, as a digital mapping of a complex system, can comprehensively describe the physicochemical behavior of each stage of chemical production, including material balance, energy conversion, and chemical reaction kinetics. In this context, Sequential Quadratic Programming (SQP) acts as a bridge connecting nonlinear theory and practical operation, transforming the nonlinearly constrained chemical process optimization problem into a series of quadratic programming (QP) subproblems, aiming to find the optimal solution through a stepwise approximation method.

[0003] However, traditional QP solvers perform poorly when solving quadratic programming (QP) subproblems generated by the SQP algorithm. Existing technologies employ regularization techniques to improve the condition number of the Hessian matrix to overcome these problems, but they cannot completely solve the ill-conditioned QP problem encountered in chemical process simulation. This limits the accuracy of the chemical process simulation, directly impacting the actual benefits of chemical process optimization and resulting in low optimization efficiency. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, computer-readable storage medium, and electronic device for optimizing chemical processes, so as to at least solve the problem of low optimization efficiency of chemical processes in the prior art.

[0005] To achieve the above objectives, according to one aspect of this application, a method for optimizing a chemical process is provided, comprising: a reconstruction step, obtaining a quadratic programming problem in a chemical process simulation, and reconstructing the quadratic programming problem based on slack variables and a penalty factor to obtain a target quadratic programming problem, wherein the results of the chemical process simulation are applied to a corresponding actual chemical process to optimize the actual chemical process; and a solution step, transforming the target quadratic programming problem into a system of quadratic programming equations satisfying KKT conditions based on a Lagrangian function, and solving the system of quadratic programming equations using a preset strategy to obtain the solution result of the system of quadratic programming equations, wherein the preset strategy includes at least iterative refinement. The algorithm is refined using the Kahan compensation algorithm. A selection step involves determining the blocking constraints based on the solution results of the quadratic programming equations using an improved blocking constraint stability selection strategy. The blocking constraints are then used to determine whether the solution has reached a preset convergence condition, which is set based on the original step size tolerance and the sign verification of the dual variables. A repetition step is then performed: if the solution has not reached the preset convergence condition, the solution step and the selection step are repeated until the solution reaches the preset convergence condition, thus obtaining the solution result of the quadratic programming problem in the chemical process simulation. This solution result is then applied to the corresponding actual chemical process.

[0006] Optionally, a preset strategy is used to solve the quadratic programming equation system to obtain the solution result. The preset strategy includes at least iterative refinement and Kahan compensation algorithm, including: using the Bunch-Kaufman decomposition algorithm to decompose the quadratic programming equation system into a composite matrix, the composite matrix including a KKT matrix, an ordered matrix, a unit lower triangular matrix, and a diagonal matrix; using the iterative refinement to solve the composite matrix to obtain the solution result of the quadratic programming equation system, wherein four-precision floating-point numbers are used for calculation when obtaining the values ​​of the residual term and the updated solution, and double-precision floating-point numbers are used for calculation during the solution process, wherein the Kahan compensation algorithm is used for precision compensation during the solution process.

[0007] Optionally, the Bunch-Kaufman decomposition algorithm is used to decompose the quadratic programming equation system into a composite matrix, including: decomposing the quadratic programming equation system using the Bunch-Kaufman decomposition algorithm, and storing the matrix elements in the decomposition process using IEEE double-precision floating-point numbers to obtain a preliminary decomposition result, wherein the matrix elements include the elements of the KKT matrix and intermediate calculation results; and incrementally modifying the preliminary decomposition result using a decomposition modification algorithm to generate the composite matrix.

[0008] Optionally, the selection step, based on the solution results of the quadratic programming equations, employs an improved blocking constraint stability selection strategy to determine the blocking constraint, including: adding a perturbation term to the blocking constraint based on the solution results of the quadratic programming equations to obtain the improved blocking constraint, wherein the perturbation term represents the maximum value of boundary violation; minimizing the improved blocking constraint, and calculating a step size based at least on the current iteration value and the search direction, wherein the step size is the length moved along the search direction; and, if the step size is less than 1, determining the constraint related to the slack variable as the blocking constraint.

[0009] Optionally, the blocking constraints are used to determine whether the solution has reached a preset convergence condition. The preset convergence condition is set based on the original step size tolerance and the dual variable sign verification, including: solving using the blocking constraints and calculating the original step size tolerance based on the current iteration value; if the original step size tolerance is less than a first preset threshold, verifying the dual variable sign using the objective function decrease criterion, which is set based on the change in the objective function; if the dual sign is a negative dual sign, removing the constraint of the negative dual sign from the current active set; if the change in the objective function is less than a second preset threshold, determining that the solution has reached the preset convergence condition.

[0010] Optionally, transforming the objective quadratic programming problem into a system of quadratic programming equations satisfying the KKT conditions based on the Lagrangian function includes: setting the Lagrangian function for the objective quadratic programming problem; setting a standard form KKT matrix based on the Lagrangian function; and transforming the objective quadratic programming problem into the system of quadratic programming equations satisfying the KKT conditions based on the KKT matrix.

[0011] Optionally, obtaining the quadratic programming problem in the chemical process simulation includes: obtaining the nonlinear optimization problem in the chemical process simulation; linearizing the constraints of the nonlinear optimization problem using a sequential quadratic programming algorithm to generate the quadratic programming problem.

[0012] According to another aspect of this application, an optimization apparatus for a chemical process is provided, comprising: a reconstructing unit for performing a reconstructing step, the reconstructing step including obtaining a quadratic programming problem in a chemical process simulation, and reconstructing the quadratic programming problem based on slack variables and a penalty factor to obtain a target quadratic programming problem; a solving unit for performing a solving step, the solving step including transforming the target quadratic programming problem into a system of quadratic programming equations satisfying KKT conditions based on a Lagrangian function, and solving the system of quadratic programming equations to obtain a solution result of the system of quadratic programming equations; a selection unit for performing a selection step, the selection step including determining a blocking constraint based on the solution result of the system of quadratic programming equations using an improved blocking constraint stable selection strategy, and using the blocking constraint to determine whether the solution has reached a preset convergence condition; and a repeating unit for performing a repeating step, the repeating step including repeating the solving step and the selection step if the solution has not reached the preset convergence condition until the solution reaches the preset convergence condition, obtaining a solution result of the quadratic programming problem in the chemical process simulation, and applying the solution result to the corresponding actual chemical process.

[0013] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the optimization methods of the described chemical process.

[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including an optimization method for performing any of the described chemical processes.

[0015] The technical solution of this application includes the following steps: A reconstruction step obtains a quadratic programming problem in a chemical process simulation, and reconstructs the problem based on slack variables and penalty factors to obtain a target quadratic programming problem. The results of the chemical process simulation are applied to the corresponding actual chemical process to optimize it. A solution step transforms the target quadratic programming problem into a system of quadratic programming equations satisfying the KKT conditions based on the Lagrangian function, and solves the system of equations using a preset strategy to obtain the solution results. The preset strategy includes at least iterative refinement and the Kahan compensation algorithm. A selection step determines the blocking constraints based on the solution results of the quadratic programming equations using an improved blocking constraint stability selection strategy, and uses the blocking constraints to determine whether the solution meets the preset convergence conditions. The preset convergence conditions are set based on the original step size tolerance and the sign verification of the dual variables. A repetition step repeats the solution and selection steps until the solution meets the preset convergence conditions, obtaining the solution results of the quadratic programming problem in the chemical process simulation, and applying these results to the corresponding actual chemical process. This scheme effectively addresses ill-conditioned matrix problems caused by differences in parameter dimensions through a reconstruction step. By utilizing the Lagrangian function and KKT conditions, and employing pre-defined strategies including iterative refinement and Kahan compensation algorithms, it improves the accuracy and stability of numerical calculations while avoiding the numerical reduction problem common in traditional methods. The improved blocking constraints accurately identify and handle boundary conditions that are about to become active constraints, thereby reducing unnecessary constraint adjustments during iteration and accelerating the solution process. The pre-defined convergence conditions ensure the convergence of the algorithm and the reliability of the solution. Through this series of steps, it can provide efficient and accurate chemical process optimization results while maintaining fast response and real-time performance, thus solving the problem of low solution efficiency in the simulation optimization of chemical processes in existing technologies. Attached Figure Description

[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for performing an optimization method for a chemical process according to an embodiment of this application is shown.

[0018] Figure 2 A schematic flowchart of a chemical process optimization method according to an embodiment of this application is shown.

[0019] Figure 3A structural block diagram of a chemical process optimization apparatus provided according to an embodiment of this application is shown.

[0020] The above figures include the following reference numerals:

[0021] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] As described in the background section, the existing technology cannot completely solve the ill-conditioned QP problem encountered in chemical process simulation, which limits the solution accuracy of chemical process simulation and directly affects the actual benefits of chemical process optimization, resulting in low optimization efficiency. In order to solve the problem of low optimization efficiency of chemical processes, the embodiments of this application provide a chemical process optimization method, a chemical process optimization device, a computer-readable storage medium, and an electronic device.

[0026] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0027] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a chemical process optimization method according to an embodiment of the present invention. (See diagram below.) Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the chemical process optimization method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0029] This embodiment provides an optimization method for a chemical process that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] Figure 2 This is a schematic flowchart of a chemical process optimization method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0031] Step S201, Reconstruction Step: Obtain the quadratic programming problem in the chemical process simulation, and reconstruct the quadratic programming problem based on slack variables and penalty factors to obtain the target quadratic programming problem. The results of the chemical process simulation are applied to the corresponding actual chemical process to optimize the actual chemical process.

[0032] Specifically, chemical process simulation is a complex process involving precise mathematical modeling of multiple aspects such as chemical reactions, logistics, and energy exchange. During the simulation, to optimize a specific objective of the chemical process (e.g., maximizing output or minimizing energy consumption), nonlinear optimization problems often need to be solved. To address these problems, sequential quadratic programming (SQP) is a commonly used technique. It generates a series of quadratic programming problems (QP problems) by linearly approximating the nonlinear constraints at the current point. Each QP problem represents a locally approximate optimization task at the current optimization point.

[0033] The key to the reconstruction step lies in transforming the original QP problem into a more solvable "objective quadratic programming problem" by introducing slack variables and setting appropriate penalty factors. Slack variables allow the solution to temporarily deviate from the constraint boundaries, which is particularly important in numerical computation, preventing infeasibility issues caused by numerical errors. Simultaneously, the addition of penalty factors imposes additional costs on deviations from constraints, prompting the algorithm to automatically adjust during iterations and gradually approach the optimal solution that satisfies all constraints. Through this method, the QP problem, which might have been difficult to solve due to overly tight constraints, is transformed into a more stable and manageable form. The QP problem has the following form:

[0034] ;

[0035] in, The current value of the variable. The second derivative of the matrix. For gradient terms, This is the constraint matrix.

[0036] Furthermore, quadratic programming problems have the following characteristics: matrix H is usually an ill-conditioned matrix and contains gradient terms. With extremely large values; the constraint matrix A is usually a dense matrix.

[0037] This embodiment optimizes and improves the traditional efficient set algorithm based on the primal efficient set method, supporting the solution of ill-conditioned QP problems. The primal efficient set method requires an initial feasible point, typically obtained through linear programming. To eliminate this computational overhead, a reconstruction based on a penalty function is performed. Slack variables are introduced into the initial quadratic programming problem. With penalty factor This leads to the quadratic programming problem:

[0038] ;

[0039] In the above formula, As slack variables, The lower boundary of the variable, The upper boundary of the variable, Scaling the slack variables to fit within the constraints, The penalty factor for violating constraints. The penalty factor in the reconstructed quadratic programming model. Numerical instability may occur during the calculation process, therefore the penalty factor needs to be carefully selected to avoid excessively large values. Through rigorous mathematical analysis, it can be proven that this penalized QP problem has the property of an exact penalty function. This fundamental property ensures that when the penalty factor exceeds a certain threshold, the penalized model is equivalent to the original constrained optimization problem.

[0040] The reconstruction step involves accurately extracting the quadratic programming problem generated in the chemical process simulation and innovatively reconstructing it using slack variables and penalty factors, transforming it into a more stable and easier-to-solve objective quadratic programming problem. This process significantly enhances the algorithm's ability to handle complex constraints and ill-conditioned numerical values, enabling the prediction results of the chemical process simulation to more accurately reflect the optimization needs of the actual chemical process.

[0041] In solving quadratic programming problems, the choice of penalty factor is crucial to the performance of the reconstructed QP problem. Traditional methods often use a fixed penalty factor, which can lead to poor results in chemical process simulations with varying complexities. Therefore, this embodiment introduces an adaptive penalty factor adjustment strategy. This strategy dynamically adjusts the penalty factor based on the characteristics of the problem during the current iteration, ensuring that the algorithm achieves optimal solution efficiency and accuracy in various scenarios.

[0042] Specifically, the algorithm starts with a low initial penalty factor. During iteration, the penalty factor is dynamically adjusted by monitoring two key indicators: the rate of improvement of the objective function and the degree of constraint violation. When the objective function improves slowly or constraints are significantly violated, the algorithm automatically increases the penalty factor, forcing the solution to move in the direction that satisfies the constraints. Conversely, if the objective function improves rapidly and the current solution is close to the constraint boundary, the penalty factor is appropriately reduced to avoid excessive penalty leading to a decrease in solution efficiency. This strategy intelligently balances the penalty intensity and solution speed, improving the algorithm's adaptability and robustness in handling complex chemical process simulation problems.

[0043] Step S202, the solution step, transforms the above objective quadratic programming problem into a quadratic programming equation system that satisfies the KKT conditions based on the Lagrangian function, and solves the above quadratic programming equation system using a preset strategy to obtain the solution result of the above quadratic programming equation system. The preset strategy includes at least iterative refinement and Kahan compensation algorithm.

[0044] Specifically, the solution process involves transforming the reconstructed objective quadratic programming problem into a solvable form and then efficiently and accurately solving it using a series of pre-defined strategies. First, based on the Lagrange function principle, the objective quadratic programming problem is transformed into a system of quadratic programming equations equivalent to the KKT (Karush-Kuhn-Tucker) conditions. The Lagrange function is a mathematical technique that integrates the objective function and constraints by introducing Lagrange multipliers, transforming complex constrained optimization problems into unconstrained optimization problems, thus simplifying the solution process. In the context of chemical process optimization, this step connects the objective of chemical production (e.g., maximizing output or minimizing energy consumption) and all relevant operational constraints (e.g., boundary conditions such as temperature and pressure) using Lagrange multipliers to form a new objective function, the Lagrange function. The system of quadratic programming equations satisfying the KKT conditions is as follows: ,in, It is the perturbation quantity, typically 1e-6.

[0045] The goal of the problem is to find a solution that satisfies the KKT conditions, i.e., a set of variable values ​​such that the gradient of the Lagrangian function is zero, and that the equality and inequality of the constraints are satisfied, as well as the nonnegativity of the dual variable. The KKT conditions are necessary and sufficient conditions for solving constrained optimization problems. By satisfying the KKT conditions, it can be ensured that the solution found is a local optimum, or even a global optimum.

[0046] To accurately and efficiently solve the constructed quadratic programming equations, a pre-defined strategy is employed, primarily including iterative refinement and the Kahan compensation algorithm. Iterative refinement is a technique to enhance the accuracy of solutions to linear equations. By repeatedly calculating residuals and correcting solutions, the accuracy of the results is gradually improved, ensuring the reliability of the solution even when dealing with ill-conditioned matrices. The Kahan compensation algorithm is used to reduce numerical errors in floating-point operations. By compensating for accumulated errors caused by rounding, it ensures computational stability, especially in handling chemical process optimization problems requiring high-precision calculations, effectively preventing solution failures due to numerical drift.

[0047] The solution process transforms the objective quadratic programming problem into a system of quadratic programming equations satisfying the KKT conditions by constructing a Lagrangian function. This transformation not only ensures the mathematical rigor of the optimization problem but also achieves efficient and accurate solutions to the quadratic programming equations through a pre-defined strategy: the synergistic effect of iterative refinement and the Kahan compensation algorithm. In summary, this solution process significantly improves the ability to solve quadratic programming problems in chemical process optimization, providing a solid technical foundation for further optimizing the operating parameters of actual chemical processes and improving production efficiency and economic performance.

[0048] Step S203, Select Step: Based on the solution results of the above quadratic programming equation system, adopt an improved blocking constraint stability selection strategy to determine the blocking constraints, and use the above blocking constraints to determine whether the solution has reached the preset convergence condition. The above preset convergence condition is set based on the original step size tolerance and the sign verification of the dual variable.

[0049] Specifically, the selection step is mainly based on the solution results of the quadratic programming equation system. An improved blocking constraint stabilization selection strategy is used to identify and determine which constraints constitute "blocking constraints," restricting further movement of the current solution towards the optimization direction. Specifically, after each iteration of solving the quadratic programming equation system, it is necessary to evaluate which constraints are already tight at the current solution, i.e., their satisfaction precisely prevents the solution from further exploring the space of better solutions. The improved blocking constraint stabilization selection strategy identifies blocking constraints, and these constraints are used to determine whether the entire solution process has reached the preset convergence condition. The convergence condition is set based on the original step size tolerance and the sign verification of the dual variable. The original step size tolerance measures the degree of change of the solution in each iteration, while the sign verification of the dual variable checks whether the solutions to the dual problem are consistent, i.e., whether the dual variable remains non-negative. If the step size tolerance is below a set first threshold, and all dual variables associated with the activity set have the correct sign (non-negative), then the algorithm can be considered to have reached convergence, i.e., a solution that meets the given accuracy requirements has been found.

[0050] By introducing an improved blocking constraint selection strategy and convergence condition setting, the entire solution process becomes more stable and efficient. Especially when dealing with quadratic programming problems in chemical process simulations, which often exhibit ill-conditioned characteristics and complex constraint structures, the improved strategy ensures that the algorithm does not get stuck in invalid loops or incorrect directions during iterative solutions, thus avoiding unnecessary waste of computational resources, accelerating the solution speed, and improving solution accuracy. In short, the selection step, through intelligent identification and handling of blocking constraints combined with preset convergence conditions, guarantees the accuracy and efficiency of solving quadratic programming problems, providing strong algorithmic support for chemical process optimization.

[0051] Step S204: Repeat the steps. If the above solution does not meet the preset convergence condition, repeat the above solution steps and the above selection steps until the above solution meets the preset convergence condition, obtain the solution result of the above quadratic programming problem in the above chemical process simulation, and apply the solution result of the above quadratic programming problem in the above chemical process simulation to the corresponding above actual chemical process.

[0052] Specifically, after each solution step and selection step, the current solution result is checked against the preset convergence criteria to see if it meets the termination criteria. If the current solution result fails to meet the preset convergence criteria—that is, the improvement of the solution still exceeds the allowable threshold, or the sign test of the dual variable fails—it means that a stable solution satisfying the optimization objective has not yet been found. In this case, repeating the steps will prompt a return to the solution step, resolving the quadratic programming equations based on the Lagrangian function, followed by the selection step, which again checks for blocking constraints and convergence. This process will continue to loop until the preset convergence criteria are met.

[0053] Repeated steps allow the algorithm to dynamically adjust its solution strategy during the solution of quadratic programming problems in chemical process simulation. Through continuous iteration, it can gradually approach the optimal solution, overcoming challenges such as ill-conditioned matrices and high nonlinearity constraints. Pre-set strategies, such as iterative refinement and the Kahan compensation algorithm, are activated in each iteration, ensuring high accuracy and stability of the computation.

[0054] The iterative steps ensure continuous iteration until the preset convergence condition is met during the solution of the quadratic programming problem in the chemical process simulation. This mechanism greatly enhances the accuracy and stability of the solution. By continuously repeating the solution and selection steps, the optimal solution can be gradually approximated, ensuring the reliability of the solution even under complex and variable chemical constraints. Once the solution reaches the convergence criterion, the obtained quadratic programming solution will be applied to the actual chemical process, directly guiding the optimization and adjustment of operating parameters, thereby realizing intelligent optimization and efficient control of the chemical production process. This closed-loop optimization process not only improves production efficiency but also ensures the safety and economy of the chemical process.

[0055] In this embodiment, the reconstruction step effectively addresses ill-conditioned matrix problems caused by differences in parameter dimensions. By utilizing the Lagrangian function and KKT conditions, and employing pre-defined strategies including iterative refinement and the Kahan compensation algorithm, the accuracy and stability of numerical computation are improved. Simultaneously, the numerical reduction problem common in traditional methods is avoided. The improved blocking constraints accurately identify and handle boundary conditions that are about to become active constraints, thereby reducing unnecessary constraint adjustments during iteration and accelerating the solution process. The pre-defined convergence conditions ensure the convergence of the algorithm and the reliability of the solution. Through this series of steps, efficient and accurate chemical process optimization results can be provided while maintaining rapid response and real-time performance, thus solving the problem of low solution efficiency in the simulation optimization of chemical processes in existing technologies.

[0056] In the specific implementation process, a preset strategy is adopted to solve the above-mentioned quadratic programming equation system to obtain the solution result. The preset strategy includes at least iterative refinement and Kahan compensation algorithm, including: using the Bunch-Kaufman decomposition algorithm to decompose the above-mentioned quadratic programming equation system into a composite matrix, the above-mentioned composite matrix including KKT matrix, sorted matrix, unit lower triangular matrix and diagonal matrix; using the above-mentioned iterative refinement to solve the above-mentioned composite matrix to obtain the solution result of the above-mentioned quadratic programming equation system. Among them, four-precision floating-point numbers are used for calculation when obtaining the residual term and the updated solution value, and double-precision floating-point numbers are used for calculation when solving. Among them, the above-mentioned Kahan compensation algorithm is used for precision compensation during the solution process.

[0057] Specifically, when solving a system of quadratic programming equations satisfying the KKT conditions, the Bunch-Kaufman decomposition algorithm is used to decompose the system of equations. This algorithm can decompose a system of quadratic programming equations satisfying the KKT conditions into a composite matrix form, that is, decompose it into... ,in It is a sorted matrix. It is a unit lower triangular matrix. Since it is a diagonal matrix, this decomposition method can find a stable solution through positive / back substitution, while maintaining the matrix's inertia (the number of positive and negative eigenvalues) unchanged.

[0058] During the solution process, an iterative refinement strategy is employed to further improve the accuracy of the solution. When obtaining the residual term and updating the solution values, a higher level of precision (four times the precision) floating-point calculation is used, which significantly reduces numerical errors and ensures high accuracy. However, in each iteration, standard double-precision floating-point calculations are used to maintain computational efficiency. This mixed-precision approach balances accuracy requirements with computational speed, enabling the algorithm to operate efficiently in the demanding environment of chemical process simulation.

[0059] To address the performance issues in quadruple-precision calculations, the Kahan compensation algorithm is introduced. This algorithm improves numerical accuracy in double-precision calculations by compensating for rounding errors. Especially in chemical process optimization problems requiring high precision, the Kahan compensation algorithm avoids numerical drift, maintains the stability and accuracy of the calculation process, and ensures the validity of the solution.

[0060] By combining Bunch-Kaufman decomposition, iterative refinement, and the Kahan compensation algorithm, the accuracy and efficiency of solving quadratic programming equations in chemical process simulations are significantly improved. First, the Bunch-Kaufman decomposition algorithm transforms the complex quadratic programming equations into a composite matrix containing KKT matrices, sorted matrices, unit lower triangular matrices, and diagonal matrices, thereby enhancing the stability of the solution and ensuring accurate solutions even with ill-conditioned matrices. Second, the iterative refinement strategy significantly reduces numerical errors in key solution steps by calculating residual terms and updating solution values ​​using four times the precision floating-point numbers, while using double-precision floating-point numbers in most calculations to maintain high speed, achieving a balance between accuracy and performance. The Kahan compensation algorithm performs precision compensation during the solution process, effectively avoiding the accumulation of rounding errors in numerical calculations and further consolidating the reliability of the results. In short, the comprehensive application of these strategies not only overcomes the common numerical stability challenges in chemical process simulations but also achieves a dual improvement in computational efficiency and solution accuracy, providing strong technical support for real-time optimization of chemical processes.

[0061] Furthermore, the Bunch-Kaufman decomposition algorithm is used to decompose the above quadratic programming equations into a composite matrix, including: decomposing the above quadratic programming equations using the Bunch-Kaufman decomposition algorithm, and storing the matrix elements in the decomposition process using IEEE double-precision floating-point numbers to obtain preliminary decomposition results. The matrix elements include the elements of the above KKT matrix and intermediate calculation results; and incrementally modifying the above preliminary decomposition results using a decomposition modification algorithm to generate the above composite matrix.

[0062] Specifically, the Bunch-Kaufman decomposition algorithm is used to decompose the KKT matrix in the quadratic programming equation system. This decomposition process transforms the matrix into a form that is easier to solve while ensuring numerical stability. During the decomposition process, all matrix elements, including elements of the KKT matrix and intermediate calculation results, are stored and processed using IEEE double-precision floating-point numbers. Double-precision floating-point numbers offer higher precision than single-precision numbers, which is particularly important for handling complex numerical calculations that may occur in chemical engineering, helping to reduce numerical errors and ensure the stability of the solution process.

[0063] Based on the initial decomposition results, an incremental modification algorithm is employed. This strategy is particularly suitable for scenarios common in active set methods, where constraints in the active set may change (i.e., constraints are added or removed) as the iteration process progresses. The decomposition modification algorithm allows for local adjustments to the existing decomposition results without completely re-decomposing the KKT matrix, reflecting the impact of constraint changes. This incremental modification not only saves computational resources and improves solution efficiency but also avoids the additional numerical errors that might be introduced by a complete re-decomposition, thus maintaining the accuracy of the solution process.

[0064] Through the above steps, high accuracy and stability of solving quadratic programming equations can be ensured while maintaining high computational speed. Especially in chemical process simulation scenarios, facing constraints with huge condition numbers and high nonlinearity, the combined application of Bunch-Kaufman decomposition and incremental modification can overcome the limitations of traditional solution methods in terms of numerical stability and solution efficiency, providing a solid technical foundation for real-time optimization of chemical processes.

[0065] In some embodiments of this application, the selection step, based on the solution results of the above-mentioned quadratic programming equations, adopts an improved blocking constraint stability selection strategy to determine the blocking constraint, including: adding a perturbation term to the blocking constraint based on the solution results of the above-mentioned quadratic programming equations to obtain the above-mentioned improved blocking constraint, wherein the perturbation term represents the maximum value of boundary violation; minimizing the above-mentioned improved blocking constraint, and calculating a step size based at least on the current iteration value and the search direction, wherein the step size is the length of movement along the search direction; and determining the constraint related to the slack variable as the above-mentioned blocking constraint when the step size is less than 1.

[0066] In the QP problem, the formula A more general method for selection blocking constraints is defined, wherein, For the right-hand term, For constraint vectors, This is the current iteration value. This is the search direction. This general method is difficult to use for ill-conditioned QP problems. When dealing with the selection of blocking constraints in ill-conditioned QP problems, two special cases are often encountered: one is the linear dependency between constraints. If the constraint vector is linearly dependent on the constraints in the current activity set, then... The value is very small, making the KKT matrix ill-conditioned. Secondly, when dealing with large penalty factors, numerical cancellation may lead to changes in step size. Inaccurate calculations can lead to excessively large iteration step sizes, causing the current feasible point to move too far and severely violating the constraints. To address this issue, an improved method is proposed: selecting blocking constraints by adding a perturbation term to the selection formula. Typically, it is 1e-6, indicating that the boundary violates the maximum value, and the constraint in the minimized improved constraint selection formula is chosen. .

[0067] However, this perturbation was not included in the step size update formula, and the step size... The calculation formula is: ,like If the value is less than 1, then the slack variable will be... The relevant constraints were identified as blocking constraints. The rationale for this is to prevent certain constraints from being selected into the activity set, and these constraints correspond to… The value is very small, and introducing it into an active set could lead to numerical problems.

[0068] In traditional blocking constraint selection, inappropriate constraints may be chosen due to numerical reduction or ill-conditioned matrices, leading to instability in the iterative process. By adding a perturbation term, the algorithm can more accurately assess the potential impact of each constraint on the current iteration point, thus avoiding the selection of constraints that may cause numerical problems. By minimizing the improved blocking constraints, the constraints that need to be prioritized in the next iteration step are determined. This process comprehensively considers the linear dependence and numerical stability of the constraints, ensuring that the selected blocking constraints can guide the search direction towards a better solution, while avoiding iterative deadlocks due to numerical problems. After determining the improved blocking constraints, the step size along the constraint direction is calculated; that is, the step size controls the length of movement along the search direction, thereby adjusting the position of feasible points during the iteration process. If the calculated step size is less than 1, it means that continuing to move along the current search direction will seriously violate the constraint conditions or lead to numerical instability. In this case, it will be combined with slack variables. The relevant constraint is identified as a blocking constraint, which means that in the next iteration, this constraint will be included in the activity set, restricting further movement in that direction, thereby ensuring the stability of the iterative process and the feasibility of the solution.

[0069] In summary, the improved blocking constraint stability selection strategy effectively solves the ill-conditioned matrix and numerical stability problems commonly encountered in solving quadratic programming problems in chemical process simulation. By introducing a perturbation term, minimizing the improved blocking constraint, and controlling the step size, not only is the stable progress of the iterative process ensured, but the constraint selection is also optimized, avoiding unnecessary numerical problems, thereby improving the efficiency and accuracy of the entire solution process. This strategy is particularly suitable for handling chemical process optimization scenarios with high nonlinearity and complex constraints, helping to find the optimal solution quickly and accurately, and significantly improving the simulation and optimization capabilities of chemical processes.

[0070] In some embodiments of this application, the blocking constraints described above are used to determine whether the solution has reached a preset convergence condition. The preset convergence condition is set based on the original step size tolerance and the dual variable sign verification, including: solving using the blocking constraints and calculating the original step size tolerance based on the current iteration value; if the original step size tolerance is less than a first preset threshold, verifying the dual variable sign using the objective function decrease criterion, which is set based on the change in the objective function; if the dual sign is a negative dual sign, removing the constraint on the negative dual sign from the current active set; and if the change in the objective function is less than a second preset threshold, determining that the solution has reached the preset convergence condition.

[0071] Specifically, after each iteration, the algorithm calculates the original step size tolerance based on the current iteration value. This tolerance reflects the degree of change in the solution during the iteration process and is a key indicator for measuring proximity to the optimal solution. According to the formula... Define the original step size tolerance for the k-th iteration. If the original step size tolerance is less than a first preset threshold... First preset threshold A value of 1e-6 generally indicates that the solution changes very little and is close to convergence. In this case, further verification of the sign of the dual variable is needed to confirm convergence. The objective function decrease criterion is then used. Perform sign verification of the dual variables, where, Let be the absolute value of the change in the objective function. This is a preset threshold, typically 1e-6.

[0072] Once the initial step size tolerance is satisfied, the algorithm enters the dual variable sign verification phase. The sign of the dual variable is closely related to the activity of the constraints. If all dual variables associated with the activity set have non-negative signs, it indicates that the current solution is within the feasible region of the constraints and is either the optimal solution or very close to the optimal solution. If negative dual signs exist, this usually means that some constraints are over-satisfied or violated, requiring adjustment.

[0073] When a negative dual sign is detected, the relevant constraints are removed, and then it is checked whether the change in the objective function is less than a second preset threshold. ,in This objective function reduction criterion is used to determine the optimization effect after removing constraints, i.e., whether the objective function has significantly improved. If the change in the objective function is less than a second preset threshold, the solution has reached the preset convergence condition.

[0074] By utilizing blocking constraints for iterative solutions and simultaneously monitoring changes in the original step size tolerance and the sign of the dual variable, the convergence of the quadratic programming problem can be determined with high accuracy. When the original step size tolerance is less than a first preset threshold, the objective function reduction criterion is activated. By checking the sign of the dual variable, the feasibility of the solution and the correctness of the optimization direction are ensured. If a negative dual sign is found, the activity set is adjusted immediately to eliminate the influence of unreasonable constraints until the change in the objective function is less than a second preset threshold, indicating that the solution process is stabilizing and the optimization effect is significantly slowing down. At this point, it can be determined that the solution has reached the preset convergence condition. This strategy effectively avoids the waste of resources caused by excessive iteration and numerical instability, ensuring the computational efficiency and solution reliability of the algorithm when dealing with complex constrained optimization problems such as chemical process simulation, and providing solid technical support for real-time monitoring and optimization.

[0075] In some embodiments of this application, the objective quadratic programming problem is transformed into a set of quadratic programming equations satisfying the KKT conditions based on the Lagrangian function, including: setting the Lagrangian function for the objective quadratic programming problem; setting a standard form KKT matrix based on the Lagrangian function; and transforming the objective quadratic programming problem into a set of quadratic programming equations satisfying the KKT conditions based on the KKT matrix.

[0076] Specifically, the Lagrangian function is defined for the objective quadratic programming problem. ,in, , , Let be the Lagrange multipliers. Based on the Lagrange function, define the standard form of the KKT matrix, transforming the objective quadratic programming problem into a system of quadratic programming equations satisfying the KKT conditions. ,in, It is the perturbation quantity, typically 1e-6.

[0077] Through the above steps, the original quadratic programming problem is transformed into solving a system of equations satisfying the KKT conditions. Solving this system of equations not only yields the optimal values ​​of the decision variables but also directly derives the Lagrange multipliers of the constraints. These multipliers provide information about the activity of the constraints, providing a basis for updating the activity set and identifying blocking constraints in subsequent iterations. In summary, the above transformation process implicitly incorporates the complex constraints of the quadratic programming problem into the optimization process through Lagrangian functions, thereby transforming it into a system of quadratic programming equations satisfying the KKT conditions. This transformation not only simplifies the solution of the constrained optimization problem but also ensures that the algorithm can robustly handle various constraints encountered in chemical process simulations, providing a powerful tool for efficient and accurate solutions. In practical engineering applications, this transformation method can significantly improve the applicability and solution quality of the quadratic programming algorithm.

[0078] In some embodiments of this application, obtaining a quadratic programming problem in a chemical process simulation includes: obtaining a nonlinear optimization problem in the chemical process simulation; linearizing the constraints of the nonlinear optimization problem using a sequential quadratic programming algorithm to generate the quadratic programming problem.

[0079] Specifically, chemical process simulation often requires solving complex nonlinear optimization problems. These problems may involve multiple aspects such as the operation optimization of continuous stirred tank reactors (CSTRs), distillation column design, and energy minimization, and contain a large number of nonlinear kinetic equations and complex constraints. These nonlinear equations and constraints originate from the interactions between chemical reaction kinetics, heat and mass transfer, equipment operating characteristics, and process parameters, forming the core of chemical process simulation. To solve these nonlinear optimization problems, the SQP algorithm is employed. SQP is an iterative algorithm. In each iteration, a Taylor expansion is performed on the nonlinear constraints at the current point, approximating them as linear constraints, thus transforming the original problem into a quadratic programming (QP) subproblem. Specifically, at the current iteration point, the algorithm performs a first-order Taylor expansion on the nonlinear constraints and constructs a QP subproblem based on the current gradient and second derivative (Hessian matrix) information.

[0080] Through this series of processes, the originally complex nonlinear optimization problem is transformed into a more manageable quadratic programming problem. In each iteration, the algorithm solves such a QP subproblem, gradually approaching the global or local optimum of the nonlinear optimization problem. This characteristic of the SQP algorithm makes it an ideal choice for solving nonlinear optimization problems in chemical process simulation, and also provides a clear direction and foundation for subsequent quadratic programming solutions. In summary, the above describes how, starting from the nonlinear optimization problem in chemical process simulation, the SQP algorithm linearizes the nonlinear constraints, transforming it into a quadratic programming problem, thus creating conditions for its real-time and efficient solution. This transformation plays a crucial role in chemical production optimization, equipment design, and operation, not only simplifying the implementation of optimization algorithms but also improving the accuracy and speed of the solution.

[0081] In chemical process simulations, significant differences in parameter dimensions can lead to abnormally high condition numbers in the KKT matrix, causing numerical instability. To address this issue, this embodiment introduces a multidimensional scaling reduction strategy. This strategy automatically identifies and handles dimensional differences between parameters, reducing the condition number of the KKT matrix by rescaling each parameter, thereby improving numerical stability during the solution process.

[0082] Specifically, in the initial stage of the iteration process, the algorithm performs a dimensional analysis on all parameters, calculating the relative scale differences between them. Then, based on these differences, a suitable scaling factor is assigned to each parameter, ensuring that all parameters are at a relatively balanced scale in the scaled quadratic programming problem. During the scaling process, special care is taken to avoid affecting the mathematical essence of the original problem, ensuring the equivalence of the scaled quadratic programming problem in terms of solution. This strategy significantly reduces the condition number of the KKT matrix, reduces numerical instability, and does not affect the solution space of the quadratic programming problem, guaranteeing the stability and accuracy of the algorithm when dealing with complex chemical process simulations.

[0083] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the chemical process optimization method of this application will be described in detail below with reference to specific embodiments.

[0084] This embodiment relates to a specific optimization method for a chemical process. For nonlinear optimization problems in the field of chemical process simulation, the Sequential Quadratic Programming (SQP) algorithm linearizes the constraints, generating a series of QP problems. The QP problems have the following forms:

[0085] ;

[0086] in, The current value of the variable. The second derivative of the matrix. For gradient terms, This is the constraint matrix.

[0087] Furthermore, the QP problem has the following characteristics: matrix Typically, it consists of an ill-conditioned matrix and gradient terms. With extremely large values; constraint matrix Typically, it is a dense matrix. This embodiment is based on the original effective set method, and optimizes and improves the traditional effective set algorithm to support solving ill-conditioned QP problems. The entire algorithm is divided into five parts.

[0088] 1. Initialization Method for Reconstructing Feasible Solutions. The original effective set method requires initial feasible points, typically obtained through linear programming. To eliminate this computational overhead, a reconstruction method based on penalty functions is proposed. Slack variables are introduced into the original QP problem. With penalty factor :

[0089] ;

[0090] In the above formula, As slack variables, The lower boundary of the variable, The upper boundary of the variable, Scaling the slack variables to fit within the constraints, The penalty factor for violating constraints. The penalty factor in the reconstructed quadratic programming model. Numerical instability may occur during the calculation process, therefore the penalty factor needs to be carefully selected to avoid excessively large values. Through rigorous mathematical analysis, it can be proven that this penalized QP problem has the property of an exact penalty function. This fundamental property ensures that when the penalty factor exceeds a certain threshold, the penalized model is equivalent to the original constrained optimization problem.

[0091] 2. Solving the mixed-precision KKT matrix. The Lagrangian function is defined for the reconstructed QP problem:

[0092] ,in, , , It is a Lagrange multiplier.

[0093] Based on the Lagrange function, a standard form of the KKT matrix can be defined, transforming the problem into solving a KKT system of the following form:

[0094] ;

[0095] in, It is the perturbation quantity, typically 1e-6.

[0096] In solving the KKT system, the Bunch-Kaufman decomposition is used to ensure the numerical stability of the entire process. The Bunch-Kaufman decomposition decomposes the KKT matrix into... ,in It is a sorted matrix. It is a unit lower triangular matrix. Since it is a diagonal matrix, this decomposition method can find a stable solution through positive / back substitution, while maintaining the matrix's inertia (the number of positive and negative eigenvalues) unchanged.

[0097] When solving for the right-hand side, a maximum value of the penalty factor can cause severe numerical elimination. To ensure solution accuracy, the following four strategies are used:

[0098] (1) Mixed-precision data storage method. In the matrix decomposition module, IEEE double-precision floating-point numbers are used for storage. In the residual calculation module, 128-bit floating-point numbers are used.

[0099] (2) Iterative refinement with mixed precision. During the solution process, iterative refinement is used to improve the precision of the solution. In this process, 128-bit floating-point numbers are used to calculate the residual terms and update the solution values, while 64-bit floating-point numbers are used during the solution process. The iterative refinement process is as follows:

[0100] ;

[0101] In the above formula, Let b be the variable value in the k-th iteration, K be the KKT matrix, and b be the right-hand side term. This is the residual term in the k-th iteration during the solution process. This is the correction for the k-th iteration.

[0102] When satisfied At that point, the iterative refinement process is terminated.

[0103] (3) Kahan Compensation Algorithm. While the algorithm guarantees extremely high numerical precision through the aforementioned quadruple-precision floating-point operations, it also faces performance challenges: using the quadmath library in GCC or Intel IFX results in performance approximately 100 times slower than double-precision floating-point. In reality, the required arithmetic operations are primarily addition, subtraction, and multiplication. Therefore, two double-precision numbers can be used to represent a quadruple-precision floating-point number, efficiently implementing these three basic operations. However, quadmath is not universally applicable in implementations, especially when calculating the line search step size in the active set method. In this case, the Kahan compensation algorithm is used to calculate the summation to maintain efficiency.

[0104] (4) Optimized Matrix Decomposition. In traditional activity set methods, modifications to the KKT matrix are achieved only by adding or removing constraints. When the coefficient matrix is ​​well scaled, matrix D remains a diagonal matrix in most cases. Therefore, complete decomposition is usually unnecessary. Referring to efficient decomposition modification algorithms, the existing decomposition is incrementally modified.

[0105] In practical applications, these methods can maintain the computational cost of double precision in most operations while achieving solutions with nearly four times the precision.

[0106] 3. Stability selection strategy for blocking constraints. In the QP problem, the formula... A more general method for selection blocking constraints is defined, wherein, For the right-hand term, For constraint vectors, This is the current iteration value. Indicates the search direction.

[0107] This general method struggles to solve ill-conditioned QP problems. When dealing with blocking constraint selection in ill-conditioned QP problems, two special cases are frequently encountered: one is the linear dependency between constraints. If the constraint vector is linearly dependent on the constraints in the current activity set, then... The value is very small, making the KKT matrix ill-conditioned. Secondly, when dealing with large penalty factors, numerical cancellation may lead to changes in step size. Inaccurate calculations can lead to excessively large iteration step sizes, causing the current feasible point to move too far and severely violating the constraints. To address this issue, an improved method is proposed: selecting blocking constraints by adding a perturbation term to the selection formula. This indicates that the boundary violates the maximum value, and the constraint chosen in the minimized improved constraint selection formula is selected. However, this perturbation was not included in the step size update formula, and the step size... The calculation formula is: .like If the value is less than 1, the constraint will be... This is done as a blocking constraint. The rationale for this is to prevent certain constraints from being selected into the activity set, and these constraints correspond to... The value is very small, and introducing it into an active set could lead to numerical problems.

[0108] 4. Termination criteria for ill-conditioned problems. Termination criteria typically consist of two parts: the tolerance of the original step size and verification of the sign of the dual variable. According to the formula... Define the initial step size tolerance for the k-th iteration. When the tolerance is less than a preset threshold, The threshold can be provided by the user, typically 1e-6. The algorithm continues to check the sign of the dual variable associated with the activity constraints. However, for ill-conditioned QP problems (Hessian matrices with huge condition numbers), the dual variable check cannot be reliably performed due to numerical instability. To address this, a criterion for decreasing the objective function is introduced. ,in, Let be the absolute value of the change in the objective function. This is a preset threshold, typically 1e-6.

[0109] If, after removing a constraint corresponding to a negative dual variable from the current active working set, the improvement in the objective function is numerically unobservable, i.e. This mechanism prevents the testing algorithm from getting stuck in an infinite loop due to numerical oscillations.

[0110] The QP algorithm framework based on the original activity set is as follows:

[0111]

[0112] The framework of the termination condition check algorithm is as follows:

[0113]

[0114]

[0115] This application also provides a chemical process optimization apparatus. It should be noted that this chemical process optimization apparatus can be used to execute the chemical process optimization method provided in this application. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0116] The following describes the chemical process optimization apparatus provided in the embodiments of this application.

[0117] Figure 3 This is a structural block diagram of a chemical process optimization device according to an embodiment of this application. Figure 3 As shown, the device includes a reconstruction unit 10, a solution unit 20, a selection unit 30, and a repeating unit 40. The reconstruction unit executes a reconstruction step, which includes obtaining a quadratic programming problem in the chemical process simulation and reconstructing the quadratic programming problem based on slack variables and penalty factors to obtain a target quadratic programming problem. The solution unit executes a solution step, which includes transforming the target quadratic programming problem into a system of quadratic programming equations satisfying the KKT conditions based on the Lagrangian function and solving the system of equations to obtain the solution result. The selection unit executes a selection step, which includes determining blocking constraints based on the solution result of the quadratic programming equations using an improved blocking constraint stability selection strategy and using the blocking constraints to determine whether the solution has reached a preset convergence condition. The repetition unit executes a repetition step, which includes repeating the solution step and the selection step if the solution has not reached the preset convergence condition until the solution reaches the preset convergence condition, obtaining the solution result of the quadratic programming problem in the chemical process simulation, and applying the solution result to the corresponding actual chemical process.

[0118] In this embodiment, the reconstruction step effectively addresses ill-conditioned matrix problems caused by differences in parameter dimensions. By utilizing the Lagrangian function and KKT conditions, and employing pre-defined strategies including iterative refinement and the Kahan compensation algorithm, the accuracy and stability of numerical computation are improved. Simultaneously, the numerical reduction problem common in traditional methods is avoided. The improved blocking constraints accurately identify and handle boundary conditions that are about to become active constraints, thereby reducing unnecessary constraint adjustments during iteration and accelerating the solution process. The pre-defined convergence conditions ensure the convergence of the algorithm and the reliability of the solution. Through this series of steps, efficient and accurate chemical process optimization results can be provided while maintaining rapid response and real-time performance, thus solving the problem of low solution efficiency in the simulation optimization of chemical processes in existing technologies.

[0119] In the specific implementation, the above-mentioned solution unit includes a decomposition module and a solution module. The decomposition module is used to decompose the above-mentioned quadratic programming equation system into a composite matrix using the Bunch-Kaufman decomposition algorithm. The composite matrix includes a KKT matrix, an ordered matrix, a unit lower triangular matrix, and a diagonal matrix. The solution module is used to solve the above-mentioned composite matrix using the above-mentioned iterative refinement to obtain the solution result of the above-mentioned quadratic programming equation system. Among them, four-precision floating-point numbers are used for calculation when obtaining the residual term and updating the solution value, and double-precision floating-point numbers are used for calculation during the solution process. In the solution process, the above-mentioned Kahan compensation algorithm is used for precision compensation.

[0120] By combining Bunch-Kaufman decomposition, iterative refinement, and the Kahan compensation algorithm, the accuracy and efficiency of solving quadratic programming equations in chemical process simulations are significantly improved. First, the Bunch-Kaufman decomposition algorithm transforms the complex quadratic programming equations into a composite matrix containing KKT matrices, sorted matrices, unit lower triangular matrices, and diagonal matrices, thereby enhancing the stability of the solution and ensuring accurate solutions even with ill-conditioned matrices. Second, the iterative refinement strategy significantly reduces numerical errors in key solution steps by calculating residual terms and updating solution values ​​using four times the precision floating-point numbers, while using double-precision floating-point numbers in most calculations to maintain high speed, achieving a balance between accuracy and performance. The Kahan compensation algorithm performs precision compensation during the solution process, effectively avoiding the accumulation of rounding errors in numerical calculations and further consolidating the reliability of the results. In short, the comprehensive application of these strategies not only overcomes the common numerical stability challenges in chemical process simulations but also achieves a dual improvement in computational efficiency and solution accuracy, providing strong technical support for real-time optimization of chemical processes.

[0121] Furthermore, the decomposition module includes a decomposition submodule and a modification submodule. The decomposition submodule is used to decompose the aforementioned quadratic programming equation system using the Bunch-Kaufman decomposition algorithm, and uses IEEE double-precision floating-point numbers to store the matrix elements during the decomposition process to obtain preliminary decomposition results. The matrix elements include the elements of the aforementioned KKT matrix and intermediate calculation results. The modification submodule is used to incrementally modify the aforementioned preliminary decomposition results using a decomposition modification algorithm to generate the aforementioned composite matrix.

[0122] This embodiment ensures high accuracy and stability in solving quadratic programming equations while maintaining high computational speed. Especially in chemical process simulation scenarios, facing constraints with huge condition numbers and high nonlinearity, the combined application of Bunch-Kaufman decomposition and incremental modification overcomes the limitations of traditional solution methods in terms of numerical stability and efficiency, providing a solid technical foundation for real-time optimization of chemical processes.

[0123] In some embodiments of this application, the selection unit includes a processing module, a first calculation module, and a first determination module. The processing module is used to add a perturbation term to the blocking constraints based on the solution results of the quadratic programming equations, obtaining the improved blocking constraints, where the perturbation term represents the maximum value of boundary violation. The first calculation module is used to minimize the improved blocking constraints and calculate the step size based at least on the current iteration value and the search direction, where the step size is the length moved along the search direction. The first determination module is used to determine the constraints related to the slack variables as the blocking constraints when the step size is less than 1.

[0124] In summary, the improved blocking constraint stability selection strategy effectively solves the ill-conditioned matrix and numerical stability problems commonly encountered in solving quadratic programming problems in chemical process simulation. By introducing a perturbation term, minimizing the improved blocking constraint, and controlling the step size, not only is the stable progress of the iterative process ensured, but the constraint selection is also optimized, avoiding unnecessary numerical problems, thereby improving the efficiency and accuracy of the entire solution process. This strategy is particularly suitable for handling chemical process optimization scenarios with high nonlinearity and complex constraints, helping to find the optimal solution quickly and accurately, and significantly improving the simulation and optimization capabilities of chemical processes.

[0125] In some embodiments of this application, the selection unit includes a second calculation module, a verification module, a removal module, and a second determination module. The second calculation module is used to solve the problem using the blocking constraints and calculate the original step size tolerance based on the current iteration value. The verification module is used to verify the sign of the dual variable using a decreasing objective function criterion when the original step size tolerance is less than a first preset threshold; the decreasing objective function criterion is set based on the change in the objective function. The removal module is used to remove the constraint of the negative dual symbol from the current active set if the dual symbol is a negative dual symbol. The second determination module is used to determine that the solution has reached the preset convergence condition when the change in the objective function is less than a second preset threshold.

[0126] By utilizing blocking constraints for iterative solutions and simultaneously monitoring changes in the original step size tolerance and the sign of the dual variable, the convergence of the quadratic programming problem can be determined with high accuracy. When the original step size tolerance is less than a first preset threshold, the objective function reduction criterion is activated. By checking the sign of the dual variable, the feasibility of the solution and the correctness of the optimization direction are ensured. If a negative dual sign is found, the activity set is adjusted immediately to eliminate the influence of unreasonable constraints until the change in the objective function is less than a second preset threshold, indicating that the solution process is stabilizing and the optimization effect is significantly slowing down. At this point, it can be determined that the solution has reached the preset convergence condition. This strategy effectively avoids the waste of resources caused by excessive iteration and numerical instability, ensuring the computational efficiency and solution reliability of the algorithm when dealing with complex constrained optimization problems such as chemical process simulation, and providing solid technical support for real-time monitoring and optimization.

[0127] In some embodiments of this application, the solution unit includes a setting module and a transformation module. The setting module is used to set the Lagrangian function for the objective quadratic programming problem; the transformation module is used to set the standard form of the KKT matrix according to the Lagrangian function, and to transform the objective quadratic programming problem into the quadratic programming equation system that satisfies the KKT conditions based on the KKT matrix.

[0128] In this embodiment, the original quadratic programming problem is transformed into solving a system of equations satisfying the KKT conditions. Solving this system of equations not only yields the optimal values ​​of the decision variables but also directly derives the Lagrange multipliers of the constraints. These multipliers provide information about the activity of the constraints, providing a basis for updating the activity set and identifying blocking constraints in subsequent iterations. In summary, the above transformation process implicitly incorporates the complex constraints of the quadratic programming problem into the optimization process through Lagrangian functions, thereby transforming it into a system of quadratic programming equations satisfying the KKT conditions. This transformation not only simplifies the solution of the constrained optimization problem but also ensures that the algorithm can robustly handle various constraints encountered in chemical process simulations, providing a powerful tool for efficient and accurate solutions. In practical engineering applications, this transformation method can significantly improve the applicability and solution quality of the quadratic programming algorithm.

[0129] In some embodiments of this application, the reconstruction unit includes an acquisition module and a generation module. The acquisition module is used to acquire the nonlinear optimization problem in the above-mentioned chemical process simulation; the generation module is used to linearize the constraints of the above-mentioned nonlinear optimization problem using a sequential quadratic programming algorithm to generate the above-mentioned quadratic programming problem.

[0130] In this embodiment, the originally complex nonlinear optimization problem is transformed into an easily manageable quadratic programming problem. In each iteration, the algorithm solves such a QP subproblem, gradually approaching the global or local optimum of the nonlinear optimization problem. This characteristic of the SQP algorithm makes it an ideal choice for solving nonlinear optimization problems in chemical process simulation, and also provides a clear direction and foundation for subsequent quadratic programming solutions. In summary, the above describes how, starting from the nonlinear optimization problem in chemical process simulation, the SQP algorithm linearizes the nonlinear constraints, transforming it into a quadratic programming problem, thus creating conditions for its real-time and efficient solution. This transformation plays a crucial role in chemical production optimization, equipment design, and operation, not only simplifying the implementation of optimization algorithms but also improving the accuracy and speed of the solution.

[0131] The optimization device for the aforementioned chemical process includes a processor and a memory. The reconstruction unit, solution unit, selection unit, and repetition unit are all stored as program units in the memory. The processor executes these program units stored in the memory to achieve the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.

[0132] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0133] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the optimization method for the chemical process.

[0134] This invention provides a processor for running a program, wherein the program executes the optimization method for the aforementioned chemical process.

[0135] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the aforementioned chemical process optimization method. The device described herein can be a server, PC, PAD, mobile phone, etc.

[0136] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform the steps of an optimization method for initializing the aforementioned chemical process.

[0137] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0138] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0139] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0140] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0142] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0143] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0144] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0147] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for optimizing a chemical process, characterized in that, include: The reconstruction step involves obtaining a quadratic programming problem from the chemical process simulation, and reconstructing the quadratic programming problem based on slack variables and penalty factors to obtain the target quadratic programming problem. The results of the chemical process simulation are applied to the corresponding actual chemical process to optimize the actual chemical process. The solution steps are as follows: Based on the Lagrange function, the objective quadratic programming problem is transformed into a system of quadratic programming equations satisfying the KKT conditions. The Bunch-Kaufman decomposition algorithm is used to decompose the system of quadratic programming equations into a composite matrix, which includes a KKT matrix, an ordering matrix, a unit lower triangular matrix, and a diagonal matrix. Iterative refinement is used to solve the composite matrix to obtain the solution result of the system of quadratic programming equations. Four-precision floating-point numbers are used when obtaining the residual terms and updating the solution values, and double-precision floating-point numbers are used during the solution process. During the solution process, the Kahan compensation algorithm is used for precision compensation. In the selection step, based on the solution results of the quadratic programming equation system, a perturbation term is added to the blocking constraint to obtain an improved blocking constraint, wherein the perturbation term represents the boundary violation of the maximum value; the improved blocking constraint is minimized, and the step size is calculated at least based on the current iteration value and the search direction, wherein the step size is the length moved along the search direction; if the step size is less than 1, the constraint related to the slack variable is determined as a blocking constraint, and the blocking constraint is used to determine whether the solution has reached the preset convergence condition, wherein the preset convergence condition is set based on the original step size tolerance and the sign verification of the dual variable; Repeat the steps. If the solution does not reach the preset convergence condition, repeat the solution steps and the selection steps until the solution reaches the preset convergence condition, and obtain the solution result of the quadratic programming problem in the chemical process simulation. Then, apply the solution result of the quadratic programming problem in the chemical process simulation to the corresponding actual chemical process.

2. The method according to claim 1, characterized in that, The Bunch-Kaufman decomposition algorithm is used to decompose the quadratic programming equations into a composite matrix, including: The Bunch-Kaufman decomposition algorithm is used to decompose the quadratic programming equation system, and IEEE double-precision floating-point numbers are used to store the matrix elements in the decomposition process to obtain preliminary decomposition results. The matrix elements include the elements of the KKT matrix and intermediate calculation results. The initial decomposition result is incrementally modified using a decomposition modification algorithm to generate the composite matrix.

3. The method according to claim 1, characterized in that, The blocking constraints are used to determine whether the solution has reached the preset convergence condition. The preset convergence condition is set based on the original step size tolerance and the sign verification of the dual variable, including: The solution is obtained using the blocking constraints, and the original step size tolerance is calculated based on the current iteration value. If the original step size tolerance is less than the first preset threshold, the dual variable sign verification is performed using the objective function reduction criterion, which is set based on the change in the objective function. If the dual symbol is a negative dual symbol, then remove the constraint of the negative dual symbol from the current activity set; If the change in the objective function is less than the second preset threshold, the solution is determined to have reached the preset convergence condition.

4. The method according to claim 1, characterized in that, Based on the Lagrangian function, the objective quadratic programming problem is transformed into a system of quadratic programming equations satisfying the KKT conditions, including: The Lagrange function is defined for the objective quadratic programming problem; Based on the Lagrange function, a standard form of the KKT matrix is ​​defined, and based on the KKT matrix, the objective quadratic programming problem is transformed into a system of quadratic programming equations that satisfy the KKT conditions.

5. The method according to claim 1, for obtaining a quadratic programming problem in chemical process simulation, characterized in that, include: Obtain the nonlinear optimization problem in the simulation of the chemical process; The constraints of the nonlinear optimization problem are linearized using a sequential quadratic programming algorithm to generate the quadratic programming problem.

6. An optimization device for a chemical process, characterized in that, include: A reconstruction unit is used to perform reconstruction steps, which include obtaining a quadratic programming problem in a chemical process simulation and reconstructing the quadratic programming problem to obtain a target quadratic programming problem. The solution unit is used to execute the solution steps, which include transforming the objective quadratic programming problem into a system of quadratic programming equations that satisfy the KKT conditions based on the Lagrange function, and decomposing the system of quadratic programming equations into a composite matrix using the Bunch-Kaufman decomposition algorithm. The composite matrix includes a KKT matrix, an ordering matrix, a unit lower triangular matrix, and a diagonal matrix. The composite matrix is ​​solved by iterative refinement to obtain the solution of the quadratic programming equation system. When obtaining the values ​​of the residual term and the updated solution, four-precision floating-point numbers are used for calculation, and double-precision floating-point numbers are used for calculation during the solution process. In the solution process, the Kahan compensation algorithm is used for precision compensation. The selection unit is used to perform a selection step, which includes adding a perturbation term to the blocking constraints based on the solution results of the quadratic programming equations to obtain an improved blocking constraint, wherein the perturbation term represents the maximum value violated at the boundary; minimizing the improved blocking constraint, and calculating the step size based at least on the current iteration value and the search direction, wherein the step size is the length moved along the search direction; if the step size is less than 1, determining the constraints related to the slack variables as blocking constraints, and using the blocking constraints to determine whether the solution has reached the preset convergence condition; A repeating unit is used to execute repeating steps, which include repeating the solution steps and the selection steps if the solution does not reach the preset convergence condition, until the solution reaches the preset convergence condition, to obtain the solution result of the quadratic programming problem in the chemical process simulation, and to use the solution result in the corresponding actual chemical process.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the optimization method of the chemical process according to any one of claims 1 to 5.

8. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising an optimization method for performing a chemical process according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Steady state optimization method suitable for process industry predictive control

    CN113031451A

  • Double-tower system process optimization method based on LU decomposition

    CN119415802A