Conjugate gradient correction method for identifying nonlinear boundary condition based on unit differential method
By introducing unit differential method and generalized variables into the conjugate gradient method, the DQEM equation is constructed, and the error and convergence problems of the conjugate gradient method are solved when dealing with nonlinear boundary conditions are achieved, and more efficient optimization solutions are achieved, suitable for complex non- Linear problem.
Patent Information
- Application Number
- CN202410970864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-15
AI Technical Summary
The existing conjugation gradient method is difficult to effectively deal with complex nonlinear boundary conditions, and the fastest descent method converges slowly, making it easy to fall into local optimal solutions. Large unconstrained optimization problems involve high-dimensional matrix and vector operations, calculation amount and Large storage space.
The modified conjugate gradient method based on the unit differential method is adopted to construct DQEM equations by introducing generalized variables, which accurately meets the nonlinear boundary conditions, and iteratively updates the solution vector and direction vector to improve convergence speed and stability.
It effectively avoids the error and approximation problems of traditional methods when dealing with nonlinear boundary conditions, improves the convergence speed, maintains the stability and reliability of the algorithm, reduces storage requirements, and improves the computing efficiency.
Smart Images

Figure CN118964908A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of conjugate gradient method, in particular to a modified conjugate gradient method for identifying nonlinear boundary conditions based on a unit differential method. Background Art
[0002] The conjugate gradient method is an optimization algorithm that is mainly used to solve large linear equations and nonlinear optimization problems. The conjugate gradient method is widely used in fields that require optimization solutions, including but not limited to machine learning, data mining, image processing, control engineering, etc. Their application in these fields involves various optimization problems, such as minimizing the loss function, maximizing the classification accuracy, etc.
[0003] The existing conjugate gradient method has the following defects: First, in many practical applications, problems are often constrained by complex nonlinear boundary conditions, and traditional methods are difficult to deal with these conditions effectively; second, the traditional steepest descent method converges slowly and is prone to fall into local optimal solutions for complex nonlinear problems; third, large-scale unconstrained optimization problems often involve high-dimensional matrix and vector operations, which require efficient algorithms to reduce computational complexity and storage space. Summary of the invention
[0004] The object of the present invention is to provide a modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differential method, comprising step one, initializing parameters; step two, calculating step length; step three, updating solution vector and residual; step four, judging termination condition; step five, introducing differential variables; step six, updating direction vector; step seven, repeating iteration; step eight, outputting result;
[0006] In the above step 1, the initial solution vector and the search direction are set;
[0007] In the above step 2, the step length of moving along the search direction is determined;
[0008] In the above step 3, the solution vector is updated using the step size and the new residual is calculated;
[0009] In the above step 4, whether to terminate the iteration is determined according to the residual size or the number of iterations;
[0010] In the above step 5, generalized variables are introduced to construct the DQEM equation, and the solution vector is solved and updated to meet the nonlinear boundary conditions;
[0011] In the above step 6, the β value is calculated according to the new residual, and the search direction is updated;
[0012] In the above step 7, the new search direction and step size are used to continue iterating until the termination condition is met;
[0013] In the above step eight, a final solution vector satisfying the nonlinear boundary conditions is output.
[0014] As a further technical solution of the present invention, in step 1, at the beginning of the solution, an initial solution vector x is selected. 0 , and set the initial search direction d 0 , usually this direction is set to the direction of the initial residual, i.e. d 0 =r 0 , where r 0 is the initial solution vector x 0 The corresponding residual is calculated as r 0 =bA*x 0 , where A is the coefficient matrix and b is the constant vector.
[0015] As a further technical solution of the present invention, in step 2, during the iteration process, it is necessary to determine the length of each step moving along the search direction, that is, the step length α k , step length by exact line search or backtracking line search.
[0016] As a further technical solution of the present invention, in step 2, the specific calculation method is:
[0017] α k =(r k ^T*r k ) / (d k ^T*A*d k )
[0018] where r k is the residual at step k, d k is the search direction of the kth step.
[0019] As a further technical solution of the present invention, in step 3, the step length α is obtained. k Then update the solution vector x k , the calculation formula is x k +1 = x k +α k *d k , and update the residual r k+1 , which represents the new solution vector x k+1 The gap between the actual solution and the actual solution is calculated as r k+1 =r k -α k *A*d k .
[0020] As a further technical solution of the present invention, in step 4, after each iteration, it is necessary to determine whether the termination condition is met. The termination condition may be that the norm of the residual is less than a preset threshold, or the number of iterations reaches a preset maximum value. If the termination condition is met, the iteration is stopped and the current solution vector x is output. k+1 As the final solution, if the termination condition is not met, the next iteration is continued.
[0021] As a further technical solution of the present invention, in step five, if the problem contains nonlinear boundary conditions, it is necessary to introduce the unit differential method DQEM in the iterative process to accurately meet these conditions. Specifically, some generalized variables, such as rotation angle, temperature gradient, etc., are introduced. These variables together with the original variables constitute a new solution vector, and then DQEM equations are constructed based on these variables. These equations can accurately describe physical phenomena and meet nonlinear boundary conditions. Then, appropriate numerical methods are used to solve the DQEM equations to obtain a new solution vector. This new solution vector not only satisfies the original equation, but also strictly meets the nonlinear boundary conditions.
[0022] As a further technical solution of the present invention, in step 6, in each iteration, the search direction d needs to be updated. k , using the updated solution vector and residual, through the formula β k =(r k ^T*r k ) / (r k-1 ^T*r k-1 ) Calculate the β value and update the direction vector d k =r k +β k *d k-1 .
[0023] As a further technical solution of the present invention, in step 7, steps 2 to 6 are repeated, and a new search direction d is used. k and step length α k Continue iterating, repeating the above steps of calculating the step length, updating the solution vector and residual, determining the termination condition, and updating the direction vector in each iteration until a solution that meets the conditions is found.
[0024] As a further technical solution of the present invention, in step eight, when the termination condition is met, the iteration is stopped and the final solution vector x is output. k+1 , this solution vector not only satisfies the original equation, but also strictly satisfies the nonlinear boundary conditions.
[0025] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention combines the unit differential method, introduces new generalized variables, combines nodes to form new variables, and utilizes interior point equations and boundary conditions, so as to accurately meet nonlinear boundary conditions, effectively avoiding errors and approximations that may occur in traditional methods when dealing with nonlinear boundary conditions. At the same time, the modified conjugate gradient method avoids the sawtooth phenomenon of the steepest descent method, converges quickly, maintains the stability and reliability of the algorithm, and gradually approaches the optimal solution in an iterative manner. At the same time, only the result of the previous iteration needs to be stored. For large-scale problems, the storage required is small and the calculation efficiency is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of the method of the present invention;
[0027] Figure 2 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0029] See also Figure 1-2 , an embodiment provided by the present invention: a modified conjugate gradient method for identifying nonlinear boundary conditions based on a unit differential method, comprising step 1, initializing parameters; step 2, calculating a step length; step 3, updating a solution vector and a residual; step 4, determining a termination condition; step 5, introducing a differential variable; step 6, updating a direction vector; step 7, repeating iterations; step 8, outputting a result;
[0030] In the above step 1, the initial solution vector and search direction are set. At the beginning of the solution, an initial solution vector x is selected. 0 , and set the initial search direction d 0 , usually this direction is set to the direction of the initial residual, i.e. d 0 =r 0 , where r 0 is the initial solution vector x 0 The corresponding residual is calculated as r 0 =bA*x 0 , where A is the coefficient matrix and b is the constant vector;
[0031] In the above step 2, the step length of moving along the search direction is determined. During the iteration process, the length of each step moving along the search direction needs to be determined, that is, the step length αk , the step length is calculated by precise line search or backtracking line search. The specific calculation method is:
[0032] α k =(r k ^T*r k ) / (d k ^T*A*d k )
[0033] where r k is the residual at step k, d k is the search direction of the kth step;
[0034] In step 3 above, the step length is used to update the solution vector and calculate the new residual to obtain the step length α k Then update the solution vector x k , the calculation formula is x k +1 = x k +α k *d k , and update the residual r k+1 , which represents the new solution vector x k+1 The gap between the actual solution and the actual solution is calculated as r k+1 =r k -α k *A*d k ;
[0035] In the above step 4, whether to terminate the iteration is determined according to the size of the residual or the number of iterations. After each iteration, it is necessary to determine whether the termination condition is met. The termination condition can be that the norm of the residual is less than a preset threshold, or the number of iterations reaches a preset maximum value. If the termination condition is met, the iteration is stopped and the current solution vector x is output. k+1 As the final solution, if the termination condition is not met, the next iteration is continued;
[0036] In the above step 5, if the problem contains nonlinear boundary conditions, it is necessary to introduce the unit differential method DQEM in the iteration process to accurately meet these conditions. Specifically, some generalized variables, such as rotation angle, temperature gradient, etc., are introduced. These variables together with the original variables constitute a new solution vector, and then DQEM equations are constructed based on these variables. These equations can accurately describe physical phenomena and meet nonlinear boundary conditions. Then, appropriate numerical methods are used to solve the DQEM equations to obtain new solution vectors. This new solution vector not only satisfies the original equations, but also strictly satisfies the nonlinear boundary conditions.
[0037] In the above step 6, in each iteration, the search direction d needs to be updated. k , using the updated solution vector and residual, through the formula βk =(r k ^T*r k ) / (r k-1 ^T*r k-1 ) Calculate the β value and update the direction vector d k =r k +β k *d k-1 ;
[0038] In the above step 7, repeat steps 2 to 6, using the new search direction d k and step length α k Continue iterating, repeating the above steps of calculating the step length, updating the solution vector and residual, judging the termination condition, and updating the direction vector in each iteration until a solution that meets the conditions is found;
[0039] In the above step eight, when the termination condition is met, the iteration stops and the final solution vector x is output. k+1 , this solution vector not only satisfies the original equation, but also strictly satisfies the nonlinear boundary conditions.
[0040] Based on the above, the advantages of the present invention are: the present invention proposes an innovative nonlinear boundary condition processing method, which cleverly combines the unit differential method DQEM and the modified conjugate gradient method, and effectively solves the errors and approximation problems that are easy to occur in traditional methods when processing nonlinear boundary conditions. In traditional numerical calculations, the accurate processing of nonlinear boundary conditions has always been a difficulty, because they usually involve complex physical phenomena and constraints, which makes it difficult to ensure the accuracy and reliability of the calculation results. The present invention introduces a series of new generalized variables, which are combined with the original node variables to form a new solution space. By solving in this solution space, we can more accurately describe physical phenomena and strictly satisfy The introduction of nonlinear boundary conditions not only improves the calculation accuracy, but also greatly expands the scope of application of the algorithm, enabling it to handle more complex and practical nonlinear problems. In terms of algorithm design, the present invention adopts the modified conjugate gradient method as the main optimization tool. Compared with the traditional steepest descent method, the modified conjugate gradient method has better convergence performance and stability. It uses the information of the previous iteration to guide the direction and step size of the current iteration, thereby avoiding the occurrence of sawtooth phenomenon and greatly improving the convergence speed. At the same time, since the algorithm gradually approaches the optimal solution in an iterative manner, it only needs to store the result of the previous iteration. For large-scale problems, this can significantly reduce storage requirements and improve computing efficiency.
[0041] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differential method, including step 1, initializing parameters; step 2, calculating step length; step 3, updating solution vector and residual; step 4, judging termination conditions; step 5, introducing differential variables; step 6, updating direction vector; step 7, repeating iterations; step 8, outputting results; Features: In the above step 1, the initial solution vector and the search direction are set; In the above step 2, the step length of moving along the search direction is determined; In the above step 3, the solution vector is updated using the step size and the new residual is calculated; In the above step 4, whether to terminate the iteration is determined according to the residual size or the number of iterations; In the above step 5, generalized variables are introduced to construct the DQEM equation, and the solution vector is solved and updated to meet the nonlinear boundary conditions; In the above step 6, the β value is calculated according to the new residual, and the search direction is updated; In the above step 7, the new search direction and step size are used to continue iterating until the termination condition is met; In the above step eight, a final solution vector satisfying the nonlinear boundary conditions is output.
2. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 1, at the beginning of the solution, an initial solution vector x is selected. 0 , and set the initial search direction d 0 , usually this direction is set to the direction of the initial residual, i.e. d 0 =r 0 , where r 0 is the initial solution vector x 0 The corresponding residual is calculated as r 0 =bA*x 0 , where A is the coefficient matrix and b is the constant vector.
3. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 2, during the iteration process, it is necessary to determine the length of each step moving along the search direction, that is, the step length α k , step length by exact line search or backtracking line search.
4. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 3, Features: In the step 2, the specific calculation method is: α k =(r k ^T*r k ) / (d k ^T*A*d k ) where r k is the residual at step k, d k is the search direction of the kth step.
5. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 3, the step length α is obtained. k Then update the solution vector x k , the calculation formula is x k +1 = x k +α k *d k , and update the residual r k+1 , which represents the new solution vector x k+1 The gap between the actual solution and the actual solution is calculated as r k+1 =r k -α k *A*d k .
6. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 4, after each iteration, it is necessary to determine whether the termination condition is met. The termination condition may be that the norm of the residual is less than a preset threshold, or the number of iterations reaches a preset maximum value. If the termination condition is met, the iteration is stopped and the current solution vector x is output. k+1 As the final solution, if the termination condition is not met, the next iteration is continued.
7. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step five, if the problem contains nonlinear boundary conditions, it is necessary to introduce the unit differential method DQEM in the iteration process to accurately meet these conditions. Specifically, some generalized variables, such as rotation angle, temperature gradient, etc., are introduced. These variables together with the original variables constitute a new solution vector, and then DQEM equations are constructed based on these variables. These equations can accurately describe physical phenomena and meet nonlinear boundary conditions. Then, appropriate numerical methods are used to solve the DQEM equations to obtain a new solution vector. This new solution vector not only satisfies the original equation, but also strictly meets the nonlinear boundary conditions.
8. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 6, in each iteration, the search direction d needs to be updated. k , using the updated solution vector and residual, through the formula β k =(r k ^T*r k ) / (r k-1 ^T*r k-1 ) Calculate the β value and update the direction vector d k =r k +β k *d k-1 .
9. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step 7, repeat steps 2 to 6, using a new search direction d k and step length α k Continue iterating, repeating the above steps of calculating the step length, updating the solution vector and residual, determining the termination condition, and updating the direction vector in each iteration until a solution that meets the conditions is found.
10. The modified conjugate gradient method for identifying nonlinear boundary conditions based on unit differentiation method according to claim 1, Features: In step eight, when the termination condition is met, the iteration is stopped and the final solution vector x is output. k+1 , this solution vector not only satisfies the original equation, but also strictly satisfies the nonlinear boundary conditions.
