Welding heat source model parameter optimization method based on hybrid agent model
By constructing a hybrid agent model in the parameter optimization of welding heat source model and combining Newton-Thomson intelligent optimization algorithm, the problems of high computing costs and limitations in the existing technology are solved, and efficient optimization of welding heat source model parameters and high consistency of optimization results are achieved.
Patent Information
- Application Number
- CN202510166333.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-13
AI Technical Summary
There are problems with high computational cost and time consumption in the optimization of the parameters of the existing welding heat source model, and the limitations of traditional weighted combination strategies limit the generalization ability and prediction accuracy of the hybrid agent model.
The welding heat source model parameter optimization method based on the hybrid agent model is adopted, and the hybrid agent model is constructed through stacking and feature fusion, and combined it with the Newton-Thomson intelligent optimization algorithm. The agent model is used to quickly and accurately predict the welding pool shape, guiding parameter updates and decision iterations.
It significantly reduces the dependence on high-cost simulation models, reduces the consumption of computing resources and optimization time, ensures the high consistency between the optimization results and the actual melt pool shape, and realizes efficient optimization of welding heat source model parameters.
Smart Images

Figure CN119989819A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of Internet big data and new generation information technology, and in particular to a welding heat source model parameter optimization method based on a hybrid agent model. Background Art
[0002] With the optimization of energy supply structure, the construction of a clean, low-carbon, safe and efficient modern energy system is being further promoted. As the core of energy equipment, pressure vessels play an irreplaceable role in the fields of petroleum, chemical industry, hydrogen energy and nuclear energy. It bears the heavy responsibility of safely and reliably containing and transmitting various media under high temperature, high pressure, strong corrosion and complex stress environment. As the most commonly used method in pressure vessel assembly, welding is a complex physical and chemical process with high productivity. However, local temperature concentration and rapid heating and cooling during welding cause uneven thermal expansion of the weld and adjacent parent materials, thereby forming serious residual stress. Residual stress can reduce the fatigue life, dimensional stability and corrosion resistance of pressure equipment, and even induce brittle fracture. Therefore, accurately predicting the spatial distribution of residual stress has important engineering value for effectively controlling residual stress, welding deformation and optimizing welding process parameters.
[0003] Thermoelastic-plastic finite element method (FEA) is currently the most widely used method for predicting residual stress distribution and deformation during welding. This method simplifies the complex physical phenomena and heat flow distribution inside the molten pool through an equivalent heat source model, thereby avoiding detailed modeling of complex processes while ensuring calculation accuracy. However, this simplification also makes the simulation results highly dependent on the selected heat source model parameters.
[0004] The welding heat source model is used to describe the input and distribution of heat during welding and is the basis of welding numerical simulation. In the optimization of welding heat source model parameters, the traditional manual trial and error method relies on the operator's experience, while the existing automatic method of finding the optimal parameters still faces the problem of high computational cost and time consumption caused by frequent calls to the simulation model for evaluation during the optimization process.
[0005] The proxy model establishes the mapping relationship between the input and output of the simulation system through existing samples, providing an alternative to the computationally expensive numerical model. However, each proxy model has its limitations and scope of application, resulting in different potential information obtained by different proxy models in the same simulation system. In order to fully utilize the information of the original data and the advantages of different models and enhance the generalization ability of the model, it is necessary to merge multiple sub-models into one model through a hybrid modeling method. However, the traditional weighted combination strategy has shown several limitations in application. Specifically, the global fixed weight method is difficult to capture the complex nonlinear relationship between the sub-model predictions; the variance-based weight determination mechanism is easily affected by data outliers; and the adaptive weighting rule is limited by the choice of specific algorithms and evaluation indicators.
[0006] In summary, the existing welding heat source parameter optimization process has the problems of waste of computing resources and time-consuming optimization caused by frequent calls to simulation models. Although the hybrid agent model provides a solution, the limitations of the existing weighted average combination method to construct the agent model limit the model generalization ability and prediction accuracy. Therefore, hybrid agent modeling requires a more flexible and powerful integration strategy. Summary of the invention
[0007] In view of the deficiencies of the above-mentioned prior art, the technical problem to be solved by the present invention is: how to provide a welding heat source model parameter optimization method based on a hybrid proxy model, construct a hybrid proxy model through stacking and feature fusion, and combine the trained hybrid proxy model with the Newton-Thomson intelligent optimization algorithm to achieve the optimization of the welding heat source model parameters. During the optimization process, the proxy model is used to quickly and accurately predict the shape of the welding molten pool, provide reliable evaluation indicators for the optimization algorithm, guide parameter updating and decision iteration, and significantly reduce the dependence on high-cost simulation models while ensuring the optimization quality, reduce the consumption of computing resources and optimization time, and at the same time ensure a high degree of consistency between the optimization results and the actual molten pool shape, thereby achieving efficient optimization of the welding heat source model parameters.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0009] A welding heat source model parameter optimization method based on a hybrid proxy model, comprising:
[0010] S1: Construct a welding heat source model with welding process parameters as input and molten pool shape data as output;
[0011] S2: Obtain welding process parameters and actual molten pool shape data;
[0012] S3: Sampling is performed in the sample space of the welding heat source model parameters to generate an initial sample point set; finite element simulation is performed based on the initial sample point set and welding process parameters to construct a training data set;
[0013] S4: Build several independent proxy models and train each proxy model through the training data set; use the stacking method to build a hybrid proxy model based on the trained proxy models, and dynamically fuse the outputs of each proxy model through the feature fusion model;
[0014] S5: Combine the trained hybrid proxy model with the Newton-Thomson intelligent optimization algorithm, and guide the parameter update and iterative decision of the Newton-Thomson intelligent optimization algorithm based on the real molten pool shape data and the molten pool shape prediction results predicted by the hybrid proxy model to achieve the optimization of the welding heat source model parameters.
[0015] Preferably, in step S3, a training data set is constructed by the following steps:
[0016] S301: performing finite element simulation of the welding temperature field on the sample points in the initial sample point set based on the welding process parameters to simulate the temperature distribution and molten pool formation process during the welding process;
[0017] S302: extracting molten pool shape data from finite element simulation results based on an isoparametric transformation method; wherein the molten pool shape data includes molten pool width and molten pool depth;
[0018] S303: constructing a training data set with welding heat source model parameters as input and molten pool shape data as output.
[0019] Preferably, in step S302, the molten pool shape data is extracted by the following steps:
[0020] S3021: In the finite element simulation results, a layer of units near the weld is defined as a group of units, denoted as E;
[0021] Through array ED Record unit and node information, for E Units in i , its unit number is stored in ED(i,1), and its four node numbers are stored in ED(i,2) to ED(i,5);
[0022] The node temperatures are stored in array T. For the i-th element in E, the node information in ED is used to store the node temperatures from T(i,1) to T(i,4). For each element in E, C(i,j) is assigned a value using the following formula:
[0023]
[0024] Where: T(i,j) represents the unit i The jth node temperature of m Indicates the melting point of the material;
[0025] S3022: For each unit in E, determine whether T=T m Isotherms: Calculation When the temperature of each node in element i is greater than or less than T m When |S i |=4, that is, T=T does not exist in unit i m Otherwise, there is an isotherm in unit i; the isotherm is T = T m The unit is defined as a new set of units, denoted as E′;
[0026] S3023: For a given unit i in E′, substitute ξ=±1,ζ=±1 into the following formula to obtain four points, namely (1,ζ i1 ), (-1, ζ i2 ), (ξ i1 ,1),(ξ i2 , -1), where ξ and ζ represent the horizontal and vertical axes of the local coordinate system established with the unit center, respectively;
[0027]
[0028] Where: T i represents the temperature of the i-th node in the unit; (ξ i , i ) represents the coordinates of the node in the element coordinate system;
[0029] S3024: Assuming that the characteristic points on the isotherm are equally spaced along the ξ axis, the ξ coordinates of the characteristic points are calculated using the following formula:
[0030]
[0031] Where: i1 represents the ξ coordinate of point P1, ξ i2 represents the ξ coordinate of point P2, P1 and P2 represent the two intersection points of the isotherms on the unit boundary; K represents the total number of characteristic points;
[0032] S3025: Calculate the coordinates of the feature points in the global coordinate system using the following formula:
[0033]
[0034] Where: x i and z i are the x and z coordinates of node i in the global coordinate system; N i (ξ, ζ) is the shape function corresponding to any point (ξ, ζ) on the element at node i;
[0035] S3026: Calculate the feature point coordinates (x ik , z ik ), the molten pool width D is calculated by the following formula c and the molten pool depth W c ;
[0036]
[0037] Preferably, in step S4, the hybrid proxy model is constructed by the following steps:
[0038] S401: constructing several independent proxy models, and using the training data set to train each proxy model to ensure that each model can accurately predict the shape of the welding pool;
[0039] S402: A stacking method is used to build a hybrid proxy model based on the trained proxy models, and the outputs of each proxy model are dynamically fused through a feature fusion model to evaluate the importance of each sub-model output, capture key information areas and suppress interference information, thereby improving the overall prediction accuracy and generalization ability of the model.
[0040] Preferably, in step S401, the proxy model is trained by the following steps:
[0041] S4011: Training data set Divide into k mutually disjoint subsets D1, D2, ...D k , where x i represents the sample, y i Indicates the original label corresponding to the sample;
[0042] S4012: Each subset D j As the validation set, the remaining k-1 subsets are used as training sets to train k proxy models f j ;
[0043] S4013: Proxy Model f j On the validation set D j The prediction results are: Combine the prediction results of all proxy models on their respective validation sets to generate a new feature matrix Z:
[0044]
[0045] in, Represents the jth proxy model for sample x i The prediction results;
[0046] S4014: Use the new feature matrix Z and the original label y = [y1, y2, ..., y N ] T Train the feature fusion model.
[0047] Preferably, in step S402, the steps of fusing the outputs of multiple proxy models by the feature fusion model are as follows:
[0048] S4021: Take the output of M proxy models as input, denoted as in is the output feature vector of the i-th surrogate model, and d is the feature dimension;
[0049] S4022: The self-attention mechanism dynamically assigns attention weights by calculating the interactions between units in the input sequence;
[0050] The specific steps are as follows:
[0051] 1) Calculate the query matrix Q, key matrix K and value matrix V. The calculation formula is as follows:
[0052] Q=XW Q , K = XW K , V = XW V ;
[0053] Where: is the learnable weight matrix, d k is the dimension of the attention mechanism;
[0054] 2) Calculate the attention score matrix A:
[0055]
[0056] Where: softmax(·) is used to normalize the attention score;
[0057] 3) Calculate the weighted feature representation Z:
[0058] Z = AV;
[0059] Where: It is the feature representation enhanced by the self-attention mechanism;
[0060] S4023: Input the feature representation Z output by the self-attention mechanism into the MLP, extract high-level features and establish a mapping relationship, and obtain the prediction result of the melt pool shape output by the hybrid proxy model;
[0061] The calculation process of MLP is as follows:
[0062] 1) For the lth layer of multilayer perceptron, its output is:
[0063] h (l) =σ(W (l) h (l-1) +b (l) );
[0064] Where: h (l-1) is the output of the l-1th layer; W (l) and b (l) are the weight matrix and bias vector of the lth layer respectively; σ(·) is the nonlinear activation function;
[0065] 2) The final output is: y = h (L) , where L is the number of layers of the multilayer perceptron, and y is the prediction result of the melt pool shape output by the hybrid proxy model.
[0066] Preferably, in step S5, the optimization of welding heat source model parameters is achieved through the following steps:
[0067] S501: Initialize population X = {X1, X2, ..., X N};
[0068] The formula is:
[0069] X i =lb+rand×(ub-lb), i=1, 2,...,N;
[0070] Where: X i is a welding heat source parameter vector; rand represents a random number between 0 and 1; lb and ub are the lower and upper limits of the parameter respectively; N represents the population size;
[0071] S502: Use the trained hybrid proxy model f to evaluate each candidate solution X i The shape of the molten pool is calculated and its fitness value is calculated;
[0072] The formula is:
[0073]
[0074] Where: Fitness(X i ) represents the candidate solution X i The fitness value of ; K is the number of melt pool features; Represents the hybrid surrogate model based on the candidate solution X i The predicted value of the kth melt pool feature evaluated; represents the actual measured value of the kth melt pool feature;
[0075] S503: updating the solution in the population according to the NRSR rule and TAO rule in the Newton-Thomson intelligent optimization algorithm;
[0076] S504: Obtaining the optimal parameter combination X corresponding to the optimal solution * To update the welding heat source model parameters.
[0077] Preferably, in step S503, the steps of updating the solution in the population according to the NRSR rule and the TAO rule in the Newton-Thomson intelligent optimization algorithm are as follows:
[0078] S5031: In each iteration, record the optimal solution in the current population and the worst solution
[0079] S5032: Use Perform corresponding position updates under the NRSR rule to obtain a new solution;
[0080] The formula of NRSR rule is expressed as:
[0081]
[0082] Where: represents the position vector of the fth individual in the next iteration; represents the position vector of the fth individual in the current iteration; rand represents a random number between 0 and 1; randn represents a normally distributed random number with a mean of 0 and a variance of 1; and represents the position vector of two random individuals in the current iteration; It represents the current iteration; Max_It represents the maximum number of iterations; X w is the position vector of the individual with the worst fitness value in the current iteration; X b is the position vector of the individual with the best fitness value in the current iteration; ρ improves the exploration ability of NRBO and guides the population in the right direction; δ represents the adaptive coefficient to ensure that the algorithm strikes a balance between diversity and strength;
[0083] S5033: In order to avoid falling into the local optimal trap, the TAO rule is used to update the new solution;
[0084] The formula is:
[0085]
[0086] Where: is the best position X by combining b The mathematical model of the quality-enhanced solution generated by and the current vector position is as follows:
[0087]
[0088] Where: θ1 and θ2 are random values in the range of (-1, 1) and (-0.5, 0.5) respectively; β represents a binary number, if the value of the random number Δ∈(0, 1) is less than 0.5, β = 1, otherwise β = 0;
[0089] S5034: After obtaining the position of the new solution, check whether each solution exceeds the range of the parameter;
[0090] If it is out of range, adjust it to within the bounds:
[0091]
[0092] S5035: Use the trained hybrid proxy model to recalculate the fitness value of the updated solution, and update the solution in the population according to the updated fitness value: if the fitness value of the new solution is better than the old solution, replace the old solution:
[0093]
[0094] S5036: Repeat steps S5031 and S5035 until the maximum number of iterations is reached or the fitness change for several consecutive generations is less than the preset threshold, then the optimization process ends and returns to X. b As the optimal solution.
[0095] Compared with the prior art, the welding heat source model parameter optimization method based on the hybrid proxy model in the present invention has the following beneficial effects:
[0096] The present invention introduces isoparametric transformation technology to accurately extract the shape of the welding pool, provides a high-quality and consistent data set for the construction of the proxy model, significantly improves the prediction accuracy and reliability of the model, and avoids the tedious process of manually constructing the data set, thereby improving the efficiency of data processing. Secondly, the present invention innovatively constructs a finite element hybrid proxy model of the welding temperature field, overcomes the limitations of the single proxy model in terms of scope of application and prediction ability, and enhances the overall generalization ability and adaptability of the model by integrating the advantages of different models. In the modeling process of the hybrid model, the present invention abandons the traditional fixed weight combination method, adopts the stacking combination method, and introduces Self-Attention-MLP as a feature fusion model, which can dynamically evaluate the importance of each sub-model output, automatically capture the information area that needs to be focused on in the shape of the welding pool, and suppress the influence of irrelevant or interfering information, solving the problem that the traditional fixed weight method is difficult to capture the complex nonlinear relationship between the predictions of the sub-models, and can also adaptively adjust the model weight according to the changes in working conditions, further improving the robustness and prediction accuracy of the model. In addition, when training each sub-proxy model, the present invention adopts a K-fold cross-validation method to divide the original data set into K mutually non-overlapping subsets, and takes one of the subsets as a validation set in turn, and the remaining K-1 subsets as training sets, which effectively prevents the overfitting problem caused by reusing the training data set, and improves the stability and generalization performance of the model. Finally, the present invention combines the constructed hybrid proxy model with the Newton-Thomson intelligent optimization algorithm, and uses the proxy model to quickly and accurately predict the shape of the welding pool during the optimization process, providing a reliable evaluation index for the optimization algorithm, guiding parameter updates and decision iterations, and significantly reducing the dependence on high-cost simulation models while ensuring the quality of optimization, reducing the consumption of computing resources and optimization time, while ensuring the high consistency between the optimization results and the actual shape of the molten pool, and achieving efficient optimization of the welding heat source model parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0098] Figure 1 Flowchart of the welding heat source model parameter optimization method based on the hybrid surrogate model.
[0099] Figure 2 Flow chart of melt pool shape contour extraction based on isoparametric transformation.
[0100] Figure 3 Modeling architecture diagram for the hybrid agent model.
[0101] Figure 4 Optimize the flow chart for the Newton-Thomson intelligent optimization algorithm. DETAILED DESCRIPTION
[0102] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but only represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0103] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. In the description of the present invention, it should be noted that the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, or the orientation or position relationship in which the invention product is usually placed when used, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. In addition, the terms "horizontal", "vertical", etc. do not mean that the components are required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0104] The following is a further detailed description through specific implementation methods:
[0105] Example:
[0106] This embodiment discloses a welding heat source model parameter optimization method based on a hybrid proxy model.
[0107] like Figure 1 As shown, the welding heat source model parameter optimization method based on the hybrid agent model includes:
[0108] S1: Construct a welding heat source model with welding process parameters as input and molten pool shape data as output;
[0109] In this embodiment, the welding heat source model is constructed by existing means, and the optimization of the welding heat source model parameters is achieved through subsequent steps.
[0110] S2: Obtain welding process parameters and actual molten pool shape (weld fusion zone shape) data;
[0111] S3: Sampling is performed in the sample space of the welding heat source model parameters to generate an initial sample point set; finite element simulation is performed based on the initial sample point set and welding process parameters to construct a training data set;
[0112] S4: Build several independent proxy models and train each proxy model through the training data set; use the stacking method to build a hybrid proxy model based on the trained proxy models, and dynamically fuse the outputs of each proxy model through the feature fusion model;
[0113] S5: Combine the trained hybrid proxy model with the Newton-Thomson intelligent optimization algorithm, and guide the parameter update and iterative decision of the Newton-Thomson intelligent optimization algorithm based on the real molten pool shape data and the molten pool shape prediction results predicted by the hybrid proxy model to achieve the optimization of the welding heat source model parameters.
[0114] The present invention introduces isoparametric transformation technology to accurately extract the shape of the welding pool, provides a high-quality and consistent data set for the construction of the proxy model, significantly improves the prediction accuracy and reliability of the model, and avoids the tedious process of manually constructing the data set, thereby improving the efficiency of data processing. Secondly, the present invention innovatively constructs a finite element hybrid proxy model of the welding temperature field, overcomes the limitations of the single proxy model in terms of scope of application and prediction ability, and enhances the overall generalization ability and adaptability of the model by integrating the advantages of different models. In the modeling process of the hybrid model, the present invention abandons the traditional fixed weight combination method, adopts the stacking combination method, and introduces Self-Attention-MLP as a feature fusion model, which can dynamically evaluate the importance of each sub-model output, automatically capture the information area that needs to be focused on in the shape of the welding pool, and suppress the influence of irrelevant or interfering information, solving the problem that the traditional fixed weight method is difficult to capture the complex nonlinear relationship between the predictions of the sub-models, and can also adaptively adjust the model weight according to the changes in working conditions, further improving the robustness and prediction accuracy of the model. In addition, when training each sub-proxy model, the present invention adopts a K-fold cross-validation method to divide the original data set into K mutually non-overlapping subsets, and takes one of the subsets as a validation set in turn, and the remaining K-1 subsets as training sets, which effectively prevents the overfitting problem caused by reusing the training data set, and improves the stability and generalization performance of the model. Finally, the present invention combines the constructed hybrid proxy model with the Newton-Thomson intelligent optimization algorithm, and uses the proxy model to quickly and accurately predict the shape of the welding pool during the optimization process, providing a reliable evaluation index for the optimization algorithm, guiding parameter updates and decision iterations, and significantly reducing the dependence on high-cost simulation models while ensuring the quality of optimization, reducing the consumption of computing resources and optimization time, while ensuring the high consistency between the optimization results and the actual shape of the molten pool, and achieving efficient optimization of the welding heat source model parameters.
[0115] In order to better introduce the technical solution of the present invention, this embodiment is described through the following parts.
[0116] 1. Extracting the melt pool shape from the simulation results based on the isoparametric transformation method
[0117] In this experimental example, the training data set is constructed through the following steps:
[0118] S301: performing finite element simulation of the welding temperature field on the sample points in the initial sample point set based on the welding process parameters to simulate the temperature distribution and molten pool formation process during the welding process;
[0119] S302: extracting molten pool shape data from finite element simulation results based on an isoparametric transformation method; wherein the molten pool shape data includes key geometric features such as molten pool width and molten pool depth;
[0120] S303: constructing a training data set with welding heat source model parameters as input and molten pool shape data as output.
[0121] Combination Figure 2 As shown in the figure, the molten pool shape data is extracted through the following steps:
[0122] S3021: In the finite element simulation results, a layer of units near the weld is defined as a group of units, denoted as E;
[0123] The information of cells and nodes is recorded through the array ED. For cell i in E, its cell number is stored in ED(i,1), and its four node numbers are stored in ED(i,2) to ED(i,5) respectively; a cell (which can be regarded as a square) has 4 nodes (the 4 vertices of the square).
[0124] The node temperatures are stored in array T. For the i-th element in E, the node information in ED is used to store the node temperatures from T(i,1) to T(i,4). For each element in E, C(i,j) is assigned a value using the following formula: The purpose of C(i,j) is to characterize the four nodes of the element and which nodes have temperatures exceeding the melting point. If only some of the nodes exceed the melting point, it means that there are isotherms on the element.
[0125]
[0126] Where: T(i,j) represents the jth node temperature of element i; T m Indicates the melting point of the material;
[0127] S3022: For each unit in E, determine whether T=T m Isotherms: Calculation When the temperature of each node in element i is greater than or less than Tm When |S i |=4, that is, T=T does not exist in unit i m Otherwise, there is an isotherm in unit i; the isotherm is T = T m The unit of is defined as a new unit, denoted as E′; when all four nodes fail to reach the melting point, and all reach the melting point (that is, the isotherm will not be on the unit) | S i |=4.
[0128] S3023: For a given unit i in E′, substitute ξ=±1,ζ=±1 into the following formula to obtain four points, namely (1,ζ i1 ), (-1, ζ i2 ), (ξ i1 , 1), (ξ i2 , -1), where ξ and ζ represent the horizontal and vertical axes of the local coordinate system established with the unit center; only two of the four points are located at the boundary of the unit, and these two points can be calculated based on |ξ i1 |,|ξ i2 |,|ζ i1 |,|ζ i2 | is less than 1 to judge, if so, the intersection is at the unit boundary;
[0129]
[0130] Where: T i represents the temperature of the i-th node in the unit; (ξ i , i ) represents the coordinates of the node in the element coordinate system;
[0131] In this embodiment, any point on the unit (any point on the square) satisfies the above formula in the unit coordinate system (local coordinate system). The boundary value, horizontal coordinate is positive or negative 1, and vertical coordinate is positive or negative 1. The coordinate value is calculated, that is, the intersection of the isotherms on the unit boundary (on the square).
[0132] S3024: Assuming that the characteristic points on the isotherm are equally spaced along the ξ axis, the ξ coordinates of the characteristic points are calculated using the following formula:
[0133]
[0134] Where: i1 represents the ξ coordinate of point P1, ξ i2 represents the ξ coordinate of point P2, P1 and P2 represent the two intersection points of the isotherms on the unit boundary; K represents the total number of characteristic points;
[0135] S3025: Calculate the coordinates of the feature points in the global coordinate system using the following formula:
[0136]
[0137] Where: x i and z i are the x and z coordinates of node i in the global coordinate system; N i (ξ, ζ) is the shape function corresponding to any point (ξ, ζ) on the element at node i;
[0138] S3026: Calculate the feature point coordinates (x ik , z ik ), the molten pool width D is calculated by the following formula c and the molten pool depth W c ;
[0139]
[0140] 2. Hybrid Agent Model
[0141] In this embodiment, the hybrid proxy model is constructed through the following steps:
[0142] S401: constructing several independent proxy models, and using the training data set to train each proxy model to ensure that each model can accurately predict the shape of the welding pool;
[0143] S402: A stacking method is used to build a hybrid proxy model based on the trained proxy models, and the outputs of each proxy model are dynamically fused through a feature fusion model (such as Self-Attention-MLP), the importance of each sub-model output is evaluated, key information areas are captured and interference information is suppressed, and the overall prediction accuracy and generalization ability of the model are improved.
[0144] 1. Build and train multiple proxy models
[0145] Combination Figure 3 As shown, the proxy model is trained through the following steps:
[0146] S4011: Training data set Divide into k mutually disjoint subsets D1, D2, ...D k , where x i represents the sample, y i Indicates the original label corresponding to the sample;
[0147] S4012: Each subset D j As validation sets (j=1, 2, ..., k), the remaining k-1 subsets are used as training sets to train k proxy models f j (j=1, 2, ..., k);
[0148] S4013: Proxy Model f j On the validation set D j The prediction results are: Combine the prediction results of all proxy models on their respective validation sets to generate a new feature matrix Z:
[0149]
[0150] in, Represents the jth proxy model for sample x i The prediction results;
[0151] S4014: Using the new feature matrix Z and the original label y = [y1, y2, ..., y N ] T Train the feature fusion model.
[0152] 2. Self-Attention-MLP feature fusion model fusion process
[0153] Specifically, the steps of the feature fusion model fusing the outputs of multiple proxy models are as follows:
[0154] S4021: Take the output of M proxy models as input, denoted as in is the output feature vector of the i-th surrogate model, and d is the feature dimension;
[0155] S4022: The self-attention mechanism dynamically assigns attention weights by calculating the interactions between units in the input sequence;
[0156] The specific steps are as follows:
[0157] 1) Calculate the query matrix Q, key matrix K and value matrix V. The calculation formula is as follows:
[0158] Q=XW Q , K = XW K , V = XW V ;
[0159] Where: is the learnable weight matrix, d k is the dimension of the attention mechanism;
[0160] 2) Calculate the attention score matrix A:
[0161]
[0162] Where: softmax(·) is used to normalize the attention score;
[0163] 3) Calculate the weighted feature representation Z:
[0164] Z = AV;
[0165] Where: It is the feature representation enhanced by the self-attention mechanism;
[0166] S4023: Input the feature representation Z output by the self-attention mechanism into a multi-layer perceptron (MLP), extract high-level features and establish a mapping relationship, and obtain the prediction result of the melt pool shape output by the hybrid proxy model;
[0167] The calculation process of MLP is as follows:
[0168] 1) For the lth layer of multilayer perceptron, its output is:
[0169] h (l) =σ(W (l) h (l-1) +b (l) );
[0170] Where: h (l-1) is the output of the l-1th layer; W (l) and b (l) are the weight matrix and bias vector of the lth layer respectively; σ(·) is the nonlinear activation function (such as ReLU);
[0171] 2) The final output is: y = h (L) , where L is the number of layers of the multilayer perceptron, and y is the prediction result of the melt pool shape output by the hybrid proxy model.
[0172] 3. Optimization of welding heat source model parameters
[0173] In this embodiment, the optimization of welding heat source model parameters is achieved through the following steps:
[0174] S501: According to the characteristics and constraints of the optimization problem, initialize the population X = {X1, X2, ..., X N};
[0175] The formula is:
[0176] X i =lb+rand×(ub-lb), i=1, 2,...,N;
[0177] Where: X i is a welding heat source parameter vector; rand represents a random number between 0 and 1; lb and ub are the lower and upper limits of the parameter respectively; N represents the population size;
[0178] S502: Use the trained hybrid proxy model f to evaluate each candidate solution X iThe shape of the molten pool is calculated and its fitness value is calculated; the smaller the fitness function is, the better the parameter combination is;
[0179] The formula is:
[0180]
[0181] Where: Fitness(X i ) represents the candidate solution X i The fitness value of ; K is the number of melt pool features (such as fusion width and fusion depth); Represents the hybrid surrogate model based on the candidate solution X i The predicted value of the kth melt pool feature evaluated; represents the actual measured value of the kth melt pool feature;
[0182] S503: updating the solution in the population according to the NRSR rule and TAO rule in the Newton-Thomson smart optimization algorithm (NRBO);
[0183] S504: Obtaining the optimal parameter combination X corresponding to the optimal solution * To update the welding heat source model parameters;
[0184] Get the optimal parameter combination X * Finally, the actual simulation model is used for verification to ensure the prediction accuracy of the proxy model and the effectiveness of the optimization results.
[0185] Combination Figure 4 As shown, the steps for updating the solution in the population according to the NRSR rule and TAO rule in the Newton-Thomson intelligent optimization algorithm are as follows:
[0186] S5031: In each iteration, record the optimal solution in the current population and the worst solution
[0187] S5032: Use Perform corresponding position updates under the NRSR rule to obtain a new solution;
[0188] The formula of NRSR rule is expressed as:
[0189]
[0190] Where: represents the position vector of the fth individual in the next iteration; represents the position vector of the fth individual in the current iteration; rand represents a random number between 0 and 1; randn represents a normally distributed random number with a mean of 0 and a variance of 1; and represents the position vector of two random individuals in the current iteration; It represents the current iteration; Max_It represents the maximum number of iterations; X w is the position vector of the individual with the worst fitness value in the current iteration; X b is the position vector of the individual with the best fitness value in the current iteration; ρ improves the exploration ability of NRBO and guides the population in the right direction; δ represents the adaptive coefficient to ensure that the algorithm strikes a balance between diversity and strength;
[0191] S5033: In order to avoid falling into the local optimal trap, the TAO rule is used to update the new solution;
[0192] The formula is:
[0193]
[0194] Where: is the best position X by combining b The mathematical model of the quality-enhanced solution generated by and the current vector position is as follows:
[0195]
[0196] Where: θ1 and θ2 are random values in the range of (-1, 1) and (-0.5, 0.5), respectively; β represents a binary number. If the value of the random number Δ∈(0, 1) is less than 0.5, β = 1, otherwise β = 0. β enables NRBO to dynamically adjust the search strategy according to the current search status, thereby effectively guiding the population to move to promising areas while maintaining sufficient exploration capabilities.
[0197] S5034: After obtaining the position of the new solution, check whether each solution exceeds the range of the parameter;
[0198] If it is out of range, adjust it to within the bounds:
[0199]
[0200] S5035: Use the trained hybrid proxy model to recalculate the fitness value of the updated solution, and update the solution in the population according to the updated fitness value: if the fitness value of the new solution is better than the old solution, replace the old solution:
[0201]
[0202] S5036: Repeat steps S5031 and S5035 until the maximum number of iterations is reached or the fitness change for several consecutive generations is less than the preset threshold, then the optimization process ends and returns to X. b As the optimal solution (i.e., optimized value).
[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. A welding heat source model parameter optimization method based on a hybrid proxy model, characterized in that: include: S1: Construct a welding heat source model with welding process parameters as input and molten pool shape data as output; S2: Obtain welding process parameters and actual molten pool shape data; S3: Sampling is performed in the sample space of the welding heat source model parameters to generate an initial sample point set; finite element simulation is performed based on the initial sample point set and welding process parameters to construct a training data set; S4: Build several independent proxy models and train each proxy model using the training dataset; A stacking method is used to build a hybrid proxy model based on the trained proxy models, and the outputs of each proxy model are dynamically fused through a feature fusion model; S5: Combine the trained hybrid proxy model with the Newton-Thomson intelligent optimization algorithm, and guide the parameter update and iterative decision of the Newton-Thomson intelligent optimization algorithm based on the real molten pool shape data and the molten pool shape prediction results predicted by the hybrid proxy model to achieve the optimization of the welding heat source model parameters.
2. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 1, characterized in that: In step S3, the training data set is constructed by the following steps: S301: performing finite element simulation of the welding temperature field on the sample points in the initial sample point set based on the welding process parameters to simulate the temperature distribution and molten pool formation process during the welding process; S302: extracting molten pool shape data from finite element simulation results based on an isoparametric transformation method; The molten pool shape data includes molten pool width and molten pool depth; S303: constructing a training data set with welding heat source model parameters as input and molten pool shape data as output.
3. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 2, characterized in that: In step S302, the molten pool shape data is extracted by the following steps: S3021: In the finite element simulation results, a layer of units near the weld is defined as a group of units, denoted as E; The information of cells and nodes is recorded through array ED. For cell i in E, its cell number is stored in ED(i,1), and its four node numbers are stored in ED(i,2) to ED(i,5). The node temperatures are stored in array T. For the i-th element in E, the node information in ED is used to store the node temperatures from T(i,1) to T(i,4). For each element in E, C(i,j) is assigned a value using the following formula: Where: T(i,j) represents the jth node temperature of element i; T m Indicates the melting point of the material; S3022: For each unit in E, determine whether T=T m Isotherms: Calculation When the temperature of each node in element i is greater than or less than T m When |S i |=4, that is, T=T does not exist in unit i m Otherwise, there is an isotherm in unit i; the isotherm is T = T m The unit is defined as a new set of units, denoted as E′; S3023: For a given unit i in E′, substitute ξ=±1,ζ=±1 into the following formula to obtain four points, namely (1,ζ i1 ), (-1, ζ i2 ), (ξ i1 , 1), (ξ i2 , -1), where ξ and ζ represent the horizontal and vertical axes of the local coordinate system established with the unit center, respectively; Where: T i represents the temperature of the i-th node in the unit; (ξ i , i ) represents the coordinates of the node in the element coordinate system; S3024: Assuming that the characteristic points on the isotherm are equally spaced along the ξ axis, the ξ coordinates of the characteristic points are calculated using the following formula: Where: i1 represents the ξ coordinate of point P1, ξ i2 represents the ξ coordinate of point P2, P1 and P2 represent the two intersection points of the isotherms on the unit boundary; K represents the total number of characteristic points; S3025: Calculate the coordinates of the feature points in the global coordinate system using the following formula: Where: x i and z i are the x and z coordinates of node i in the global coordinate system; N i (ξ, ζ) is the shape function corresponding to any point (ξ, ζ) on the element at node i; S3026: Calculate the feature point coordinates (x ik , z ik ), the molten pool width D is calculated by the following formula c and the molten pool depth W c ; 4. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 1, characterized in that: In step S4, the hybrid proxy model is constructed by the following steps: S401: constructing several independent proxy models, and training each proxy model using a training data set; S402: A stacking method is used to construct a hybrid proxy model based on the trained proxy models, and the outputs of the proxy models are dynamically fused through a feature fusion model to evaluate the importance of the output of each sub-model, capture key information areas and suppress interference information.
5. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 4, characterized in that: In step S401, the proxy model is trained by the following steps: S4011: Training data set Divide into k mutually disjoint subsets D1, D2, ...D k , where x i represents the sample, y i Represents the original label corresponding to the sample, and N represents the number of samples; S4012: Each subset D j As the validation set, the remaining k-1 subsets are used as training sets to train k proxy models f j ; S4013: Proxy Model f j On the validation set D j The prediction results are: Combine the prediction results of all proxy models on their respective validation sets to generate a new feature matrix Z: in, Represents the jth proxy model for sample x i The prediction results; S4014: Using the new feature matrix Z and the original label y = [y1, y2, ..., y N ] T Train the feature fusion model.
6. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 4, characterized in that: In step S402, the steps of fusing the outputs of multiple proxy models by the feature fusion model are as follows: S4021: Take the output of M proxy models as input, denoted as in is the output feature vector of the i-th surrogate model, and d is the feature dimension; S4022: The self-attention mechanism dynamically assigns attention weights by calculating the interactions between units in the input sequence; The specific steps are as follows: 1) Calculate the query matrix Q, key matrix K and value matrix V. The calculation formula is as follows: Q=XW Q ,K=XW K ,V=XW V ; Where: is the learnable weight matrix, d k is the dimension of the attention mechanism; 2) Calculate the attention score matrix A: Where: softmax(·) is used to normalize the attention score; 3) Calculate the weighted feature representation Z: Z = AV; Where: It is the feature representation enhanced by the self-attention mechanism; S4023: Input the feature representation Z output by the self-attention mechanism into the MLP, extract high-level features and establish a mapping relationship, and obtain the prediction result of the melt pool shape output by the hybrid proxy model; The calculation process of MLP is as follows: 1) For the lth layer of multilayer perceptron, its output is: h (l) =σ(W (l) h (l-1) +b (l) ); Where: h (l-1) is the output of the l-1th layer; W (l) and b (l) are the weight matrix and bias vector of the i-th layer respectively; σ(·) is the nonlinear activation function; 2) The final output is: v = h (L) , where L is the number of layers of the multilayer perceptron, and y is the prediction result of the melt pool shape output by the hybrid proxy model.
7. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 1, characterized in that: In step S5, the optimization of welding heat source model parameters is achieved through the following steps: S501: Initialize population X = {X1, X2, ..., X N }; The formula is: X i =lb+rand×(ub-lb),i=1,2,...,N; Where: X i is a welding heat source parameter vector; rand represents a random number between 0 and 1; lb and ub are the lower and upper limits of the parameter respectively; N represents the population size; S502: Use the trained hybrid proxy model f to evaluate each candidate solution X i The shape of the molten pool is calculated and its fitness value is calculated; The formula is: Where: Fitness(X i ) represents the candidate solution X i The fitness value of ; K is the number of melt pool features; Represents the hybrid surrogate model based on the candidate solution X i The predicted value of the kth melt pool feature evaluated; represents the actual measured value of the kth melt pool feature; S503: updating the solution in the population according to the NRSR rule and TAO rule in the Newton-Thomson intelligent optimization algorithm; S504: Obtaining the optimal parameter combination X corresponding to the optimal solution * To update the welding heat source model parameters.
8. The welding heat source model parameter optimization method based on the hybrid proxy model according to claim 7, characterized in that: In step S503, the steps of updating the solution in the population according to the NRSR rule and the TAO rule in the Newton-Thomson intelligent optimization algorithm are as follows: S5031: In each iteration, record the optimal solution in the current population and the worst solution S5032: Use Perform corresponding position updates under the NRSR rule to obtain a new solution; The formula of NRSR rule is expressed as: Where: represents the position vector of the fth individual in the next iteration, i.e., the new solution; represents the position vector of the fth individual in the current iteration; rand represents a random number between 0 and 1; randn represents a normally distributed random number with a mean of 0 and a variance of 1; and represents the position vector of two random individuals in the current iteration; It represents the current iteration; Max_It represents the maximum number of iterations; X w , is the position vector of the individual with the worst fitness value in the current iteration; X b is the position vector of the individual with the best fitness value in the current iteration; δ represents the adaptive coefficient; S5033: In order to avoid falling into the local optimal trap, the TAO rule is used to update the new solution; The formula is: Where: is the best position X by combining b The mathematical model of the quality-enhanced solution generated by and the current vector position is as follows: Where: and are random values in the range of (-1,1) and (-0.5,0.5) respectively; represents a binary number, if the value of the random number is less than 0.5, , otherwise; S5034: After obtaining the position of the new solution, check whether each solution exceeds the range of the parameter; If it is out of range, adjust it to within the bounds: S5035: Use the trained hybrid proxy model to recalculate the fitness value of the updated solution, and update the solution in the population according to the updated fitness value: if the fitness value of the new solution is better than the old solution, replace the old solution: S5036: Repeat steps S5031 and S5035 until the maximum number of iterations is reached or the fitness change for several consecutive generations is less than a preset threshold, then end the optimization process and return as the optimal solution.