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

By reconstructing and optimizing the quadratic programming problem in chemical process simulation, and utilizing slack variables, penalty factors, Lagrangian functions, and improved blocking constraint strategies, the ill-conditioned QP problem in chemical process simulation was solved, achieving efficient and accurate solutions for chemical process optimization.

CN120808930AActive Publication Date: 2025-10-17SUPCON TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing technology, there is an ill-conditioned QP problem in chemical process simulation, which limits the solution accuracy of chemical process optimization and further affects the low efficiency of chemical process optimization.

Method used

By reconstructing the quadratic programming problem in chemical process simulation, slack variables and penalty factors are introduced, transforming it into an objective quadratic programming problem. The solution process is then optimized by utilizing the Lagrangian function and KKT conditions, combined with iterative refinement, Kahan compensation algorithm, and improved blocking constraint stability selection strategy.

Benefits of technology

It improves the accuracy and stability of numerical calculations in chemical process simulation, reduces 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 CN120808930A_ABST
    Figure CN120808930A_ABST
Patent Text Reader

Abstract

The invention provides a chemical process optimization method and device, a storage medium and electronic equipment. A reconstruction step: reconstructing the quadratic programming problem in the chemical process simulation to obtain a target quadratic programming problem; a solving step: converting the target quadratic programming problem into a quadratic programming equation set meeting a KKT condition, and solving the quadratic programming equation set by adopting a preset strategy to obtain a solving result of the quadratic programming equation set; a selection step: based on the solving result of the quadratic programming equation set, determining the blocking constraint by adopting an improved blocking constraint stable selection strategy, and judging whether the solving reaches a preset convergence condition or not by utilizing the blocking constraint; repeating the steps, if the preset convergence condition is not met, repeatedly executing the solving step and the selecting step until the preset convergence condition is met, obtaining a solving result of the quadratic programming problem in the chemical process simulation, and applying the solving result to the corresponding actual chemical process. The problem that the solving efficiency of simulation optimization of the chemical process is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of solving quadratic programming problems in chemical process simulation, in particular, to a chemical process optimization method, a chemical process optimization device, a computer readable storage medium and an electronic device. BACKGROUND

[0002] The optimization of a chemical process depends on the accuracy and efficiency of its process simulation. Chemical process simulation, as a digital mapping of a complex system, can describe the physical and chemical behavior of each link in chemical production in detail, including material balance, energy conversion, and chemical reaction kinetics. Sequential Quadratic Programming (SQP) serves as a bridge connecting nonlinear theory and real operation in this context, and can convert nonlinear constrained chemical process optimization problems into a series of Quadratic Programming (QP) sub-problems, aiming to find the optimal solution through a step-by-step approximation method.

[0003] However, when solving the Quadratic Programming (QP) sub-problems generated by the SQP algorithm, the traditional QP solver performs poorly. The regularization technique is used in the prior art to improve the condition number of the Hessian matrix to overcome the above problems, but it cannot completely solve the ill-conditioned QP problems encountered in chemical process simulation, resulting in limited solution accuracy of chemical process simulation, which directly affects the actual benefits of chemical process optimization, and makes the optimization efficiency of the chemical process low. SUMMARY

[0004] The main purpose of the present application is to provide a chemical process optimization method, a chemical process optimization device, a computer readable storage medium and an electronic device to at least solve the problem of low optimization efficiency of the chemical process in the prior art.

[0005] In order to achieve the above object, according to one aspect of the present application, a chemical process optimization method is provided, comprising: a reconstruction step, obtaining a quadratic programming problem in a chemical process simulation, and reconstructing the quadratic programming problem based on a slack variable and a penalty factor to obtain a target quadratic programming problem, wherein a result of the chemical process simulation is applied to a corresponding actual chemical process to optimize the actual chemical process; a solving step, converting the target quadratic programming problem into a quadratic programming equation group satisfying KKT conditions based on a Lagrange function, and solving the quadratic programming equation group by using a preset strategy to obtain a solving result of the quadratic programming equation group, the preset strategy at least including iterative refinement and Kahan compensation algorithm; a selection step, determining blocking constraints by using an improved blocking constraint stable selection strategy based on the solving result of the quadratic programming equation group, and judging whether the solving reaches a preset convergence condition by using the blocking constraints, the preset convergence condition being set based on an original step tolerance and a dual variable sign verification; and a repeating step, if the solving does not reach the preset convergence condition, repeatedly executing the solving step and the selection step until the solving reaches the preset convergence condition, obtaining a solving result of the quadratic programming problem in the chemical process simulation, and applying the solving result of the quadratic programming problem in the chemical process simulation to the corresponding actual chemical process.

[0006] Optionally, the quadratic programming equation group is solved by using a preset strategy to obtain a solving result of the quadratic programming equation group, the preset strategy at least including iterative refinement and Kahan compensation algorithm, comprising: the quadratic programming equation group is decomposed into a compound matrix by using a Bunch-Kaufman decomposition algorithm, the compound matrix including a KKT matrix, a sorting matrix, a unit lower triangular matrix and a diagonal matrix; the compound matrix is solved by using the iterative refinement to obtain the solving result of the quadratic programming equation group, wherein a quadruple precision floating point number is used for calculating a residual term and a value of an updated solution, and a double precision floating point number is used for calculation in solving, and in the solving process, the Kahan compensation algorithm is used for precision compensation.

[0007] Optionally, the quadratic programming equation group is decomposed into a compound matrix by using a Bunch-Kaufman decomposition algorithm, comprising: the quadratic programming equation group is decomposed by using the Bunch-Kaufman decomposition algorithm, and matrix elements in a decomposition process are stored by using IEEE double precision floating point numbers to obtain a preliminary decomposition result, the matrix elements including elements of the KKT matrix and intermediate calculation results; the preliminary decomposition result is incrementally modified by using a decomposition modification algorithm to generate the compound matrix.

[0008] Optionally, the selecting step determines the blocking constraint by using an improved blocking constraint stable selection strategy based on the solution result of the quadratic programming equation set, including: adding a disturbance term into the blocking constraint based on the solution result of the quadratic programming equation set to obtain the improved blocking constraint, the disturbance term representing a maximum value of boundary violation; minimizing the improved blocking constraint and calculating a step length based on at least a current iteration value and a search direction, the step length being a length of movement along the search direction; in a case that the step length is less than 1, determining a constraint related to the relaxation variable as the blocking constraint.

[0009] Optionally, the solving is determined to reach a preset convergence condition by using the blocking constraint, the preset convergence condition being based on an original step length tolerance and a dual variable sign verification setting, including: solving by using the blocking constraint and calculating the original step length tolerance based on a current iteration value; in a case that the original step length tolerance is less than a first preset threshold, performing the dual variable sign verification by using a target function decrease criterion, the target function decrease criterion being based on a variation of a target function; if a dual sign is a negative dual sign, removing a constraint of the negative dual sign from a current active set; in a case that the variation of the target function is less than a second preset threshold, determining that the solving reaches the preset convergence condition.

[0010] Optionally, the target quadratic programming problem is converted into a quadratic programming equation set satisfying a KKT condition based on a Lagrange function, including: setting the Lagrange function for the target quadratic programming problem; setting a KKT matrix in a standard form according to the Lagrange function, and converting the target quadratic programming problem into the quadratic programming equation set satisfying the KKT condition based on the KKT matrix.

[0011] Optionally, the quadratic programming problem in the chemical process simulation is obtained, including: obtaining a nonlinear optimization problem in the chemical process simulation; linearizing a constraint of the nonlinear optimization problem by using a sequential quadratic programming algorithm to generate the quadratic programming problem.

[0012] According to another aspect of the present application, there is provided an optimization apparatus for a chemical process, comprising: a reconstructing unit configured to perform a reconstructing step, the reconstructing step comprising obtaining a quadratic programming problem in a chemical process simulation, and reconstructing the quadratic programming problem based on a slack variable and a penalty factor to obtain a target quadratic programming problem; a solving unit configured to perform a solving step, the solving step comprising converting the target quadratic programming problem into a quadratic programming equation set satisfying KKT conditions based on a Lagrange function, and solving the quadratic programming equation set to obtain a solution of the quadratic programming equation set; a selecting unit configured to perform a selecting step, the selecting step comprising determining a blocking constraint based on the solution of the quadratic programming equation set using an improved blocking constraint stable selection strategy, and judging whether the solution reaches a preset convergence condition using the blocking constraint; and a repeating unit configured to perform a repeating step, the repeating step comprising repeating the solving step and the selecting step until the solution reaches the preset convergence condition if the solution does not reach the preset convergence condition, obtaining a solution of the quadratic programming problem in the chemical process simulation, and using the solution in a corresponding actual chemical process.

[0013] According to still another aspect of the present application, there is provided a computer-readable storage medium, storing a program, wherein the program, when executed, controls a device where the computer-readable storage medium is located to perform any of the optimization methods for a chemical process.

[0014] According to yet another aspect of the present application, there is provided an electronic device, 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, and the one or more programs comprise a program for performing any of the optimization methods for a chemical process.

[0015] The technical scheme of the present application is applied to a reconstruction step, a quadratic programming problem in chemical process simulation is obtained, and the quadratic programming problem is reconstructed based on a slack variable and a penalty factor to obtain a target quadratic programming problem, wherein the result of the chemical process simulation is applied to the corresponding actual chemical process to optimize the actual chemical process; a solution step, the target quadratic programming problem is converted into a quadratic programming equation group satisfying the KKT condition based on a Lagrange function, and the quadratic programming equation group is solved by using a preset strategy to obtain a solution result of the quadratic programming equation group, the preset strategy at least includes iteration refinement and Kahan compensation algorithm; a selection step, based on the solution result of the quadratic programming equation group, an improved blocking constraint stable selection strategy is used to determine the blocking constraint, and the blocking constraint is used to judge whether the solution reaches a preset convergence condition, the preset convergence condition is set based on an original step tolerance and a dual variable sign verification; a repeating step, if the solution does not reach the preset convergence condition, the solution step and the selection step are repeatedly executed until the solution reaches the preset convergence condition, a solution result of the quadratic programming problem in the chemical process simulation is obtained, and the solution result of the quadratic programming problem in the chemical process simulation is used in the corresponding actual chemical process. In the scheme, through the reconstruction step, the ill-conditioned matrix problem caused by the dimensional difference of parameters can be effectively processed, by using the Lagrange function and the KKT condition, the preset strategy including the iteration refinement and the Kahan compensation algorithm is used, the accuracy and stability of numerical calculation are improved, at the same time, the numerical reduction problem commonly seen in traditional methods is avoided, the improved blocking constraint can accurately identify and process those boundary conditions that will become active constraints, thereby reducing unnecessary constraint adjustment in the iteration process and speeding up the solution process, the setting of the preset convergence condition ensures the convergence of the algorithm and the reliability of the solution, through the series of steps, efficient and accurate chemical process optimization results can be provided while maintaining fast response and real-time, thereby solving the problem of low solution efficiency of the simulation optimization of the chemical process in the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0016] The drawings accompanying the specification of the present application form a part thereof, serve to provide further understanding of the present application, and together with the specification explain the present application. The use of these drawings in explaining the present application is in no way intended as a limitation on the present application, and thus the present application should not be construed as being limited to the embodiments set forth in the drawings.

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing an optimization method of a chemical process according to an embodiment of the present application is shown;

[0018] Figure 2 A flowchart of an optimization method of a chemical process according to an embodiment of the present application is shown;

[0019] Figure 3A structural block diagram of an optimization device of a chemical process is shown.

[0020] In the above drawings, the following reference signs apply:

[0021] 102, processor; 104, memory; 106, transmission device; 108, input / output device. DETAILED DESCRIPTION

[0022] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order 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 described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0025] As introduced in the background, the existing technology cannot completely solve the ill-posed QP problem encountered in chemical process simulation, which limits the solution accuracy of chemical process simulation, and further directly affects the actual benefit of chemical process optimization, so that the optimization efficiency of chemical process is low. In order to solve the problem of low optimization efficiency of chemical process, the embodiments of the present 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 in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure diagram of a mobile terminal for a chemical process optimization method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the optimization method of the chemical process in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a 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 above-mentioned 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. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as 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] A method for optimizing a chemical process is provided in this embodiment, which is run on a mobile terminal, a computer terminal or a similar computing device. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in a different order.

[0030] Figure 2 is a schematic diagram of the method for optimizing a chemical process according to the embodiments of the present application. As shown in Figure 2 , the method comprises the following steps:

[0031] Step S201, reconstruction step, obtaining a quadratic programming problem in a chemical process simulation, and reconstructing the quadratic programming problem based on a slack variable and a penalty factor to obtain a target quadratic programming problem, wherein the results of the chemical process simulation are applied to the corresponding actual chemical process to optimize the actual chemical process;

[0032] Specifically, the chemical process simulation is a complex process involving accurate mathematical modeling of chemical reactions, material flow, energy exchange and other aspects. In the simulation process, in order to optimize a certain target of the chemical process (for example, maximize production, minimize energy consumption), a nonlinear optimization problem that needs to be solved is often encountered. In order to solve this kind of problem, the sequential quadratic programming (SQP) algorithm is a common technical route, which generates a series of quadratic programming problems (QP problems) by linearly approximating nonlinear constraints at the current point, and each QP problem represents a local approximation optimization task at the current optimization point.

[0033] The key of the reconstruction step is to deform the original QP problem by introducing a slack variable and setting a suitable penalty factor to form a "target quadratic programming problem" that is more suitable for solving. The slack variable allows the solution to temporarily deviate from the constraint boundary, which is particularly important in numerical calculation, and can prevent infeasibility problems caused by numerical errors. At the same time, the addition of the penalty factor will impose an additional cost on the deviation from the constraint, prompting the algorithm to automatically adjust during the iteration process and gradually approach the optimal solution that satisfies all constraints. By this method, the QP problem that may be difficult to solve due to too tight constraints is transformed into a more stable and easier form. The QP problem has the following form:

[0034] ;

[0035] wherein, is the current variable value, is the matrix second derivative, is the gradient term, is the constraint matrix.

[0036] and the quadratic programming problem has the following characteristics: the matrix H is usually ill-conditioned and the gradient term with a large number of values; the constraint matrix A is usually dense.

[0037] This embodiment is based on the original active set method, which optimizes and improves the traditional active set algorithm and supports the solution of ill-conditioned QP problems. The original active set method requires an initial feasible point, which is usually obtained through linear programming. To eliminate this computational overhead, reconstruction based on the penalty function is performed. In the initial quadratic programming problem, a relaxation variable and a penalty factor are introduced to obtain the target quadratic programming problem:

[0038] ;

[0039] In the above formula, is the relaxation variable, is the lower bound of the variable, is the upper bound of the variable, after scaling the relaxation variable to the constraint range, is the penalty factor for violating the constraint. The penalty factor in the reconstructed quadratic programming model may cause numerical instability in the calculation process, so it needs to be carefully selected to avoid taking a too large value. Through rigorous mathematical analysis, it can be proved that the penalty QP problem has the exact penalty function property, and this fundamental property ensures that when the penalty factor exceeds a certain threshold, the penalty model and the original constraint optimization problem are equivalent.

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

[0041] When solving the quadratic programming problem, the selection of the penalty factor is crucial to the performance of the reconstructed QP problem. In traditional methods, the penalty factor is often fixed, which may lead to poor solving results in different complexity of chemical process simulation scenarios. Therefore, this embodiment introduces an adaptive penalty factor adjustment strategy that can dynamically adjust the penalty factor according to the problem characteristics in the current iteration process, ensuring that the algorithm can achieve the best solving efficiency and accuracy in various scenarios.

[0042] Specifically, the algorithm starts with a low penalty factor initial value. During the iteration process, by monitoring the improvement rate of the objective function and the degree of constraint violation, the penalty factor is dynamically adjusted. When it is found that the objective function improves slowly or the constraint violation is obvious, the penalty factor is automatically increased to force the solution to move towards the direction that satisfies the constraint condition; on the contrary, if the objective function improves rapidly and the current solution is close to the constraint boundary, the penalty factor is appropriately reduced to avoid the decline of solving efficiency caused by excessive punishment. This strategy can intelligently balance the punishment strength and solving speed, improve the adaptability and robustness of the algorithm in dealing with complex chemical process simulation problems.

[0043] In step S202, a solution step is performed to transform the above-mentioned objective quadratic programming problem into a quadratic programming equation group satisfying the KKT condition, and a preset strategy is used to solve the quadratic programming equation group to obtain a solution result of the quadratic programming equation group. The preset strategy at least includes iterative refinement and Kahan compensation algorithm.

[0044] Specifically, the solution step involves transforming the reconstructed objective quadratic programming problem into a solvable form and efficiently and accurately solving it through a series of preset strategies. Specifically, first, based on the Lagrange function principle, the objective quadratic programming problem is converted into a quadratic programming equation group equivalent to the KKT (Karush-Kuhn-Tucker) condition. The Lagrange function is a mathematical technique that combines the objective function and the constraint condition by introducing Lagrange multipliers, which can convert complex constrained optimization problems into unconstrained optimization problems, thereby simplifying the problem solving process. In the context of chemical process optimization, this step connects the objectives of chemical production (such as maximizing production or minimizing energy consumption) and all related operating constraints (such as temperature, pressure, and boundary conditions) through Lagrange multipliers to form a new objective function, i.e., the Lagrange function. The quadratic programming equation group satisfying the KKT condition is wherein, is the perturbation, generally 1e-6.

[0045] The goal of the solution is to find a solution that satisfies the KKT condition, i.e., to find a set of variable values that make the gradient of the Lagrange function zero, while satisfying the equality and inequality constraints, and the non-negativity of the dual variables. The KKT condition is a necessary and sufficient condition for solving constrained optimization problems. By satisfying the KKT condition, it can be ensured that the solution found is a local optimal solution, or even a global optimal solution.

[0046] In order to accurately and efficiently solve the above constructed quadratic programming equations, preset strategies are adopted, mainly including iterative refinement and Kahan compensation algorithm. Iterative refinement is a technique to enhance the accuracy of the solution of linear equations, which gradually improves the accuracy of the solution by repeatedly calculating the residual and correcting the solution, even when facing ill-conditioned matrices, it can ensure the reliability of the solution. Kahan compensation algorithm is used to reduce numerical errors in floating point operations, which compensates for the cumulative error caused by rounding error, ensures the stability of the calculation, especially when dealing with chemical process optimization problems that require high precision calculation, it can effectively avoid the failure caused by numerical drift.

[0047] The solving step converts the target quadratic programming problem into a quadratic programming equation set that satisfies the KKT condition by constructing a Lagrangian function. This conversion not only ensures the mathematical rigor of the optimization problem, but also realizes efficient and accurate solution of the quadratic programming equation set through the synergy of preset strategies, namely iterative refinement and Kahan compensation algorithm. In summary, this solving step greatly improves the solving ability of quadratic programming problems in the process of 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] In step S203, based on the solution of the above quadratic programming equation set, an improved blocking constraint stable selection strategy is used to determine the blocking constraint, and the blocking constraint is used to determine whether the solution meets the preset convergence condition. The preset convergence condition is based on the original step tolerance and the sign verification of the dual variable;

[0049] Specifically, the selection step is mainly based on the solution of the quadratic programming equation set, and the improved blocking constraint stable selection strategy is used to identify and determine which constraints constitute the "blocking constraint", which restricts the further movement of the current solution to the optimization direction. Specifically, after solving the quadratic programming equation set in each iteration, it is necessary to evaluate which constraint conditions are tight at the current solution, i.e. their satisfaction just prevents further exploration of the solution to the space of better solutions. The improved blocking constraint stable selection strategy is used to identify the blocking constraint, and the blocking constraint is used to determine whether the entire solving process meets the preset convergence condition. The setting of the convergence condition is based on the original step tolerance and the sign verification of the dual variable. The original step tolerance measures the degree of change of the solution in each iteration, and the sign verification of the dual variable checks whether the solution of the dual problem is consistent, i.e. whether the dual variable remains non-negative. If the step tolerance is lower than the first threshold value, and all dual variables related to the active set are correctly signed (non-negative), it can be considered that the algorithm has reached the convergence state, i.e. the solution that meets the given accuracy requirement has been found.

[0050] By introducing an improved blocking constraint selection strategy and convergence condition setting, the entire solution process is made more stable and efficient. This is particularly true when dealing with quadratic programming problems in chemical process simulations, which often have pathological characteristics and complex constraint structures. The improved strategy ensures that the algorithm does not fall into invalid loops or incorrect directions during the iterative solution process, thereby avoiding unnecessary waste of computing resources, accelerating the solution speed, and improving the solution accuracy. In short, the selection step ensures the accuracy and efficiency of solving quadratic programming problems by intelligently identifying and processing blocking constraints, combined with the setting of preset convergence conditions, providing strong algorithmic support for chemical process optimization.

[0051] Step S204, repeating the steps. If the solution does not reach the preset convergence condition, the solution step and the selection step are repeated until the solution reaches the preset convergence condition, thereby obtaining a solution to the quadratic programming problem in the chemical process simulation, and applying the solution to the quadratic programming problem in the chemical process simulation to the corresponding actual chemical process.

[0052] Specifically, after each solution step and selection step, the current solution is checked to see if it meets the termination criteria based on the preset convergence conditions. If the current solution fails to meet the preset convergence conditions, that is, the improvement in the solution still exceeds the allowable threshold, or the dual variable sign test fails, this means that a stable solution that meets the optimization objective has not yet been found. At this point, the repetition step will prompt a return to the solution step, where the quadratic programming equations are re-solved based on the Lagrangian function, followed by the selection step, where the blocking constraints are again determined and convergence is checked. This process will continue to loop until the preset convergence conditions are met.

[0053] This repetitive process allows the algorithm to dynamically adjust its solution strategy during the process of solving quadratic programming problems in chemical process simulations. Through continuous iteration, it can gradually approach the optimal solution, overcoming challenges such as ill-conditioned matrices and highly nonlinear constraints. Preset strategies, such as iterative refinement and the Kahan compensation algorithm, are activated at each iteration to ensure high accuracy and stability.

[0054] The repeating step ensures that the secondary planning problem in the chemical process simulation can be iterated continuously until the preset convergence condition is met, which greatly enhances the accuracy and stability of the solution. By continuously repeating the solving step and the selecting step, the optimal solution can be gradually approached, and the reliability of the solution can be guaranteed even in the face of complex and variable chemical constraints. Once the solution converges, the solution of the quadratic programming problem is applied to the actual chemical process to directly guide the optimization and adjustment of the operating parameters, thereby achieving 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] Through this embodiment, the reconstruction step can effectively handle the ill-conditioned matrix problem caused by the dimensional difference of the parameters. By using the Lagrange function and the KKT condition, and using the preset strategy including iterative refinement and Kahan compensation algorithm, the accuracy and stability of numerical calculation are improved, and the numerical reduction problem commonly encountered in traditional methods is avoided. The improved blocking constraint can accurately identify and handle the boundary conditions that are about to become active constraints, thereby reducing unnecessary constraint adjustments during the iteration process and speeding up the solution process. The setting of the preset convergence condition ensures the convergence of the algorithm and the reliability of the solution. Through this series of steps, efficient and accurate optimization results of the chemical process can be provided while maintaining fast response and real-time performance, thereby solving the problem of low solution efficiency of the simulation optimization of the chemical process in the prior art.

[0056] In the specific implementation process, the above quadratic programming equation set is solved by using a preset strategy to obtain a solution of the above quadratic programming equation set. The preset strategy at least includes iterative refinement and Kahan compensation algorithm, which includes: using the Bunch-Kaufman decomposition algorithm to decompose the above quadratic programming equation set into a composite matrix, the composite matrix including a KKT matrix, a sorting matrix, a unit lower triangular matrix, and a diagonal matrix; using the above iterative refinement to solve the composite matrix to obtain the solution of the quadratic programming equation set, wherein a quadruple-precision floating-point number is used to calculate the value of the residual term and the updated solution, and a double-precision floating-point number is used to calculate the solution, and wherein the Kahan compensation algorithm is used for accuracy compensation during the solution process.

[0057] Specifically, when solving the quadratic programming equation set that satisfies the KKT condition, the Bunch-Kaufman decomposition algorithm is used to decompose the quadratic programming equation set. This algorithm can decompose the quadratic programming equation set that satisfies the KKT condition into a composite matrix, that is, decomposed into where is a sorting matrix, is a unit lower triangular matrix, For diagonal matrices, this decomposition method can not only solve the stable solution by forward / backward substitution, but also keep the inertia (the number of positive and negative eigenvalues) of the matrix unchanged.

[0058] During the solving process, the precision of the solution is further improved through an iterative refinement strategy. When obtaining the residual term and updating the solution value, higher-precision quadruple-precision floating-point calculations are used, which greatly reduces numerical errors and ensures high-precision solutions. During each iteration, standard double-precision floating-point calculations are used to maintain computational efficiency. This mixed-precision solving method balances the requirements for precision and speed, allowing the algorithm to efficiently operate in the harsh environment of chemical process simulation.

[0059] To address the performance issues associated with quadruple-precision calculations, the Kahan compensation algorithm is introduced. This algorithm can improve numerical precision by compensating for rounding errors during double-precision calculations. In particular, when dealing with high-precision chemical process optimization problems, the Kahan compensation algorithm can prevent numerical drift, maintain the stability and accuracy of the calculation process, and ensure the effectiveness of the solution.

[0060] By combining the Bunch-Kaufman decomposition, iterative refinement, and Kahan compensation algorithm, the accuracy and efficiency of solving quadratic programming equations in chemical process simulation have been significantly improved. First, the Bunch-Kaufman decomposition algorithm transforms complex quadratic programming equations into a composite matrix containing KKT matrices, ordering matrices, unit lower triangular matrices, and diagonal matrices, enhancing the stability of the solution and ensuring accurate results even for ill-conditioned matrices. Second, the iterative refinement strategy uses quadruple-precision floating-point calculations to calculate residual terms and update solution values during key steps, significantly reducing numerical errors. Meanwhile, double-precision floating-point calculations are used in most calculations to maintain high speed, achieving a balance between precision and performance. The Kahan compensation algorithm compensates for precision during the solving process, effectively avoiding the accumulation of rounding errors in numerical calculations, further ensuring the reliability of the results. In short, through the comprehensive use of the above strategies, not only are the numerical stability challenges commonly encountered in chemical process simulation overcome, but also the computational efficiency and solution accuracy are doubled, providing a strong technical guarantee for real-time optimization of chemical processes.

[0061] Further, the above quadratic programming equation set is decomposed into a composite matrix by using the Bunch-Kaufman decomposition algorithm, including: the above quadratic programming equation set is decomposed by using the Bunch-Kaufman decomposition algorithm, and the matrix elements in the decomposition process are stored by using IEEE double-precision floating-point numbers to obtain a preliminary decomposition result, the matrix elements include elements of the KKT matrix and intermediate calculation results; the preliminary decomposition result is incrementally modified by using a decomposition modification algorithm to generate the composite matrix.

[0062] Specifically, the KKT matrix in the quadratic programming equation set is decomposed by the Bunch-Kaufman decomposition algorithm. This decomposition process is to decompose the matrix into a form that is easy to solve under the premise of ensuring numerical stability. In the decomposition process, all matrix elements, including elements of the KKT matrix and intermediate calculation results in the decomposition process, are stored and processed by using IEEE double-precision floating-point numbers. Double-precision floating-point numbers provide higher precision than single-precision, which is particularly important for handling complex numerical calculations that may occur in chemical engineering, and helps to reduce numerical errors and ensure the stability of the solving process.

[0063] On the basis of the preliminary decomposition result, the decomposition modification algorithm is used for incremental modification. This strategy is particularly suitable for the scenario commonly seen in the active set method, that is, as the iteration process advances, the constraints in the active set may change (i.e., the addition or removal of constraints). The decomposition modification algorithm allows local adjustment of the existing decomposition result without completely re-decomposing the KKT matrix to reflect the impact of constraint changes. This incremental modification not only saves computing resources and improves solving efficiency, but also avoids additional numerical errors that may be introduced by complete re-decomposition, maintaining the accuracy of the solving process.

[0064] Through the above steps, high accuracy and stability of the quadratic programming equation set solving can be ensured while maintaining high computing speed. In particular, in the chemical process simulation scenario, in the face of constraints with huge condition numbers and high nonlinearity, the combination of Bunch-Kaufman decomposition and incremental modification can overcome the limitations of traditional solving methods in numerical stability and solving efficiency, providing a solid technical foundation for real-time optimization of chemical processes.

[0065] In some embodiments of the present application, the selecting step, based on the solution of the above quadratic programming equation set, uses an improved blocking constraint stable selection strategy to determine the blocking constraint, including: based on the solution of the above quadratic programming equation set, adding a disturbance term to the blocking constraint to obtain the above improved blocking constraint, the disturbance term representing the maximum boundary violation; minimizing the improved blocking constraint, and calculating a step size based on at least the current iteration value and the search direction, the step size being the length of movement along the search direction; in the case where the step size is less than 1, determining the constraint related to the relaxation variable as the blocking constraint.

[0066] In the QP problem, the formula defines a more general method of selecting blocking constraints, where, is the right end term, is the constraint vector, is the current iteration value, is the search direction. This general method is difficult to solve ill-conditioned QP problems. In the process of selecting blocking constraints for ill-conditioned QP problems, two special cases are often encountered. One is the linear dependence between constraints. If the constraint vector is linearly dependent on the constraints in the current active set, the value of is very small, making the KKT matrix ill-conditioned. Two is that numerical cancellation. When dealing with larger penalty factors, numerical cancellation can cause the calculation of the step size to be inaccurate, which can in turn cause the iteration step size to be too large, moving the current feasible point too far and seriously violating the constraint condition. To solve the above problems, an improved method is proposed to select the blocking constraint, which adds a disturbance term , usually 1e-6, representing the maximum boundary violation, to the selection formula, and selects the constraint that minimizes the improved constraint selection formula .

[0067] However, in the step size update formula, this disturbance is not added, and the calculation formula of the step size is , and if is less than 1, the constraint related to the relaxation variable is determined as the blocking constraint. The reason for this is to avoid some constraints being selected into the active set, which correspond to values that are very small, and if introduced into the active set, will cause numerical problems.

[0068] In traditional block constraint selection, inappropriate constraints may be selected due to numerical degradation or matrix ill-conditioning, leading to unstable iteration processes. By introducing a perturbation term, the algorithm can more accurately assess the potential impact of each constraint on the current iteration point, thereby avoiding the selection of constraints that may cause numerical problems. By minimizing the improved block constraint, the constraints that need to be prioritized in the next iteration step are determined. This process takes into account the linear dependence of the constraints and numerical stability, ensuring that the selected block constraints can guide the search direction towards a better solution, while avoiding falling into an iterative dead loop due to numerical problems. After determining the improved block constraint, the step size along the constraint direction is calculated, i.e., the step size controls the length of movement along the search direction, thereby adjusting the position of the feasible point in 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. At this time, the constraint related to the relaxation variable is determined as the block constraint, meaning that in the next iteration, this constraint will be included in the active set, limiting further movement in that direction, thereby ensuring the stability of the iteration process and the feasibility of the solution.

[0069] In summary, through the improved block constraint stable selection strategy, the problems of ill-conditioned matrix and numerical stability in solving quadratic programming problems in chemical process simulation are effectively solved. By introducing a perturbation term, minimizing the improved block constraint, and controlling the step size, not only is the stable advancement of the iteration process ensured, but also the constraint selection is optimized, unnecessary numerical problems are avoided, thereby improving the efficiency and accuracy of the entire solving process. This strategy is particularly suitable for handling high nonlinearity and complex constraint chemical process optimization scenarios, and can help quickly and accurately find the optimal solution, significantly improving the simulation and optimization capabilities of chemical processes.

[0070] In some embodiments of the present application, the above block constraint is used to determine whether the solution meets the preset convergence condition, and the preset convergence condition is set based on the original step tolerance and the dual variable sign verification, including: using the above block constraint to solve, and calculating the original step tolerance based on the current iteration value; in the case where the original step tolerance is less than a first preset threshold, using a target function decreasing criterion to perform the dual variable sign verification, the target function decreasing criterion being set based on the change amount of the target function; if the dual sign is a negative dual sign, removing the constraint of the negative dual sign from the current active set; in the case where the change amount of the target function is less than a second preset threshold, determining that the solution meets the preset convergence condition.

[0071] Specifically, after each round of iteration solving, the algorithm calculates the original step tolerance based on the current iteration value, which reflects the degree of change of the solution in the iteration process and is a key indicator of approaching the optimal solution. According to the formula define the original step tolerance at the kth iteration, if the original step tolerance is less than a first preset threshold , the first preset threshold is generally 1e-6, indicating that the solution changes very little, close to the convergence state, at which time the sign of the dual variable needs to be further verified to confirm the convergence. The objective function decrease criterion is used to verify the sign of the dual variable, wherein, is the absolute value of the change in the objective function, is a threshold value for the preset, generally 1e-6.

[0072] When the original step tolerance meets the condition, the algorithm enters the sign verification stage of the dual variable. The sign of the dual variable is closely related to the activity of the constraint. If all the dual variables related to the active set are non-negative, it indicates that the current solution is in the feasible region of the constraint condition and is an optimal solution or very close to the optimal solution. If there is a negative dual sign, it usually means that some constraints are over-satisfied or violated, which needs to be adjusted.

[0073] When a negative dual sign is detected, the related constraint is removed, and then it is checked whether the change in the objective function is less than a second preset threshold , wherein . This objective function decrease criterion is used to judge the optimization effect after removing the constraint, that is, whether the objective function is significantly improved. If the change in the objective function is less than the second preset threshold, the solution reaches the preset convergence condition.

[0074] By using the blocking constraint for iterative solution, while monitoring the changes in the original step tolerance and the sign of the dual variable, it can be highly accurately determined whether the solution of the quadratic programming problem reaches the convergence state. When the original step tolerance is less than the first preset threshold, the objective function decrease criterion is started, and the feasibility of the solution and the correctness of the optimization direction are ensured through the check of the sign of the dual variable. If a negative dual sign is found, the active set is immediately adjusted to exclude the unreasonable constraint effect until the change in the objective function is less than the second preset threshold, indicating that the solution process tends to be stable and the optimization effect significantly slows down, at which time 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, ensures the calculation efficiency and reliability of the solution of the algorithm in processing complex constraint optimization problems such as chemical process simulation, and provides a solid technical support for real-time monitoring and optimization.

[0075] In some embodiments of the present application, the target quadratic programming problem is converted into a set of quadratic programming equations that satisfies the KKT conditions based on the Lagrangian function, including: setting the Lagrangian function for the target quadratic programming problem; setting a standard form KKT matrix according to the Lagrangian function, and converting the target quadratic programming problem into the set of quadratic programming equations that satisfies the KKT conditions based on the KKT matrix.

[0076] Specifically, the Lagrangian function is defined for the target quadratic programming problem ,in, , , is the Lagrange multiplier. According to the Lagrange function, the standard form of the KKT matrix is ​​set, and the target quadratic programming problem is transformed into a quadratic programming equation system that satisfies the KKT conditions. ,in, is the perturbation amount, generally 1e-6.

[0077] Through the above steps, the original quadratic programming problem is transformed into a system of equations that satisfies 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 active 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 via Lagrange functions, thereby transforming it into a system of quadratic programming equations that satisfies the KKT conditions. This transformation not only simplifies the solution of constrained optimization problems but also ensures that the algorithm can robustly handle the 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 quadratic programming algorithms.

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

[0079] Specifically, in chemical process simulation, complex nonlinear optimization problems often need to be solved, which may involve the operation optimization of continuous stirred tank reactors (CSTR), distillation column design, energy minimization, etc. These nonlinear equations and constraints come from chemical reaction kinetics, heat and mass transfer, equipment operating characteristics and the interaction between process parameters, which constitute the core part of chemical process simulation. In order to solve the above nonlinear optimization problem, SQP algorithm is adopted. SQP is an iterative algorithm, in each iteration, Taylor expansion is performed on the nonlinear constraints at the current point, which is approximated as a linear constraint, thereby transforming the original problem into a quadratic programming (QP) subproblem. Specifically, the algorithm performs first-order Taylor expansion on the nonlinear constraints at the current iteration point, and constructs a QP subproblem based on the current gradient and second-order derivative (Hessian matrix) information.

[0080] Through this series of processes, the originally complex nonlinear optimization problem is transformed into a quadratic programming problem that is easy to handle. In each iteration, the algorithm solves a QP subproblem, gradually approaching the global or local optimal solution of the nonlinear optimization problem. This feature of SQP algorithm makes it an ideal choice for solving nonlinear optimization problems in chemical process simulation, and also provides a clear direction and basis for subsequent quadratic programming solution. In summary, the above is from the nonlinear optimization problem of chemical process simulation, by applying SQP algorithm, the nonlinear constraints are linearized and transformed into a quadratic programming problem, which creates conditions for real-time and efficient solution. This transformation plays a crucial role in chemical production optimization, equipment design and operation process, not only simplifies the implementation of optimization algorithm, but also improves the accuracy and speed of solution.

[0081] In chemical process simulation, due to the huge difference in the dimension of parameters, the condition number of KKT matrix may be abnormally high, causing numerical instability. In order to solve this problem, this embodiment introduces a multi-dimensional scale reduction strategy, which can automatically identify and handle the dimensional difference between parameters, reduce the condition number of KKT matrix by re-scaling each parameter, and improve the numerical stability in the solving process.

[0082] Specifically, at the beginning of the iteration process, the algorithm performs a dimensional analysis on all parameters, calculates the relative dimensional differences between the parameters. Then, according to these differences, a suitable scaling factor is assigned to each parameter, so that in the scaled quadratic programming problem, all parameters are at a relatively balanced scale. In the scaling process, special attention is paid to avoid affecting the mathematical nature of the original problem, ensuring that the scaled quadratic programming problem is equivalent to the original problem in solving. This strategy can significantly reduce the condition number of the KKT matrix, reduce numerical instability, while not affecting the solution space of the quadratic programming problem, ensuring the stability and accuracy of the algorithm when facing complex chemical process simulation.

[0083] In order to enable those skilled in the art to more clearly understand the technical solutions of the present application, the implementation process of the chemical process optimization method of the present application will be described in detail below in conjunction with specific embodiments.

[0084] The present embodiment relates to a specific chemical process optimization method. For nonlinear optimization problems in the field of chemical process simulation, the sequential quadratic programming (SQP) algorithm linearizes the constraints to generate a series of QP problems. The QP problem has the following form:

[0085] ;

[0086] wherein, is the current variable value, is the matrix second derivative, is the gradient term, is the constraint matrix.

[0087] And the QP problem has the following characteristics: the matrix is usually ill-conditioned and the gradient term has a large numerical value; the constraint matrix is usually a dense matrix. The present embodiment is based on the original active set method, which optimizes and improves the traditional active set algorithm, supports the solution of ill-conditioned QP problems, and the entire algorithm is divided into five parts.

[0088] 1. Reconstruct the feasible solution initialization method. The original active set method requires an initial feasible point, which is usually obtained through linear programming. In order to eliminate this computational overhead, a reconstruction method based on penalty function is proposed. In the initial QP problem, a slack variable and a penalty factor are introduced:

[0089] ;

[0090] In the above formula, is the slack variable, is the lower limit of the variable, upper bound of variable, In scaling the slack variables to the constraint range, penalty factor for violating constraints. The penalty factor in the reconstructed quadratic programming model The penalty factor needs to be chosen carefully to avoid numerical instability. Through rigorous mathematical analysis, it can be proved that the penalty QP problem has the exact penalty function property, which ensures that when the penalty factor exceeds a certain threshold, the penalty model is equivalent to the original constrained optimization problem.

[0091] 2. Mixed precision KKT matrix solution. Define the Lagrangian function for the reconstructed QP problem:

[0092] where, , , is the Lagrange multiplier.

[0093] According to the Lagrangian function, the standard form of the KKT matrix can be defined, and the problem is converted into solving the KKT system in the following form:

[0094] ;

[0095] where, is the perturbation, usually 1e-6.

[0096] In the process of solving the KKT system, the numerical stability of the entire process is guaranteed by Bunch-Kaufman decomposition, which decomposes the KKT matrix into, where is the ordering matrix, is the unit lower triangular matrix, is the diagonal matrix. This decomposition method can not only solve the stable solution through forward / backward substitution, but also maintain the inertia (the number of positive and negative eigenvalues of the matrix) unchanged.

[0097] When solving the right-hand side, the maximum value of the penalty factor may cause serious numerical cancellation. In order to ensure the accuracy of the solution, the following four strategies are used:

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

[0099] (2) Iterative refinement of mixed precision. When solving, the accuracy of the solution is improved through iterative refinement. In this process, 128-bit precision floating-point numbers are used to calculate the residual term and update the solution value, and 64-bit floating-point numbers are used for solving. The iterative refinement process is as follows:

[0100] ;

[0101] In the above formula, is the variable value of the kth iteration, K is the KKT matrix, b is the right-hand side, is the residual term of the kth iteration in solving. is the correction of the kth iteration.

[0102] When , the iteration refinement is stopped.

[0103] (3) Kahan compensation algorithm. Through the above four-precision floating-point operation, the algorithm can guarantee very high numerical accuracy, but at the same time it faces performance problems: using the quadmath library in GCC or Intel IFX, the performance is about 100 times slower than double-precision floating-point number. In fact, the arithmetic operations required are mainly addition, subtraction and multiplication. Therefore, a four-precision floating-point number can be represented by two double-precision numbers, and the three basic operations can be efficiently implemented. However, quadmath cannot be universally used in implementation, especially when calculating the line search step in the active set method. In this case, the Kahan compensation algorithm is used to calculate the sum to maintain efficiency.

[0104] (4) Optimized matrix decomposition. In the traditional active set method, the modification of the KKT matrix is only realized by the addition or removal of constraints. When the coefficient matrix is well scaled, the matrix D remains diagonal in most cases. Therefore, full decomposition is usually not required. Referring to the efficient decomposition modification algorithm, the existing decomposition is incrementally modified.

[0105] In practical applications, these methods can maintain the calculation cost of double-precision in most operations while achieving solutions close to four-precision.

[0106] 3. Stable selection strategy for blocked constraints. In the QP problem, the formula defines a more general method for selecting blocked constraints, where, is the right-hand side, is the constraint vector, is the current iteration value, is the search direction.

[0107] This general method is difficult to solve ill-conditioned QP problems. When dealing with blocked constraint selection in ill-conditioned QP problems, two special cases are often encountered. One is the linear dependence between constraints. If the constraint vector is linearly dependent on the constraints in the current active set, the value of is very small, making the KKT matrix ill-conditioned. Two, numerical cancellation When dealing with larger penalty factors, numerical cancellation can cause the step The calculation of is inaccurate, which may lead to an excessively large iteration step, causing the current feasible point to move too far, seriously violating the constraint conditions. In order to solve the above problem, an improved method is proposed to select the blocking constraint, adding a disturbance term to the selection formula , indicating that the bound violates the maximum value, and selects the constraint that minimizes the improved constraint selection formula However, in the step-size update formula, this perturbation is not included, and the step size The calculation formula is .like If it is less than 1, the constraint As blocking constraints. The reason for doing this is to prevent some constraints from being selected into the active set. Very small values ​​can cause numerical problems if introduced into activity concentration.

[0108] 4. Termination criteria for ill-posed problems. Usually the termination criteria consists of two parts: the original step size tolerance and the verification of the dual variable sign. According to the formula Define the original step size tolerance for the kth iteration. When the tolerance is less than the preset threshold The threshold can be provided by the user, and is typically 1e-6. The algorithm continues to check the signs of the dual variables associated with the active constraints. However, for ill-posed QP problems (Hessian matrices with huge condition numbers), the dual variable check cannot be performed reliably due to numerical instability. In such cases, a decreasing objective function criterion is introduced. ,in, is the absolute value of the objective function change, It is a preset threshold, usually 1e-6.

[0109] After removing a constraint corresponding to a negative dual variable from the currently active working set, if the improvement in the objective function is numerically unobservable, that is, This mechanism prevents the test algorithm from entering an infinite loop due to numerical oscillation.

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

[0111]

[0112] The termination condition test algorithm framework is as follows:

[0113]

[0114]

[0115] The present application embodiment also provides an optimization device for a chemical process. It should be noted that the optimization device for the chemical process of the present application embodiment can be used to execute the optimization method for chemical process provided by the present application embodiment. The device is used to implement the above-mentioned embodiments and preferred embodiments, and those that have been described will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0116] The following is an introduction to the chemical process optimization device provided in the examples of this application.

[0117] Figure 3 This is a structural block diagram of a chemical process optimization device according to an embodiment of the present application. Figure 3 As shown, the apparatus includes a reconstruction unit 10 , a solution unit 20 , a selection unit 30 and a repetition unit 40 . The reconstruction unit is used to execute the 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 is used to execute the solution step, which includes converting the target quadratic programming problem into a quadratic programming equation group that satisfies the KKT condition based on the Lagrangian function, and solving the quadratic programming equation group to obtain a solution result of the quadratic programming equation group; the selection unit is used to execute the selection step, which includes determining the blocking constraint based on the solution result of the quadratic programming equation group using an improved blocking constraint stable selection strategy, and using the blocking constraint to determine whether the solution meets the preset convergence condition; the repetition unit is used to execute the repetition step, which includes repeating the solution step and the selection step if the solution does not meet the preset convergence condition until the solution meets the preset convergence condition, obtaining a solution result of the quadratic programming problem in the chemical process simulation, and using the solution result in the corresponding actual chemical process.

[0118] Through the embodiment, the reconstruction step can effectively handle the ill-conditioned matrix problem caused by the dimensional difference of parameters. By using the Lagrange function and the KKT condition, a preset strategy including iterative refinement and Kahan compensation algorithm is adopted to improve the accuracy and stability of numerical calculation, while avoiding the common numerical reduction problem in traditional methods. The improved blocking constraint can accurately identify and handle the boundary conditions that are about to become active constraints, thereby reducing unnecessary constraint adjustment in the iteration process and speeding up the solution process. The setting of the preset convergence condition ensures the convergence of the algorithm and the reliability of the solution. Through these steps, efficient and accurate chemical process optimization results can be provided while maintaining fast response and real-time performance, thereby solving the problem of low solution efficiency of simulation optimization of chemical processes in the prior art.

[0119] In the specific implementation process, the solving unit includes a decomposition module and a solving module. The decomposition module is configured to decompose the quadratic programming equation set into a composite matrix using the Bunch-Kaufman decomposition algorithm, and the composite matrix includes a KKT matrix, a sorting matrix, a unit lower triangular matrix, and a diagonal matrix. The solving module is configured to solve the composite matrix using the iterative refinement to obtain a solution result of the quadratic programming equation set, wherein a quadruple-precision floating-point number is used to calculate the residual term and the updated solution value, and a double-precision floating-point number is used to calculate during solving, and the Kahan compensation algorithm is used for accuracy compensation during solving.

[0120] By combining the Bunch-Kaufman decomposition, iterative refinement, and Kahan compensation algorithm, the accuracy and efficiency of solving the quadratic programming equation set in chemical process simulation are significantly improved. First, the Bunch-Kaufman decomposition algorithm converts the complex quadratic programming equation set into a composite matrix containing a KKT matrix, a sorting matrix, a unit lower triangular matrix, and a diagonal matrix, thereby enhancing the stability of the solution and ensuring accurate solution even in the presence of ill-conditioned matrices. Second, the iterative refinement strategy calculates the residual term and the updated solution value using a quadruple-precision floating-point number in key steps, greatly reducing numerical errors, while using a double-precision floating-point number in most calculations to maintain high speed, achieving a balance between accuracy and performance. The Kahan compensation algorithm performs accuracy compensation during solving, effectively avoiding the accumulation of rounding errors in numerical calculation, further consolidating the reliability of the results. In short, through the comprehensive use of the above strategies, not only the common numerical stability challenges in chemical process simulation are overcome, but also double improvement in calculation efficiency and solution accuracy is achieved, providing strong technical support for real-time optimization of chemical processes.

[0121] Further, the decomposition module includes a decomposition submodule and a modification submodule. The decomposition submodule is configured to decompose the quadratic programming equation set by using the Bunch-Kaufman decomposition algorithm, store matrix elements in the decomposition process by using IEEE double-precision floating-point numbers, and obtain a preliminary decomposition result, where the matrix elements include elements of the KKT matrix and intermediate calculation results. The modification submodule is configured to modify the preliminary decomposition result incrementally by using a decomposition modification algorithm, and generate the composite matrix.

[0122] By this embodiment, high accuracy and stability of solving the quadratic programming equation set can be ensured while maintaining high calculation speed. In particular, in the chemical process simulation scenario, in the face of constraints with huge condition number and high nonlinearity, the combination of Bunch-Kaufman decomposition and incremental modification can overcome the limitations of traditional solving methods in numerical stability and solving efficiency, and provide a solid technical foundation for real-time optimization of chemical processes.

[0123] In some embodiments of the present application, the selection unit includes a processing module, a first calculation module, and a first determination module. The processing module is configured to add a disturbance term to the blocking constraint based on the solving result of the quadratic programming equation set to obtain the improved blocking constraint, where the disturbance term represents the maximum value of boundary violation. The first calculation module is configured to minimize the improved blocking constraint and calculate a step length based on at least the current iteration value and the search direction, where the step length is the length of movement along the search direction. The first determination module is configured to determine the constraint related to the slack variable as the blocking constraint when the step length is less than 1.

[0124] In summary, by using the improved blocking constraint stable selection strategy, the ill-conditioned matrix and numerical stability problems commonly encountered in solving quadratic programming problems in chemical process simulation are effectively solved. By introducing the disturbance term, minimizing the improved blocking constraint, and controlling the step length, the stable advancement of the iteration process is ensured, and the constraint selection is optimized, unnecessary numerical problems are avoided, thereby improving the efficiency and accuracy of the entire solving process. This strategy is particularly suitable for handling chemical process optimization scenarios with high nonlinearity and complex constraints, and can help quickly and accurately find the optimal solution, significantly improving the simulation and optimization capabilities of chemical processes.

[0125] In some embodiments of the present application, the selection unit comprises a second calculation module, a verification module, a removal module and a second determination module. The second calculation module is configured to solve the above blocking constraint and calculate the above original step tolerance based on the current iteration value; the verification module is configured to, if the above original step tolerance is less than a first preset threshold, use a target function decreasing criterion to verify the above dual variable sign, the target function decreasing criterion being based on a variation of the target function; the removal module is configured to, if the dual sign is a negative dual sign, remove the constraint of the negative dual sign from the current active set; and the second determination module is configured to, if the variation of the target function is less than a second preset threshold, determine that the solving reaches the preset convergence condition.

[0126] By solving iteratively using the blocking constraint, while monitoring the original step tolerance and the variation of the dual variable sign, it can be highly accurately determined whether the solution of the quadratic programming problem reaches the convergence state. When the original step tolerance is less than the first preset threshold, the target function decreasing criterion is started, and the feasibility of the solution and the correctness of the optimization direction are ensured through the check of the dual variable sign. If a negative dual sign is found, the active set is adjusted in real time to exclude the influence of unreasonable constraints, until the variation of the target function is less than the second preset threshold, indicating that the solving process tends to be stable and the optimization effect is significantly slowed down, at which time it can be determined that the solving has reached the preset convergence condition. This strategy effectively avoids the waste of resources caused by excessive iteration and numerical instability, ensures the calculation efficiency and the reliability of the solution of the algorithm when processing complex constraint optimization problems such as chemical process simulation, and provides a solid technical support for real-time monitoring and optimization.

[0127] In some embodiments of the present application, the solving unit comprises a setting module and a conversion module. The setting module is configured to set the above Lagrange function for the above target quadratic programming problem; and the conversion module is configured to set a KKT matrix in standard form according to the above Lagrange function, and convert the above target quadratic programming problem into the above quadratic programming equation group satisfying the above KKT condition based on the above KKT matrix.

[0128] Through this embodiment, the original quadratic programming problem is transformed into a set of equations that meet the KKT conditions. Solving this set of equations can not only obtain the optimal value of the decision variables, but also directly derive the Lagrange multiplier of the constraint conditions, which provides information on the activity of the constraints and provides a basis for updating the activity set and identifying the blocking constraints in subsequent iterations. In summary, the above transformation process is to implicitly integrate the complex constraints of the quadratic programming problem into the optimization process through the Lagrange function, and then transform it into a set of quadratic programming equations that meet 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 that appear in chemical process simulations, providing a powerful tool for efficient and accurate solutions. In actual engineering applications, this transformation method can significantly improve the applicability and solution quality of the quadratic programming algorithm.

[0129] In some embodiments of the present 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 chemical process simulation; the generation module is used to linearize the constraints of the nonlinear optimization problem using a sequential quadratic programming algorithm to generate the quadratic programming problem.

[0130] Through this embodiment, the originally complex nonlinear optimization problem is transformed into an easy-to-handle quadratic programming problem. In each iteration, the algorithm will solve such a QP subproblem, gradually approaching the global or local optimal solution of the nonlinear optimization problem. This feature 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 basis for subsequent quadratic programming solutions. In short, the above is based on the nonlinear optimization problem of chemical process simulation. By applying the SQP algorithm, the nonlinear constraints are linearized and transformed into a quadratic programming problem, creating conditions for its real-time and efficient solution. This transformation plays a vital role in chemical production optimization, equipment design and operation. It not only simplifies the implementation of the optimization algorithm, but also improves the accuracy and speed of the solution.

[0131] The chemical process optimization device includes a processor and memory. The reconstruction unit, solution unit, selection unit, and repetition unit are stored as program units in the memory. The processor executes the program units stored in the memory to implement the corresponding functions. The modules are all located in the same processor; alternatively, the modules can be located in different processors in any combination.

[0132] The memory may include non-permanent memory in a computer-readable medium, 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] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium comprises a stored program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the optimization method of the chemical process when the program runs.

[0134] The embodiment of the present application provides a processor, the processor is used for running a program, wherein the processor executes the optimization method of the chemical process when the program runs.

[0135] The embodiment of the present application provides an electronic device, the device comprises a processor, a memory and a program stored in the memory and capable of running on the processor, and the processor executes the steps of the optimization method of the chemical process when the program runs. The device herein can be a server, a PC, a PAD, a mobile phone and the like.

[0136] The present application also provides a computer program product, when executed on a data processing device, is suitable for executing the program of the steps of the optimization method of the chemical process.

[0137] Obviously, those skilled in the art should understand that the modules or steps of the present application can be realized by general computing devices, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, which can be realized by program codes of the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.

[0138] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of one or more computer usable storage media containing computer usable program codes (including but not limited to disk storage, CD-ROM, optical storage, etc.).

[0139] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0140] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0141] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

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

[0143] The memory can include non-persistent memory and / or volatile memory, such as a random access memory (RAM) including a cache area for the temporary storage of data. A

[0144] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules 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, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0145] The technical features of the above-described embodiments can be combined in any manner. For the sake of brevity, not all possible combinations of the technical features in the above-described embodiments are described, however, as long as the combinations of the technical features do not contradict each other, they should be considered to be within the scope of the present specification.

[0146] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0147] The above-described only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for optimizing a chemical process, characterized in that: include: a reconstruction step of obtaining a quadratic programming problem in a chemical process simulation and reconstructing the quadratic programming problem based on slack variables and penalty factors to obtain a target quadratic programming problem, wherein the result of the chemical process simulation is applied to a corresponding actual chemical process to optimize the actual chemical process; A solving step, converting the target quadratic programming problem into a quadratic programming equation system that satisfies the KKT condition based on a Lagrangian function, and solving the quadratic programming equation system using a preset strategy to obtain a solution result of the quadratic programming equation system, wherein the preset strategy at least includes iterative refinement and a Kahan compensation algorithm; A selection step, based on the solution of the quadratic programming equations, using an improved blocking constraint stability selection strategy to determine the blocking constraint, and using the blocking constraint to determine whether the solution meets a preset convergence condition, wherein the preset convergence condition is set based on the original step size tolerance and the dual variable sign verification; Repeating the step, if the solution does not reach the preset convergence condition, repeating the solving step and the selecting step until the solution reaches the preset convergence condition, obtaining a solution result of the quadratic programming problem in the chemical process simulation, and using the solution result of the quadratic programming problem in the chemical process simulation in the corresponding actual chemical process.

2. The method according to claim 1, characterized in that Solving the quadratic programming equations using a preset strategy to obtain a solution to the quadratic programming equations, wherein the preset strategy includes at least iterative refinement and a Kahan compensation algorithm, including: Decomposing the quadratic programming system into a composite matrix using a Bunch-Kaufman decomposition algorithm, wherein the composite matrix includes a KKT matrix, a sorting matrix, a unit lower triangular matrix, and a diagonal matrix; The composite matrix is ​​solved by the iterative refinement to obtain a solution to the quadratic programming equations, wherein quadruple precision floating point calculations are used when obtaining the residual term and the updated solution value, and double precision floating point calculations are used when solving the problem. In the solution process, the Kahan compensation algorithm is used to perform accuracy compensation.

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

4. The method according to claim 1, wherein The selection step, based on the solution of the quadratic programming equations, adopts an improved blocking constraint stability selection strategy to determine the blocking constraint, including: Based on the solution results of the quadratic programming equations, a disturbance term is added to the blocking constraint to obtain the improved blocking constraint, wherein the disturbance term represents the maximum value of the boundary violation; Minimize the improved blocking constraint and calculate a step length based on at least a current iteration value and a search direction, the step length being a length of movement along the search direction; When the step size is less than 1, the constraint related to the slack variable is determined as the blocking constraint.

5. The method according to claim 1, wherein The blocking constraint is used to determine whether the solution has reached a preset convergence condition, where the preset convergence condition is set based on the original step size tolerance and the dual variable sign verification setting, including: Solving using the blocking constraint and calculating the original step size tolerance based on the current iteration value; When the original step size tolerance is less than a first preset threshold, performing the dual variable sign verification using an objective function decreasing criterion, wherein the objective function decreasing criterion is set based on a change in the objective function; If the dual symbol is a negative dual symbol, then removing the constraint of the negative dual symbol from the current active set; When the change in the objective function is less than a second preset threshold, it is determined that the solution meets the preset convergence condition.

6. The method according to claim 1, characterized in that Based on the Lagrangian function, the target quadratic programming problem is transformed into a quadratic programming equation system that satisfies the KKT condition, including: Setting the Lagrangian function for the target quadratic programming problem; A standard form of KKT matrix is ​​set according to the Lagrangian function, and based on the KKT matrix, the target quadratic programming problem is converted into the quadratic programming equation group that satisfies the KKT condition.

7. The method according to claim 1, wherein the quadratic programming problem in chemical process simulation is obtained, include: Obtaining a nonlinear optimization problem in the chemical process simulation; A sequential quadratic programming algorithm is used to linearize the constraints of the nonlinear optimization problem to generate the quadratic programming problem.

8. A chemical process optimization device, characterized in that: include: a reconstruction unit, configured to execute a reconstruction step, wherein the reconstruction step includes obtaining a quadratic programming problem in a chemical process simulation and reconstructing the quadratic programming problem to obtain a target quadratic programming problem; A solving unit, configured to execute a solving step, wherein the solving step includes converting the target quadratic programming problem into a quadratic programming equation system that satisfies the KKT condition based on a Lagrangian function, and solving the quadratic programming equation system to obtain a solution result of the quadratic programming equation system; a selection unit configured to execute a selection step, the selection step comprising determining a blocking constraint based on a solution result of the quadratic programming equation system using an improved blocking constraint stabilization selection strategy, and determining whether the solution meets a preset convergence condition using the blocking constraint; A repetition unit is used to execute a repetition step, wherein the repetition step includes repeating the solution step and the selection step if the solution does not reach 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 using the solution result in the corresponding actual chemical process.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is run, the device where the computer-readable storage medium is located is controlled to execute the chemical process optimization method according to any one of claims 1 to 7.

10. 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 are configured to be executed by the one or more processors, and the one or more programs include an optimization method for executing the chemical process described in any one of claims 1 to 7.

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

  • Multi-target speed-adjustable MPC self-optimization method

    CN119512013A

  • Coordinated motion planning control method in five-axis machining process and related product

    CN120370832A

  • Quadratic programming task solving method and device based on neural network

    CN120611750A