Optimization problem solving method, system and device and medium
By integrating a solution library of multiple optimization algorithms, the inefficiency of traditional methods in large-scale, high-dimensional optimization problems has been solved, achieving fast and accurate optimization solutions. This enhances the system's independent innovation capabilities and stability, making it suitable for fields such as engineering optimization and financial modeling.
Patent Information
- Application Number
- CN202411160221.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing traditional numerical optimization methods are inefficient when dealing with large-scale, high-dimensional optimization problems. The complexity of algorithm selection and implementation poses a challenge, making it difficult to meet the needs of efficient and accurate solutions in fields such as scientific computing, engineering optimization, and data analysis.
An optimization problem solving library has been developed, which integrates various optimization algorithms such as Newton's method, trust region method, sequential quadratic programming method and interior point method. By identifying the problem type, analyzing the scale and dimension, determining the constraints and convergence speed requirements, the appropriate algorithm is selected for solving the problem, and a convenient interface is provided through the self-developed algorithm library.
It improves the efficiency and accuracy of solving optimization problems, can quickly converge to the optimal solution, reduces computation time, adapts to complex optimization problems, enhances the system's independent innovation capability and stability, and is applicable to fields such as engineering optimization and financial modeling.
Smart Images

Figure CN119047182A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence, operations research and optimization technology, and in particular to a method, system, device and medium for solving optimization problems. Background Art
[0002] Solving optimization problems is an important and common task in the fields of scientific computing, engineering optimization, data analysis, etc. Many practical problems can be formalized as optimization problems, such as minimizing costs, maximizing benefits, optimizing designs, etc. In order to effectively solve these problems, researchers have developed various optimization algorithms. However, different problems may require different algorithms, and choosing the right algorithm and the complexity of implementing the algorithm may become a challenge.
[0003] In the current computing environment, with the growth of problem complexity and data size, the demand for efficient and accurate optimization algorithms is becoming increasingly urgent. Traditional numerical optimization methods may face the problem of low efficiency when dealing with large-scale, high-dimensional problems. Therefore, for various types of optimization problems, researchers continue to explore and develop new optimization algorithms to improve the efficiency and accuracy of problem solving. At the same time, the selection and implementation of algorithms also face certain complexities. On the one hand, the performance and applicability of the algorithm are affected by many factors such as problem characteristics, data size, and computing resources; on the other hand, the implementation of the algorithm requires a deep understanding of its mathematical principles, programming skills, and performance optimization knowledge.
[0004] Therefore, developing an optimization problem-solving algorithm library and system that can integrate multiple optimization algorithms, provide a convenient user interface, and has high efficiency and stability is of great significance for promoting the development of scientific computing, engineering optimization, data analysis and other fields. Summary of the invention
[0005] In view of the defects of the prior art, the present invention provides a method, system, device and medium for solving an optimization problem.
[0006] In order to achieve the above invention object, the technical solution adopted by the present invention is as follows:
[0007] A method for solving an optimization problem comprises the following steps:
[0008] S1. Build an optimization problem solving library;
[0009] The optimization problem solving library includes: Newton's method, trust region method, sequential quadratic programming method and interior point method;
[0010] Solve nonlinear systems of equations by Newton's method, based on Newton's iteration method.
[0011] Solve unconstrained nonlinear optimization problems via trust region methods.
[0012] Sequential quadratic programming is used to solve nonlinear optimization problems with equality constraints.
[0013] Trust region interior point method for solving inequality nonlinear optimization problems.
[0014] S2, obtaining a nonlinear inequality constrained optimization mathematical model;
[0015] S3. Select a corresponding solution algorithm in the optimization problem solution library;
[0016] Identify the type of problem:
[0017] Solving nonlinear equations: Select Newton's method.
[0018] Unconstrained Nonlinear Optimization: Choose a Trust Region Method.
[0019] Nonlinear optimization with equality constraints: Selecting sequential quadratic programming methods.
[0020] Nonlinear optimization with inequality constraints: Selecting interior-point methods.
[0021] Analyze the scale and dimensions of the problem:
[0022] Small scale problems: Use Newton's method.
[0023] Large-scale, high-dimensional problems: Trust region methods or interior point methods are preferred, as they have better scalability and processing capabilities.
[0024] Identify the constraints:
[0025] Unconstrained problem: Choose a trust region method.
[0026] Equality constraint problem: Choose sequential quadratic programming.
[0027] Inequality Constrained Problems: Choose an Interior Point Method.
[0028] Consider the convexity of the problem:
[0029] Convex optimization problems: choosing between Newton's method and trust region method.
[0030] Non-convex optimization problems: Choose the interior point method and trust region method, which are more suitable for dealing with complex non-convex constraints.
[0031] Convergence speed and accuracy requirements:
[0032] High precision requirement: Choose Newton's method and trust region method.
[0033] Computational time sensitivity: The interior point method and sequential quadratic programming method can be used to find an approximate optimal solution in a smaller number of iterations.
[0034] Computing resources and performance:
[0035] Adequate resources: Choose the interior point method.
[0036] Limited resources: Choose a trust region approach.
[0037] S4. Execute the optimal solution algorithm.
[0038] Furthermore, the steps of the Newton method are as follows:
[0039] S1. Initialization: Choose an initial guess value x 0 .
[0040] S2, iterative update: For the i-th iteration, calculate the next approximate solution x i+1 , and its calculation formula is:
[0041]
[0042] Among them, f(x i ) is the nonlinear equation to be solved, f′(x i ) is f(x i ) is the derivative of .
[0043] S3. Convergence judgment
[0044] To determine whether the iteration has converged, a convergence criterion is set, including: the number of iterations and the difference between two adjacent iteration results is less than a certain threshold.
[0045] Furthermore, the specific problem definition of the trust region method is as follows:
[0046]
[0047] stc(x)=0.
[0048] Where x is a vector of decision variables, x∈R n , f(x) and c(x) are both R n is a continuous function on , where f(x) is the objective function and c(x) is the equality constraint.
[0049] In each iteration, the trust region method determines the step size p by solving the following trust region quadratic programming subproblem: k :
[0050]
[0051] stA(x k )p+c(x k )=r k ;
[0052] ||p||≤Δ k ,
[0053] In the formula, It represents the objective function gradient, is the Hessian matrix of the Lagrangian function, A(x k ) is in x k The Jacobian matrix of the constraint evaluated at k is the trust region radius, r k is adjusted to ensure constraint compatibility, p is the step vector, c(x k ) indicates that the constraint function c(x) is at the current point x k The value at .
[0054] Further, solving the problem of trust region method is divided into two steps:
[0055] The first step is to solve the subproblem to determine v k :
[0056]
[0057] For 0<η<1.
[0058] The solution to the above subproblem is denoted as v k , define r k for:
[0059] r k =A(x k )v k +c k .
[0060] The second step is to solve the sub-problems:
[0061]
[0062] stA(x k )p+c(x k )=r k ;
[0063] ||p||≤Δ k ,
[0064] Through the above two-step solution, the trust region method searches for the optimal solution within the trust region to optimize the objective function.
[0065] Furthermore, the problem definition of the interior point method is:
[0066]
[0067] stc(x)=0
[0068] g(x)≥0
[0069] Among them, f(x), g(x) and c(x) are defined in R n is a continuous function on , f(x) is the objective function, g(x) is the inequality constraint, and c(x) is the equality constraint.
[0070] By introducing the slack variable s, the inequality constraint g(x)≥0 can be converted into an equality constraint:
[0071] g i (x)-s=0
[0072] s≥0
[0073] The Lagrangian function is defined as:
[0074] L(x,s,λ,v)=f(x)-μ∑log(s i )+λ T ·(g(x)+s)+v T ·c(x)
[0075] Where μ>0 is the penalty parameter, λ is the Lagrange multiplier associated with the inequality constraint, v is the Lagrange multiplier associated with the equality constraint, and s i is a slack variable.
[0076] By adding the logarithmic barrier function term, the corresponding subproblem is obtained:
[0077]
[0078] stc(x)=0;
[0079] g(x)+s=0.
[0080] in, represents the penalty function, assuming Take positive infinity on the boundaries to ensure that the solution x lies in the feasible region.
[0081] Furthermore, the optimization problem solving library also includes: genetic algorithm, particle swarm optimization, simulated annealing and differential evolution;
[0082] The present invention also discloses a production optimization method for a liquid ammonia plant based on the above-mentioned optimization problem solving library, comprising the following steps:
[0083] S1. Model establishment, including:
[0084] In the modeling of the liquid ammonia plant, a comprehensive mathematical model was established, including:
[0085] Variables include: feed rate, temperature control parameters, and pressure regulation parameters.
[0086] Constraints include: temperature control, pressure regulation and material balance.
[0087] Temperature normalization:
[0088] Upper temperature normalized:
[0089] Middle layer temperature normalized:
[0090] The lower temperature is normalized:
[0091] Liquid ammonia flow function:
[0092] y1=4598.03×x1+4648.69×ya3+1125.03×x11-1810.25×x13+…+19029.12
[0093] Temperature control logic and constraint settings:
[0094] The lower limit of the hottest temperature in the upper layer: (y2 expression) × 4-xl3 1 -xl3 3 -xl3 4 =486
[0095] Upper temperature limit of the hottest point in the upper layer: (y2 expression) × 4-xl3 1 -xl3 3 -xl3 4 =496
[0096] Middle layer temperature lower and upper limits: 380 ≤ (y3 expression) ≤ 480
[0097] Lower temperature limit and upper temperature limit: 360≤(y4 expression)≤440
[0098] S2. Optimization problem solving library algorithm selection
[0099] Newton's method and trust region interior point method were used for optimization calculation:
[0100] S3. Optimization process
[0101] Input information preparation:
[0102] Objective function f(x): A multivariate scalar function that maps the decision space to the real domain.
[0103] Boundary constraints: x l ≤x≤x u .
[0104] Linear constraint: Ax≤b.
[0105] Nonlinear constraints: via the Hessian matrix express.
[0106] where v represents the number of nonlinear constraints, is the i-th nonlinear constraint function g i The Hessian matrix of (x) reflects the second-order derivative information under the constraints.
[0107] Optimization steps:
[0108] Initialization: Set initial parameter values and define the initial conditions of the optimization algorithm.
[0109] Gradient and Hessian matrix computation: Provide mathematical support for iteration.
[0110] Subproblem solving: Calculation to determine the step size.
[0111] Parameter update: Update the model parameters according to the solution results of the sub-problems.
[0112] Iteration: Perform cyclic iteration according to the convergence criterion.
[0113] S4. Display optimization results.
[0114] The present invention also discloses an optimization problem solving system, which can be used to implement the above-mentioned optimization problem solving method, specifically including:
[0115] Problem definition module, including:
[0116] Input interface: Receives optimization problems input by users, including objective functions, constraints, and variable ranges.
[0117] Problem description: Provide a clear definition of the optimization problem, including the mathematical expression of the objective function and a detailed description of the constraints.
[0118] Model building modules, including:
[0119] Mathematical model construction: Define the objective function and constraints based on user input and build a mathematical model.
[0120] Variable and parameter initialization: Initialize the variables and parameters in the optimization model, including initial guess values and boundary conditions.
[0121] Optimization algorithm modules, including:
[0122] Algorithm selection: Select an appropriate optimization algorithm from the optimization problem solving library based on the nature of the problem.
[0123] Algorithm implementation: Implement the selected optimization algorithm, including: gradient calculation, Hessian matrix calculation, step size determination and subproblem solving.
[0124] Solving process control modules, including:
[0125] Iteration management: Control the iterations in the optimization process, including the number of iterations and the convergence criteria.
[0126] Convergence detection: Determine whether the algorithm has converged, including detecting changes between adjacent iterations.
[0127] Interrupt and resume: Supports saving state when computing is interrupted and being able to resume computing.
[0128] Constraint processing module, including:
[0129] Boundary constraint processing: ensuring that decision variables are within preset boundaries.
[0130] Linear Constraint Handling: Handling systems of equations with linear constraints.
[0131] Nonlinear constraint processing: Process nonlinear constraints, calculate related Hessian matrices and logarithmic barrier functions, etc.
[0132] Result analysis and output module, including:
[0133] Optimization result analysis: Analyze the optimization results, including the optimal solution, objective function value, and satisfaction of constraints.
[0134] Visualization: Generate charts and graphs to help users understand the optimization results and the solution to the problem.
[0135] Report generation: Automatically generate detailed optimization result reports, including each stage of the optimization process, final results and related analysis.
[0136] User interface module, including:
[0137] Input interface: Provides a graphical user interface GUI or command line interface CLI for users to input optimization problems and view results.
[0138] Result display: Display the optimization results, including the optimal solution, objective function value, and satisfaction of constraints.
[0139] Data management module, including:
[0140] Data storage: Stores user input data, intermediate results of the optimization process, and final optimization results.
[0141] Data recovery: Recover data from storage and support interruption and recovery of the optimization process.
[0142] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned optimization problem solving method when executing the program.
[0143] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned optimization problem solving method is implemented.
[0144] Compared with the prior art, the advantages of the present invention are:
[0145] 1. The independently developed algorithm gets rid of the dependence on the existing algorithm library, enhancing the system's independent innovation capability and technological leadership. The system has higher performance and stability in solving optimization problems and can cope with more complex optimization problems.
[0146] 2. It can efficiently handle large-scale and high-dimensional optimization problems, accurately solve medium-scale optimization problems, and has the ability to solve large-scale optimization problems. This makes the system have a wider application prospect in the fields of engineering optimization, financial modeling, etc.
[0147] 3. The present invention can be widely used in engineering optimization, financial modeling and other fields. Users can select and adjust the optimization algorithm according to specific needs, and the versatility and market application prospects of the system are significantly enhanced.
[0148] 4. The present invention can stably handle various types of optimization problems, has strong robustness, and can effectively deal with data noise and uncertainty, making it more reliable in practical applications.
[0149] 5. The present invention can converge to the optimal solution more quickly, reduce the calculation time, improve the overall optimization efficiency, and enable users to complete complex optimization calculations in a shorter time. BRIEF DESCRIPTION OF THE DRAWINGS
[0150] Figure 1 It is a basic framework diagram of the solver of an embodiment of the present invention;
[0151] Figure 2 is a Newton nonlinear algorithm diagram of an embodiment of the present invention;
[0152] Figure 3 It is a trust region sequence quadratic programming algorithm diagram of an embodiment of the present invention;
[0153] Figure 4 It is a diagram of a trust region interior point algorithm according to an embodiment of the present invention;
[0154] Figure 5 It is a flow chart of the algorithm library of an embodiment of the present invention. DETAILED DESCRIPTION
[0155] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and examples.
[0156] like Figure 1 As shown, the present invention provides an optimization problem solving algorithm library. The algorithm library contains a variety of optimization problem solving algorithms, covering a series of algorithms for solving Newton's method for nonlinear equations, trust region method for solving unconstrained nonlinear optimization problems, trust region sequential quadratic programming method for solving equational nonlinear optimization problems, and trust region interior point method for solving inequality nonlinear optimization problems. These algorithms are highly efficient and stable in solving various large-scale optimization problems.
[0157] First of all, the optimization problem solving algorithm library and system of the present invention are designed to solve common optimization needs in practical problems. Many fields, such as scientific computing, engineering optimization, data analysis, etc., need to solve various types of optimization problems, such as minimizing costs, maximizing benefits, optimizing designs, etc. Traditional numerical optimization methods may be inefficient when dealing with large-scale, high-dimensional problems, so more efficient and accurate solution algorithms are needed to deal with complex optimization problems.
[0158] The optimization problem solving algorithm library and system of the present invention focus on the following technical solutions to achieve its purpose:
[0159] Self-developed algorithms: The present invention has developed a variety of optimization algorithms, which are optimized and adapted for different types of optimization problems. These algorithms have been studied and practiced, and have efficient and stable solving performance.
[0160] Algorithm construction and optimization: In the process of algorithm development, the present invention has conducted in-depth analysis on various practical problems, designed and optimized the corresponding solution algorithms. Through the establishment of reasonable mathematical models and algorithm design, these algorithms perform well in solving practical problems.
[0161] System integration and optimization: The system of the present invention integrates a variety of independently developed optimization algorithms, and through system optimization and adjustment, ensures that these algorithms work together in the entire system, giving full play to their advantages and characteristics, and providing users with efficient optimization problem-solving solutions.
[0162] The system of the present invention has the following characteristics and advantages:
[0163] Advantage 1: Multiple algorithms covered: The system includes multiple optimization algorithms such as Newton's method, trust region method, sequential quadratic programming method and interior point method, which can meet the needs of solving different types of optimization problems.
[0164] Advantage 2: Efficiency and stability: All algorithms have been designed and optimized, with efficient and stable solution performance, and can converge quickly and obtain accurate solution results.
[0165] Next, we will explain in detail the three optimization methods in the system:
[0166] like Figure 2 As shown, the Newton method nonlinear equation solving algorithm is specifically as follows:
[0167] Newton's method is a classic method for solving nonlinear equations. Its basic idea is to approximate the roots of nonlinear equations through iteration. The specific steps are as follows:
[0168] 1: Initialization: Choose an initial guess value x 0 .
[0169] 2: Iterative update: For the i-th iteration, calculate the next approximate solution x i+1 , and its calculation formula is:
[0170]
[0171] Among them, f(x i ) is the nonlinear equation to be solved, f′(x i ) is f(x i ) is the derivative of .
[0172] 3: Convergence judgment: To judge whether the iteration has converged, a convergence criterion can be set, such as the number of iterations, the difference between two adjacent iteration results is less than a certain threshold, etc.
[0173] like Figure 3 As shown, the trust region sequence quadratic programming method is applied to solve a specific equality constrained nonlinear optimization problem. The specific problem is defined as:
[0174]
[0175] stc(x)=0.
[0176] Where f(x) and c(x) are both R n where f(x) is the objective function and c(x) is the equality constraint. Ideally, the method updates the step size in each iteration by solving a trust region quadratic programming (QP) subproblem
[0177] p k , which has the following form:
[0178]
[0179] stA(x k )p+c(x k )=0;
[0180] ||p||≤Δ k ,
[0181] here, It represents the objective function gradient, is the Hessian matrix of the Lagrangian function, A(x k ) is in x k The Jacobian matrix of the constraint evaluated at k is the trust region radius.
[0182] In order to solve the compatibility problem of linear constraints, the QP subproblem is modified here to propose a more flexible solution:
[0183]
[0184] stA(x k )p+c(x k )=r k ;
[0185] ||p||≤Δ k ,
[0186] where r k are adjusted to ensure constraint compatibility. This problem is solved in two steps:
[0187] The first step is to solve the subproblem to determine v k :
[0188]
[0189] st||v||≤ηΔ k ,
[0190] For 0<η<1 (in this solution library, η=0.9).
[0191] The solution to the above subproblem is denoted as v k , define r k for:
[0192] r k =A(x k )v k +c k .
[0193] The second step is to solve the sub-problem:
[0194]
[0195] stA(x k )p+c(x k )=r k ;
[0196] ||p||≤Δ k ,
[0197] The trust region method optimizes the objective function by searching for the optimal solution within the trust region. The specific steps are as follows: Figure 3 Detailed instructions are given in .
[0198] like Figure 4 As shown in Figure 1, the trust region interior point method is used to solve the equational nonlinear optimization problem. The problem is defined as follows:
[0199]
[0200] stc(x)=0;
[0201] g(x)≥0.
[0202] f(x), g(x), and c(x) are all R n is a continuous function on , where f(x) is the objective function, g(x) is an inequality constraint, and c(x) is an equality constraint.
[0203] Inequality constraints can be converted to equality constraints by introducing a slack variable s:
[0204] g i (x)-s=0,s≥0.
[0205] The Lagrangian function is defined as:
[0206] L(x,s,λ,v)=f(x)-μ∑log(s i )+λ T ·(g(x)+s)+v T c(x).
[0207] By adding the logarithmic barrier function term, the corresponding subproblem can be obtained:
[0208]
[0209] stc(x)=0;
[0210] g(x)+s=0.
[0211] Among them, μ>0 represents the penalty parameter, λ and v are Lagrange multipliers, corresponding to inequality constraints and equality constraints. represents the penalty function, we assume Take positive infinity on the boundary to ensure that the solution x is in the feasible region. Under certain conditions, as μ approaches 0, x will tend to the solution of problem 1-(1), which means that we do not need to solve the penalty function exactly, but only need to find an approximate solution so that the error ε μ >0 can be satisfied, so the trust region sequence quadratic programming method can be used to solve the equality constraint subproblem After finding the solution, the penalty parameter μ and the tolerance are updated, and the solution to the original problem can be iteratively obtained.
[0212] The trust region interior point method converts the original problem into a series of quadratic programming sub-problems and uses the trust region method to solve these sub-problems to obtain an approximate solution to the original problem. The specific steps are as follows: Figure 4 Detailed instructions are given in .
[0213] Application of the optimization problem library described in the present invention in the field of engineering optimization
[0214] Liquid Ammonia Plant Modeling and Optimization
[0215] In the field of engineering optimization, modeling and optimization of liquid ammonia plants is a challenging task, which requires reducing production costs and resource consumption as much as possible while ensuring production efficiency and product quality. Using the optimization algorithm library of the present invention, the liquid ammonia plant is systematically modeled and optimized by combining the Newton method and the sequential quadratic programming method.
[0216] The specific implementation steps are as follows:
[0217] 1. Model establishment: A comprehensive mathematical model was developed based on the key process flow of liquid ammonia production. The model uses the normalization method to process the temperature of each layer of the synthesis tower, and integrates flow control, adjustment of main operating parameters, and dynamic control strategies for temperature and pressure. The model takes into account the multi-variable and multi-constraint characteristics of the process flow to ensure the robustness and adaptability of the model. The number of variables included in the model is 16, and the specific variables include but are not limited to feed rate, temperature control parameters, pressure regulation parameters, etc. The number of constraints included in the model is 20, covering key constraints in the production process such as temperature control, pressure regulation, and material balance. Some models are shown below:
[0218] Normalize the temperature of each layer of the synthesis tower:
[0219] Upper temperature normalized:
[0220] Middle layer temperature normalized:
[0221] The lower temperature is normalized:
[0222] Liquid ammonia flow function:
[0223] y1=4598.03×x1+4648.69×ya3+1125.03×x11-1810.25×x13+…+19029.12
[0224] Temperature function and control logic of each layer of the synthesis tower:
[0225] oUpper temperature function:
[0226] y2=1305.79×x15+86.83×x16+188.36×rx4-177.76×x5+…
[0227] oMid-layer temperature function
[0228] o Lower layer temperature function:
[0229] Temperature control logic and constraints:
[0230] o The lower limit of the hottest temperature in the upper layer: (y2 expression) × 4-xl3 1 -xl3 3 -xl3 4 =486
[0231] o Upper temperature limit of the hottest point in the upper layer: (y2 expression) × 4-xl3 1 -xl3 3 -xl3 4 =496
[0232] oMiddle layer temperature lower and upper limits: 380 ≤ (y3 expression) ≤ 480
[0233] oLower temperature lower limit and upper limit: 360≤(y4 expression)≤440
[0234] Other control logic and constraints include upper and lower limits of hydrogen-nitrogen ratio, upper and lower limits of purge gas, etc.
[0235] 2. Algorithm selection: The Newton method and the trust region interior point method of the present invention are selected for optimization calculation. These algorithms can quickly and accurately handle large-scale, high-dimensional optimization problems, ensuring that the optimal solution is found in a short time.
[0236] 3. In order to effectively use the algorithm library to solve complex optimization problems, users need to prepare a series of key input information, including objective function, boundary constraints, linear constraints and nonlinear constraints, and configure them according to the general problem framework. The objective function f(x) is the core of optimization and is designed as a multivariate scalar function that can map the multidimensional decision space to the real number domain. The specific form is, for example:
[0237] f(x 0 ,x 1 ,…,x n ,y 0 ,y 1 ,…,y m )
[0238] Here, x=(x 0 ,x 1 ,…,x n) represents the decision variable vector, whose dimension is determined by the specific requirements of the problem; and y m is the corresponding variable dimension.
[0239] Boundary constraints set explicit operating ranges for decision variables and are expressed in the following format:
[0240] x l ≤x≤x u
[0241] The input term x l With x u are vectors consisting of the lower and upper limits of each decision variable, ensuring that the solution is within the preset feasibility region.
[0242] Linear constraints are presented in the form of a system of linear equations, which can be formally expressed as:
[0243] Ax≤b
[0244] The input A is the coefficient matrix of the constraints, capturing the linear relationships between decision variables; the vector b represents the limits or target values of these relationships.
[0245] Nonlinear constraints introduce a further level of complexity and are usually defined in terms of functions. The formulation involves the Hessian matrix:
[0246]
[0247] where v represents the number of nonlinear constraints, is the i-th nonlinear constraint function g i The Hessian matrix of (x) reflects the second-order derivative information under the constraints.
[0248] The library provides a one-stop solution to optimization problems through its minimize method. Users only need to submit the objective function, boundary constraints, linear constraints, and nonlinear constraints as parameters in order, and the method will automatically start the solution process and explore the optimal solution to the problem. This methodological framework simplifies the processing of complex optimization problems and improves the overall efficiency and flexibility from model construction to solution implementation.
[0249] 4. Parameter optimization: such as Figure 5 As shown in the figure, through the optimization algorithm library, the various parameters in the model are systematically optimized and adjusted to improve the production efficiency and output of liquid ammonia. The parameter optimization process includes the following steps:
[0250] Initialization: Set initial parameter values and define initial conditions for the optimization algorithm.
[0251] Gradient and Hessian matrix calculation: Calculate the gradient vector and Hessian matrix of the objective function to provide necessary mathematical support for the iterative process.
[0252] Subproblem solving: computing subproblems to determine the step size.
[0253] Parameter update: Update the model parameters according to the solution results of the sub-problems.
[0254] Iteration: The solution is iterated repeatedly according to the convergence criteria until a stopping condition is met. This usually involves checking whether the change in the solution between two consecutive iterations is small enough, or whether a preset maximum number of iterations has been reached.
[0255] First, select the algorithm to be used by matching the optimization algorithm, then prepare the parameters required for iteration by matching the constraints with the objective function and calculating the corresponding gradient vector and Hessian matrix, and then calculate the subproblem The solution is obtained by step size and variables are updated, and it is iterated according to the convergence criterion until the result is obtained.
[0256] Optimization results:
[0257] - Reduction of optimization time: By using the optimization algorithm library of the present invention, the optimization calculation time of the liquid ammonia plant is reduced by 25% compared with the open source solution algorithm library. This means that the optimization process is more efficient, allowing users to complete complex parameter adjustments and calculations in a shorter time.
[0258] -Production improvement: The optimized liquid ammonia plant has increased its liquid ammonia production by 10.62% under the same resource and time conditions. This directly improves the production efficiency and economic benefits of the plant.
[0259] It can be seen from this embodiment that the optimization algorithm library of the present invention not only meets the optimization requirements of large-scale optimization problems in liquid ammonia plants, but also improves the optimization efficiency, and has application value and promotion prospects.
[0260] Although the present invention uses Newton's method, trust region method, trust region sequential quadratic programming method and trust region interior point method, other optimization algorithms can also be used to solve nonlinear equations and nonlinear optimization problems. These alternative algorithms include but are not limited to:
[0261] Genetic Algorithm (GA):
[0262] Implementation method: Search for the optimal solution by simulating natural selection and genetic variation.
[0263] Advantages: Suitable for complex multi-peak functions and has global search capabilities.
[0264] Particle Swarm Optimization (PSO):
[0265] Implementation method: Based on the theory of swarm intelligence, the optimal solution is found through cooperation among individuals in the group.
[0266] Advantages: Simple and easy to implement, suitable for continuous optimization problems.
[0267] Simulated Annealing (SA):
[0268] Implementation method: Avoid local optimal solutions by simulating the physical annealing process and gradually approach the global optimal solution.
[0269] Advantages: Applicable to discrete and continuous optimization problems, and has the ability to escape from local optimality.
[0270] Differential Evolution (DE):
[0271] Implementation method: Generate new solutions through differential operations and gradually optimize the objective function.
[0272] Advantages: Suitable for global optimization problems and has strong robustness.
[0273] In yet another embodiment of the present invention, a system for solving an optimization problem is provided. The system can be used to implement the above-mentioned method for solving the optimization problem, and specifically includes:
[0274] Problem definition module, including:
[0275] Input interface: receives optimization problems input by users, including objective functions, constraints, variable ranges, etc.
[0276] Problem description: Provide a clear definition of the optimization problem, including the mathematical expression of the objective function and a detailed description of the constraints.
[0277] Model building modules, including:
[0278] Mathematical model construction: Define the objective function and constraints based on user input and build a mathematical model.
[0279] Variable and parameter initialization: Initialize the variables and parameters in the optimization model, including initial guess values, boundary conditions, etc.
[0280] Optimization algorithm modules, including:
[0281] Algorithm selection: Choose an appropriate optimization algorithm (such as Newton's method, trust region method, interior point method, etc.) according to the nature of the problem.
[0282] Algorithm Implementation: Implement the selected optimization algorithm, including:
[0283] Gradient calculation: Calculate the gradient of the objective function and constraints.
[0284] Hessian Matrix Calculation: Calculate the Hessian matrix of the objective function and constraints.
[0285] Step size determination: Calculate the step size to update the variables.
[0286] Subproblem solving: Optimize the objective function by solving subproblems.
[0287] Solving process control modules, including:
[0288] Iteration management: control the iterations in the optimization process, including the number of iterations, convergence criteria, etc.
[0289] Convergence detection: Determine whether the algorithm has converged, including detecting changes between adjacent iterations.
[0290] Interrupt and resume: Supports saving state when computing is interrupted and being able to resume computing.
[0291] Constraint processing module, including:
[0292] Boundary constraint processing: ensuring that decision variables are within preset boundaries.
[0293] Linear Constraint Handling: Handling systems of equations with linear constraints.
[0294] Nonlinear constraint processing: Process nonlinear constraints, calculate related Hessian matrices and logarithmic barrier functions, etc.
[0295] Result analysis and output module, including:
[0296] Optimization result analysis: Analyze the optimization results, including the optimal solution, objective function value, and satisfaction of constraints.
[0297] Visualization: Generate charts and graphs to help users understand the optimization results and the solution to the problem.
[0298] Report generation: Automatically generate detailed optimization result reports, including each stage of the optimization process, final results and related analysis.
[0299] User interface module, including:
[0300] Input interface: Provides a graphical user interface (GUI) or command line interface (CLI) for users to input optimization problems and view results.
[0301] Result display: Display the optimization results, including the optimal solution, objective function value, and satisfaction of constraints.
[0302] Data management module, including:
[0303] Data storage: Stores user input data, intermediate results of the optimization process, and final optimization results.
[0304] Data recovery: Recover data from storage and support interruption and recovery of the optimization process.
[0305] Performance optimization modules, including:
[0306] Computational optimization: optimize the performance of the algorithm, improve computing efficiency, and reduce optimization time.
[0307] Resource management: Manage computing resources, such as memory and processors, to improve the overall performance of the system.
[0308] Verification and testing modules, including:
[0309] Model validation: Verify the accuracy and rationality of the model.
[0310] Algorithm testing: Test the optimization algorithm to ensure its correctness and stability.
[0311] Result verification: Verify the effectiveness of the optimization results to ensure that they meet actual needs.
[0312] Extension and integration modules, including:
[0313] Interface extension: Provide interfaces with other systems or tools for system integration.
[0314] Functional extension: Supports plug-in or module expansion to increase the functionality of the system.
[0315] In another embodiment of the present invention, a terminal device is provided, the terminal device includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used to optimize the operation of the problem-solving method.
[0316] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage.
[0317] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the optimization problem solving method in the above embodiment; one or more instructions in the computer-readable storage medium are loaded and executed by a processor.
[0318] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0319] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0320] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0321] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0322] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the implementation methods of the present invention, and should be understood that the protection scope of the present invention is not limited to such special statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A method for solving an optimization problem, characterized in that: The following steps are involved: S1. Build an optimization problem solving library; The optimization problem solving library includes: Newton's method, trust region method, sequential quadratic programming method and interior point method; Solve nonlinear equations by Newton's method, based on Newton's iteration method; Solve unconstrained nonlinear optimization problems via trust region methods; Sequential quadratic programming method is used to solve nonlinear optimization problems with equality constraints; Trust region interior point method for solving inequality nonlinear optimization problems; S2, obtaining a nonlinear inequality constrained optimization mathematical model; S3. Select a corresponding solution algorithm in the optimization problem solution library; S4. Execute the optimal solution algorithm.
2. The optimization problem solving method according to claim 1, characterized in that: The steps of the Newton method are as follows: S1, initialization: select an initial guess value x0; S2, iterative update: For the i-th iteration, calculate the next approximate solution x i+1 , and its calculation formula is: Among them, f(x i ) is the nonlinear equation to be solved, f′(x i ) is f(x i )’s derivative; S3. Convergence judgment To determine whether the iteration has converged, a convergence criterion is set, including: the number of iterations and the difference between two adjacent iteration results is less than a certain threshold.
3. The optimization problem solving method according to claim 1, characterized in that: The specific problem definition of the trust region method is as follows: stc(x)=0. Where f(x) and c(x) are both R n A continuous function on , where f(x) is the objective function and c(x) is the equality constraint; In each iteration, the trust region method determines the step size pk by solving the following trust region quadratic programming subproblem: s.t.A(x k )p+c(x k )=r k ; ||p||≤Δ k , In the formula, It represents the objective function gradient, is the Hessian matrix of the Lagrangian function, A(x k ) is in x k The Jacobian matrix of the constraint evaluated at k is the trust region radius, r k are adjusted to ensure constraint compatibility.
4. The optimization problem solving method according to claim 3, characterized in that: Solving the trust region method problem consists of two steps: The first step is to solve the subproblem to determine v k : For 0<η<1; The solution to the above subproblem is denoted as v k , define r k for: r k =A(x k )v k +c k . The second step is to solve the sub-problems: s.t.A(x k )p+c(x k )=r k ; ||p||≤Δ k , Through the above two-step solution, the trust region method searches for the optimal solution within the trust region to optimize the objective function.
5. The optimization problem solving method according to claim 1, characterized in that: The problem of interior point method is: stc(x)=0 g(x)≥0 Among them, f(x), g(x) and c(x) are defined in R n A continuous function on , f(x) is the objective function, g(x) is the inequality constraint, and c(x) is the equality constraint; By introducing the slack variable s, the inequality constraint g(x)≥0 can be converted into an equality constraint: g i (x)-s=0 s≥0 The Lagrangian function is defined as: L(x,s,λ,v)=f(x)-μ∑log(s i )+λ T ·(g(x)+s)+v T ·c(x) Where μ>0 is the penalty parameter, λ is the Lagrange multiplier associated with the inequality constraint, and v is the Lagrange multiplier associated with the equality constraint; By adding the logarithmic barrier function term, the corresponding subproblem is obtained: stc(x)=0; g(x)+s=0. in, represents the penalty function, assuming Take positive infinity on the boundaries to ensure that the solution x lies in the feasible region.
6. The optimization problem solving method according to claim 1, characterized in that: The optimization problem solving library also includes: genetic algorithm, particle swarm optimization, simulated annealing and differential evolution.
7. A method for optimizing the production of a liquid ammonia plant based on the optimization problem solving library according to any one of claims 1 to 5, characterized in that: The following steps are involved: S1. Model establishment, including: In the modeling of the liquid ammonia plant, a comprehensive mathematical model was established, including: Variables, including: feed rate, temperature control parameters, pressure regulation parameters; Constraints, including: temperature control, pressure regulation and material balance; Temperature normalization: Upper temperature normalized: Middle layer temperature normalized: The lower temperature is normalized: Liquid ammonia flow function: y1=4598.03×x1+4648.69×ya3+1125.03×x11-1810.25×x13+…+19029.12 Temperature control logic and constraint settings: The lower limit of the hottest temperature of the upper layer: (y2 expression) × 4-xl31-xl33-xl34 = 486 Upper hottest point temperature limit: (y2 expression) × 4-xl31-xl33-xl34 = 496 Middle layer temperature lower and upper limits: 380 ≤ (y3 expression) ≤ 480 Lower temperature limit and upper temperature limit: 360≤(y4 expression)≤440 S2. Optimization problem solving library algorithm selection Newton's method and trust region interior point method were used for optimization calculation: S3. Optimization process Input information preparation: Objective function f(x): a multivariate scalar function mapping the decision space to the real domain; Boundary constraints: x l ≤x≤x u ; Linear constraints: Ax≤b; Nonlinear constraints: via the Hessian matrix express; where v represents the number of nonlinear constraints, It is the Hessian matrix of the i-th nonlinear constraint function gi(x), which reflects the second-order derivative information under the constraint conditions; Optimization steps: Initialization: Set initial parameter values and define the initial conditions of the optimization algorithm; Gradient and Hessian matrix calculation: provide mathematical support for iteration; Subproblem solving: Calculation The solution to determine the step size; Parameter update: Update model parameters according to the solution results of sub-problems; Iteration: perform cyclic iteration according to the convergence criterion; S4. Display optimization results.
8. An optimization problem solving system, characterized in that: The system can be used to implement the optimization problem solving method described in any one of claims 1 to 6, specifically including: Problem definition module, including: Input interface: receives optimization problems input by users, including objective functions, constraints, and variable ranges; Problem description: Provide a clear definition of the optimization problem, including the mathematical expression of the objective function and a detailed description of the constraints; Model building modules, including: Mathematical model construction: Define the objective function and constraints based on user input and build a mathematical model; Variable and parameter initialization: Initialize the variables and parameters in the optimization model, including initial guess values and boundary conditions; Optimization algorithm modules, including: Algorithm selection: Select an appropriate optimization algorithm from the optimization problem solving library based on the nature of the problem; Algorithm implementation: Implement the selected optimization algorithm, including gradient calculation, Hessian matrix calculation, step size determination and subproblem solving; Solving process control modules, including: Iteration management: control the iterations in the optimization process, including the number of iterations and convergence criteria; Convergence detection: Determine whether the algorithm has converged, including detecting changes between adjacent iterations; Interruption and recovery: Supports saving the state when the calculation is interrupted and can resume the calculation; Constraint processing module, including: Boundary constraint processing: ensuring that decision variables are within the preset boundary range; Linear constraint processing: processing systems of equations with linear constraints; Nonlinear constraint processing: Process nonlinear constraints, calculate related Hessian matrices and logarithmic barrier functions, etc. Result analysis and output module, including: Optimization result analysis: Analyze the optimization results, including the optimal solution, objective function value, and satisfaction of constraint conditions; Visualization: Generate charts and graphs to help users understand optimization results and solutions to problems; Report generation: Automatically generate detailed optimization result reports, including each stage of the optimization process, final results and related analysis; User interface module, including: Input interface: Provides a graphical user interface GUI or command line interface CLI for users to input optimization problems and view results; Result display: Display the optimization results, including the optimal solution, objective function value, and satisfaction of constraint conditions; Data management module, including: Data storage: storing user input data, intermediate results of the optimization process, and final optimization results; Data recovery: Recover data from storage and support interruption and recovery of the optimization process.
9. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for solving the optimization problem described in one of claims 1 to 6 is implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method for solving the optimization problem described in one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Transient stability prevention control optimization algorithm based on adjoint sensitivity
CN109698511A
Case-based reasoning algorithm-based online control optimization method for hydrogen production and ammonia synthesis by electrolysis of water
CN116736802A
Cited By
Automatic proportioning control system for mine interlaced filling materials
CN119556569A
Gas-electricity joint optimization scheduling method and device for long-time-domain continuous time
CN119783900A
