CN113935235A - Engineering design optimization method and device based on genetic algorithm and agent model - Google Patents

Engineering design optimization method and device based on genetic algorithm and agent model Download PDF

Info

Publication number
CN113935235A
CN113935235A CN202111188161.4A CN202111188161A CN113935235A CN 113935235 A CN113935235 A CN 113935235A CN 202111188161 A CN202111188161 A CN 202111188161A CN 113935235 A CN113935235 A CN 113935235A
Authority
CN
China
Prior art keywords
chromosome
population
value
fitness
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111188161.4A
Other languages
Chinese (zh)
Inventor
陈科甲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rope Is Systems Technology LLC
Original Assignee
Beijing Rope Is Systems Technology LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rope Is Systems Technology LLC filed Critical Beijing Rope Is Systems Technology LLC
Priority to CN202111188161.4A priority Critical patent/CN113935235A/en
Publication of CN113935235A publication Critical patent/CN113935235A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/04Constraint-based CAD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/10Numerical modelling

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses an engineering design optimization method and device based on a genetic algorithm and a proxy model, wherein the method comprises the following steps: constructing a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function based on the sample data set; solving the target agent model by adopting a genetic algorithm, wherein the mutation operation of the genetic algorithm comprises the following steps: obtaining a population SnDetermining the variation disturbance value corresponding to each design variable according to the maximum value and the minimum value in the fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding the corresponding variation disturbance value to each design variable to obtain the variationThe posterior chromosome; if the simulation termination condition is not met, adding a sample and updating the target agent model and the constraint agent model; and if the simulation termination condition is met, taking the optimal solution obtained by solving as the optimization result of the design variable and outputting the optimization result.

Description

Engineering design optimization method and device based on genetic algorithm and agent model
Technical Field
The application relates to the technical field of simulation optimization, in particular to an engineering design optimization method and device based on a genetic algorithm and a proxy model.
Background
Aiming at the engineering optimization problem, generating initial sample point data of design variables by a test design method, performing real calculation on the sample points, and establishing a proxy model based on the sample points; then finding out an optimal result based on the agent model, and carrying out real calculation on the optimal result; and if the precision of the calculation result does not meet the requirement, reestablishing the proxy model for optimization based on the newly-added sample points until the optimal result output by the proxy model meets the precision requirement, and taking the optimal result output at the moment as the simulation optimization result of the design variable. However, the calculation amount for establishing and optimizing the proxy model is large, a large amount of time is consumed, and sometimes several weeks or months are consumed, so that the engineering practicability is greatly reduced by the design period, and the application field of the engineering optimization method is limited.
Disclosure of Invention
The embodiment of the application provides an engineering design optimization method, an engineering design optimization device, electronic equipment and a storage medium based on a genetic algorithm and a proxy model, and a variation method in the genetic algorithm is improved when the genetic algorithm is used for optimizing the proxy model, so that local optimization can be effectively skipped during optimization, and the optimization efficiency and the optimization effect of the proxy model are improved.
In one aspect, an embodiment of the present application provides an engineering design optimization method based on a genetic algorithm and a proxy model, including:
s201, obtaining input parameters required by engineering design optimization, wherein the input parameters comprise: at least two design variables to be optimized, and an objective function and a constraint function for the design variables;
s202, generating a sample data set, wherein each sample in the sample data set comprises: a set of values of the at least two design variables, and true response values of the objective function and the constraint function obtained based on the set of values;
s203, constructing a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function based on the sample data set;
s204, solving the target agent model by adopting a genetic algorithm to obtain an optimal solution of the target agent model under the constraint of the constraint agent model, wherein the optimal solution comprises optimal values of the at least two design variables; wherein, in the population S for each generationnInheritance is performed to obtain a next generation population Sn+1Then, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining a variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding a corresponding variation disturbance value to each design variable of each chromosome to obtain a chromosome after variation; wherein, the population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for the at least two design variables;
s205, judging whether a simulation termination condition is met, if so, executing a step S208, otherwise, executing a step S206;
s206, newly adding q samples in the sample data set;
s207, updating the target agent model and the constraint agent model based on the sample data set after the new sample is added, and returning to the step S204;
and S208, taking the optimal solution as an optimization result of the design variable and outputting the optimization result.
In one aspect, an embodiment of the present application provides an engineering design optimization apparatus based on a genetic algorithm and a proxy model, including:
an input module, configured to obtain input parameters required for engineering design optimization, where the input parameters include: at least two design variables to be optimized, and an objective function and a constraint function for the design variables;
an initial sample generation module, configured to generate a sample data set, where each sample in the sample data set includes: a set of values of the at least two design variables, and true response values of the objective function and the constraint function obtained based on the set of values;
the initial model building module is used for building a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function based on the sample data set;
the optimization module is used for solving the target agent model by adopting a genetic algorithm so as to obtain an optimal solution of the target agent model under the constraint of the constraint agent model, wherein the optimal solution comprises optimal values of the at least two design variables; wherein, in the population S for each generationnInheritance is performed to obtain a next generation population Sn+1Then, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining a variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding a corresponding variation disturbance value to each design variable of each chromosome to obtain a chromosome after variation; wherein, the population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for the at least two design variables;
the simulation termination judging module is used for judging whether the simulation termination condition is met, if so, executing the function of the output module, and otherwise, executing the function of the newly added sample module;
a new sample adding module for adding q samples in the sample data set;
the model updating module is used for updating the target agent model and the constraint agent model based on a sample data set after a sample is newly added and returning to execute the function of the optimizing module;
and the output module is used for taking the optimal solution as an optimization result of the design variable and outputting the optimization result.
In one aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods when executing the computer program.
In one aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the steps of any of the above-described methods.
In one aspect, an embodiment of the present application provides a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in any of the various alternative implementations of control of TCP transmission performance described above.
According to the engineering design optimization method, device, electronic equipment and storage medium based on the genetic algorithm and the proxy model, when the genetic algorithm is used for optimizing the proxy model, a variation method in the genetic algorithm is improved, so that local optimization can be effectively skipped, and the optimization efficiency and the optimization effect of the proxy model are improved. The method has the advantages that the design accuracy of global optimization is guaranteed, meanwhile, the calculation amount of the traditional simulation optimization method is reduced in magnitude, the optimization period of actual engineering design is greatly shortened, and a lot of design work which cannot be carried out becomes practical.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application scenario of an engineering design optimization method based on a genetic algorithm and a proxy model according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an engineering design optimization method based on genetic algorithm and a proxy model according to an embodiment of the present application;
fig. 3 is a schematic flowchart of generating a sample data set according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an engineering design optimization device based on a genetic algorithm and a proxy model according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be noted that, in the case of no conflict, the features in the following embodiments and examples may be combined with each other; moreover, based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without any creative effort belong to the protection scope of the present application.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present application, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
For convenience of understanding, terms referred to in the embodiments of the present application are explained below:
the proxy model comprises the following steps: it is often referred to as an approximation mathematical model, also called a response surface model, approximation model or meta model, that can replace the more complex and time consuming numerical analysis during the analysis and optimization design process. For the simulation optimization design problem, a numerical analysis program or software can be regarded as an 'input-output' system, namely an objective function and a constraint function which are output quantities can be regarded as functions of design variables, and the optimal point can be rapidly predicted by establishing an agent model of the objective function and the constraint function on the design variables, so that the agent model method not only can greatly improve the optimization design efficiency, but also can reduce the optimization difficulty, and is beneficial to filtering numerical noise and realizing parallel optimization design. In the research aspect of the agent model method, various agent model methods including polynomial Response Surfaces (RSM), Kriging models, Radial Basis Functions (RBFs), Neural Networks (NN), Support Vector Regression (SVR), Multivariate Interpolation and Regression (MIR), polynomial chaotic development (PCE), and the like have been developed.
In the aspect of reasonably selecting and researching multidimensional space sample points, modern test design methods such as Latin Hypercube (LHS), orthogonal design, Uniform Design (UD) and the like suitable for computer numerical simulation experiments are developed besides a classical test design method (such as full factor, center combination, D-optimization and the like).
GA (genetic algorithm ): the search algorithm for solving the optimization in computational mathematics is one of the evolutionary algorithms.
Fitness Function (Fitness Function): and the evaluation function of the genetic algorithm is used for carrying out the advantages and disadvantages on the population. The higher the fitness function value, the easier it is to survive, otherwise it is easier to be eliminated.
Population Sn: representing the nth generation in the genetic process, and the population of each generation is mutated on the basis of the population of the previous generation. Population SnMay be referred to as a population Sn+1Of the parent, correspondingly, the population Sn+1May be referred to as a population SnThe progeny of (1).
Selecting operation: refers to selecting high-quality chromosomes from new chromosomes obtained by genetic evolution and adding the chromosomes into the next generation population Sn+1Thereby gradually optimizing chromosome quality in the population. Generally, the probability of chromosome selection inheritance to the next generation can be determined through a fitness function, i.e. chromosomes with higher fitness can be added to the next generation population Sn+1And eliminating chromosomes with low fitness. Alternatively, roulette may be used to randomly elect to join the next generation population Sn+1Dyeing ofThe proportion of each chromosome in the wheel can be determined according to the fitness of the chromosome, and the higher the fitness of the chromosome is, the higher the proportion in the wheel is, namely, the higher the probability of being selected is.
Mutation operation: is to perform genetic variation on a single chromosome to obtain a new chromosome. For example, for chromosome { p3,q1,x3Mutation is carried out, i.e. p is respectively treated3Carrying out a mutation, q1Carrying out a mutation, x3And carrying out mutation to obtain a variable combination which is a new individual.
And (3) cross operation: refers to a process of exchanging parts of genes of two chromosomes with each other in a certain way to form two new chromosomes. For example, the parent chromosomes are X and Y, the chromosome length of X is less than or equal to Y, the Y is reordered, each nearest neighbor gene in the corresponding X is found out, and then random point selection is carried out to carry out single-point crossing. For example, chromosome { p3,q1,x3And chromosome { p }5,q2,x4Are crossed, p3And p2Cross, q1And q is2Cross, x3And x4And crossing, and combining the obtained results into a new individual.
Any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
At present, the calculation amount of the optimization proxy model is large, a large amount of time is consumed, and sometimes weeks or months are consumed, so that the engineering practicability is greatly reduced by the design period, and the application field of the engineering optimization method is limited.
Therefore, the application provides an engineering design optimization method based on a genetic algorithm and a proxy model, and when the proxy model is optimized by using the genetic algorithm, a variation method in the genetic algorithm is improved, namely a variation disturbance value corresponding to each design variable in each chromosome is determined according to the maximum value and the minimum value in the chromosome fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and the corresponding variation disturbance value is added to each design variable of each chromosome to obtain the chromosome after variation, so that the diversity when the design variables vary is increased, and the local optimum is effectively skipped, thereby improving the optimization efficiency and the optimization effect of the proxy model.
After introducing the design concept of the embodiment of the present application, some simple descriptions are provided below for application scenarios to which the technical solution of the embodiment of the present application can be applied, and it should be noted that the application scenarios described below are only used for describing the embodiment of the present application and are not limited. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
Reference is made to fig. 1, which is a schematic view of an application scenario of an engineering design optimization method based on a genetic algorithm and a proxy model provided in an embodiment of the present application. The application scenario comprises a terminal device 101 and a server 102, and the terminal device 101 and the server 102 can be connected through a wireless or wired network. The terminal device 101 includes, but is not limited to, an electronic device such as a desktop computer, a mobile computer, a tablet computer, and the like, an application program for simulation optimization is installed inside the terminal device 101, the application program can display a responsive operation interface through the terminal device 101, a user configures simulation parameters, selects an optimization method and an agent model through the operation interface, and dynamically monitors a simulation process and a simulation result in real time. The server 102 mainly provides computing resources required in the simulation optimization process for the terminal device 101, and the server 102 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like.
The engineering design optimization method based on the genetic algorithm and the agent model can be applied to the engineering design fields of pneumatic optimization design, structural optimization design, missile design, aerospace vehicle design, high-speed train appearance optimization design, multidisciplinary optimization design and the like so as to optimize various design variables in the engineering design, such as engineering design parameters of weight, size, performance and the like.
Of course, the method provided in the embodiment of the present application is not limited to be used in the application scenario shown in fig. 1, and may also be used in other possible application scenarios, and the embodiment of the present application is not limited. The functions that can be implemented by each device in the application scenario shown in fig. 1 will be described in the following method embodiments, and will not be described in detail herein.
To further illustrate the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide the method operation steps as shown in the following embodiments or figures, more or less operation steps may be included in the method based on the conventional or non-inventive labor. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application.
Referring to fig. 2, an embodiment of the present application provides an engineering design optimization method based on a genetic algorithm and a proxy model, which is applicable to electronic devices such as a terminal device or a server, and includes the following steps:
s201, obtaining input parameters required by engineering design optimization, wherein the input parameters comprise: at least two design variables to be optimized, and an objective function and a constraint function for the design variables.
During specific implementation, a user can input various input parameters required for simulation optimization of specific engineering design problems through a setting interface provided by the terminal device, such as various design variables to be optimized, an objective function for describing the design variables, and a constraint function for describing the constraint relationship among the design variables, and can set one or more constraint functions according to the specific engineering design problems. For example, the design variables of the configuration include a1、a2、a3And a4The objective function is f (a)1,a2,a3,a4) The constraint function is g (a)1,a2,a3) And h (a)2,a4)。
In practical applications, the user-configurable input parameters may further include: optimizing a target direction (such as optimizing a maximum value or a minimum value), optimizing method selection (such as a gradient optimizing algorithm like a genetic algorithm, a quasi-newton method, and the like), proxy model selection (such as a polynomial response surface, a Kriging model, a radial basis function, and the like), constraint condition method selection (such as a lagrange method), proxy model optimization iteration step number, proxy model convergence precision, design variable association parameters, a value range of design variables (including a design variable lower limit and a design variable upper limit), an initial sample point number, and the like, and specifically including functions provided by a configurable parameter visual application program and user selection determination, for example, when a user selects a genetic algorithm as an optimizing method, parameters required for executing the genetic algorithm can be further configured, including: population number, optimization algebra, lower limit of mutation probability, upper limit of cross probability, lower limit of cross probability and the like.
S202, generating a sample data set, wherein each sample in the sample data set comprises: a set of values of the at least two design variables, a true response value of the objective function and the constraint function obtained based on the set of values.
In specific implementation, a DOE test design method can be adopted, a certain number of sample points are randomly generated based on the design variables in the input parameters and the value range of the design variables, and the number of the sample points is determined by the number of the configured initial sample points. For example, the design variables of the configuration include a1、a2、a3And a4,a1、a2、a3And a4Respectively have the value ranges of (0,1), (1, 10), (2, 100) and (3, 5)]If the number of the initial sample points is 20, 20 sample points with different values are generated, and each sample point contains 4 design variables a1~a4For example, one of the sample points may be { a }1=0.1,a2=3,a3=20,a4=3}。
Then, inputting the generated sample points into the existing commercial software (such as IDE) for calculating the target function and the constraint function one by one, obtaining the real response value of the target function and the real response value of the constraint function corresponding to each sample point, and inputting all the sample points and the real response values thereofAnd sorting the corresponding real response values into a sample data set. Each sample in the sample data set may be represented as { a }1,a2,a3,a4F, g, h, wherein f represents the true response value of the objective function, and g and h represent the true response values of the constraint function.
In specific implementation, the sample needs to be deduplicated to ensure that there are no duplicate samples in the sample data set.
S203, based on the sample data set, a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function are constructed.
During specific implementation, a proxy model is established for the objective function to be optimized, and is recorded as a target proxy model, and a model file can be recorded as: sumo. Establishing an agent model for each constraint function, and recording the agent model as a constraint agent model, wherein model files are respectively as follows: restrant 1.sumo, restrant 2.sumo, and the like. The specific method for constructing the proxy model is determined by the type of the selected proxy model, and taking the kriging model as an example, the specific process for constructing the proxy model can refer to the paper "kriging model and proxy optimization algorithm research progress", and the specific construction method is the prior art and is not described any more.
S204, solving the target agent model by adopting a genetic algorithm to obtain an optimal solution of the target agent model under the constraint of the constraint agent model, wherein the optimal solution comprises optimal values of at least two design variables.
In specific implementation, a genetic algorithm can be adopted to call the target agent model to solve, the target minimum value is searched, and meanwhile, the constraint condition is considered. When there is constraint, different constraint proxy models are called to obtain the optimal solution x of the target proxy modeloptAnd the optimal solution x is obtainedoptInputting the target agent model to obtain the optimal target value (i.e. predicted value)
Figure BDA0003300140490000091
The process of solving the target agent model by adopting the genetic algorithm mainly comprises the following steps: initializing the first generation population S0Cross selection, mutation selection, cross breedingPerforming fork operation and mutation operation, generating a progeny population, finding out the optimal chromosome and the like. Specifically, the solving process comprises the following steps:
first, generating an initialization population S of design variables0Population S0Comprising a predetermined number of chromosomes, each chromosome comprising: a set of values for at least two design variables;
second, the population S is treatednPerforming mutation operation and crossover operation to obtain next generation population Sn+1Wherein the initial value of n is 0;
third, the slave population Sn+1Finding out the optimal chromosome;
fourthly, judging whether the genetic algorithm termination condition is met or not, if so, carrying out population Sn+1The optimal chromosome in (2) is used as the optimal solution of the target agent model, otherwise, the value of n is increased by 1 and the step (II) is returned.
In the second step described above, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining the variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding the corresponding variation disturbance value to each design variable of each chromosome to obtain the chromosome after variation.
Wherein n is a natural number, population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for at least two design variables. When n is 0, the target agent model and the constraint agent model used herein are the target agent model and the constraint agent model constructed by step S203; when n is>0, the target agent model and the constraint agent model used here are the target agent model and the constraint agent model obtained by step S207. The mutation perturbation value is a value added to an original chromosome when a chromosome is mutated so as to change the chromosome within a reasonable range. The dyeing can be calculated by adopting any one of the existing fitness functionsAnd (4) fitness corresponding to the body.
Specifically, the deviation degree of the fitness corresponding to each chromosome may be determined according to the maximum fitness, the minimum fitness and the fitness of each chromosome in the chromosomes; then, for each design variable in the chromosome, based on the value of the design variable in the chromosome, the upper limit value and the lower limit value of the value range corresponding to the design variable, and the deviation corresponding to the chromosome, the variation disturbance value corresponding to the design variable in the chromosome is determined.
In specific practice, fitkIs recorded as a population SnFitness of the kth chromosome of (1), fitminIs recorded as a population SnMinimum fitness of (1), fitmaxIs recorded as a population SnMaximum fitness of (1). For this purpose, step S2042 includes the steps of:
first, r and r are randomly selected from the range of (0,1)1The value of (a).
Then, the fit is judgedminWhether it is equal to fitmax(ii) a When fitmax≠fitminAccording to the formula
Figure BDA0003300140490000101
t1=t3And
Figure BDA0003300140490000102
obtaining a population SnDeviation t of fitness of the kth chromosome2(ii) a When fitmax=fitminThen, the population SnDeviation t of fitness of the kth chromosome2=r3
Then, r is determined1The size of (2): if r1Not less than 0.5, w corresponding to the ith design variable in the kth chromosomei=ui+(vi-ui)*(1-t2) Otherwise wi=ui-ui*(1-t2) Wherein u isi=ivalue-imin,vi=imax-imin,ivalueFor the value of the ith design variable, iminFor the lower limit of the value range of the ith design variable, imaxAnd the upper limit value of the value range of the ith design variable.
And finally, determining a variation disturbance value W according to the specific value of W: if wi<0, then the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei0; if 0 is less than or equal to wiV is less than or equal to v, then the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=wi(ii) a If wi>viThen the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=vi
Based on this, assume the population SnThe kth chromosome in (a)1,a2,a3,a4) A is obtained by the above steps1、a2、a3、a4Has a variation disturbance value of W1、W2、W3、W4Then the value after the chromosomal aberration is (a)1+W1,a2+W2,a3+W3,a4+W4)。
It should be noted that the embodiment of the present application mainly improves mutation operations in the genetic process, and other steps can be extended to processing modes in the existing genetic algorithm and are not described in detail.
S205, judging whether the simulation termination condition is met, if so, executing a step S208, otherwise, executing a step S206.
Wherein, the simulation termination condition comprises: and the error precision output by the agent model is smaller than a required value, or the iteration times reach an iteration time upper limit value.
In specific implementation, the currently obtained optimal solution x is usedoptInputting the existing commercial software (such as IDE) for calculating the target function to obtain the real response value of the target function, and recording as yopt. If yoptIf | is smaller than the preset threshold (e.g. 0.0001), the error precision of the proxy model output is
Figure BDA0003300140490000111
Otherwise the error precision of the proxy model output is
Figure BDA0003300140490000112
And S206, newly adding q samples in the sample data set.
The value of q may be set according to actual requirements, and is not limited here. The selection mode of the newly added sample can also be selected according to the actual requirement.
Specifically, an optimal solution x is selectedoptCorresponding to yoptUsing proxy models optimization. sumo, restaint 1.sumo, restaint 2.sumo … …, the expectation of the objective function improvement for any sample point x was calculated: e [ I (x)]When E [ I (x)]Sample point x at maximum timeeSample point xeSubstituting into IDE flow to complete calculation to obtain target value yeSample point xopt、yoptAnd sample point xe、yeAdding to the sample data set, if the optimization is to solve the maximum problem, then the sample point xopt、-yoptAnd sample point xe、-yeAdding to the sample data set.
In practical applications, the sample points may be added by using an MSP (mixed-valued sampling) adding method, or by using an EI (improvement expectation criterion) adding method.
The MSP criterion minimization proxy model prediction criterion is the simplest, most direct and earliest adopted method, and the principle is to directly find the optimal solution x of the target function on the proxy model and obtain the optimal solution x of the target function predicted on the proxy model. And performing accurate numerical simulation analysis on x, adding the result serving as new sample data into the existing sample data set, and reestablishing the proxy model until the whole optimization process converges.
The improvement expectation criterion is also called an Efficient Global Optimization (EGO) method, and is only suitable for the case that the agent model solves the minimum problem, so that when the above genetic algorithm optimizes the agent model, the minimum problem is searched.
By finding x corresponding to the maximum value of E [ I (x) ], the point to be added is determined. Namely:
Figure BDA0003300140490000121
wherein: selecting the minimum response value as y in establishing the sample point set of the agent model used in the current optimizationopt. The selection method comprises the following steps: when no constraint exists, the minimum value of the sample response value is selected as yopt. When there is a constraint, the minimum response value satisfying all the constraint conditions is selected as yopt(ii) a If there are no sample points satisfying all constraints, the minimum response value satisfying the most constraint condition is preferentially selected as yopt
Figure BDA0003300140490000124
The predicted value of the proxy model is obtained for any x, and s is the standard deviation of optimation.
MSE=s2(x)=σ2{1-rTR-1r+(1-FTR-1r)2/FTR-1F}
φ is the probability density of the standard normal distribution:
Figure BDA0003300140490000122
Φ is the distribution function of the standard normal distribution:
Figure BDA0003300140490000123
using optimization algorithm (here, genetic algorithm) to obtain E [ I (x) within x value range]Is given as the maximum value of (a) to obtain xe
If the optimization problem is handled with constraints as follows: it is known from the foregoing that each constraint has a corresponding proxy model, namely, respaint 1.sumo and respaint 2.sumo … …. Calculating the standard deviation by adopting the formula to obtain corresponding s1、s2、s3… … are provided. For any x, only for constraintsThe condition is that the proxy model of g (x) is less than or equal to 0, and the prediction values of the constraint obtained by calculating by adopting each constraint proxy model are g1、g2、g3… … are provided. Assuming a total of NcA constraint, such that the probability that any x satisfies the ith constraint is:
Figure BDA0003300140490000131
then, EI point addition with constraint is to use an optimization algorithm to solve the maximum value of the following formula in the value range of x to obtain xe
Figure BDA0003300140490000132
X obtainedeThe simulation calculation is completed (substituted into IDE flow) to obtain the result yeI.e. the above-mentioned steps 10 and 11, and x ise、yeAdding to the sample data set.
And S207, updating the target agent model and the constraint agent model based on the sample data set after the new sample is added, and returning to the step S204.
And S208, taking the optimal solution as an optimization result of the design variable and outputting the optimization result.
According to the engineering design optimization method based on the genetic algorithm and the agent model, when the agent model is optimized by using the genetic algorithm, a variation method in the genetic algorithm is improved, the diversity during variation of design variables is increased, local optimization is effectively skipped, and therefore the optimization efficiency and the optimization effect of the agent model are improved. The evolutionary algorithms such as the genetic algorithm are adopted for optimization, the general calculated amount needs thousands of times, and the optimization method combining the agent model and the genetic algorithm is adopted, and the calculated amount is generally hundreds of times, so that the method provided by the application can be used for engineering design optimization, the calculated amount of the traditional simulation optimization method can be reduced in magnitude while the design accuracy of global optimization is ensured, the optimization cycle of actual engineering design is greatly shortened, and a lot of design work which cannot be carried out becomes practical.
On the basis of any one of the above embodiments, in the process of solving the target agent model by using the genetic algorithm, the initialization population S of the design variables is generated in the following way0
Step one, randomly generating sample points, wherein the sample points comprise a group of values of at least two design variables;
step two, carrying out numerical analysis on the generated sample points and obtaining corresponding output values, and if the output values are real response values, adding the sample points as a chromosome to the initialized population S0Performing the following steps; if the output value is an abnormal value, deleting the sample point;
repeating the first step and the second step until the population S is initialized0The number of chromosomes in the cell reaches a preset number.
In specific implementation, the sample points can be input into the existing commercial software (such as IDE) to obtain corresponding real response values, if the sample points are unreasonable, the commercial software returns abnormal values, and unreasonable sample points need to be removed.
In order to ensure that filial generations obtained through crossing and mutation are still discrete items, a binary coding mode is adopted to code discrete variables in a chromosome, a relationship between the binary and problem design variable discrete items is established, and the discrete items are converted into gray codes on the basis of binary coding, so that the probability of jumping out of local optimum is increased. The continuous design variables in the chromosome can be expressed by adopting a real number coding mode, and the operation efficiency can be improved by adopting the real number coding mode. Therefore, the optimization simulation method based on the genetic algorithm supports the simulation optimization problem of the continuous design variables and the simulation optimization problem of the discrete design variables, and solves the discrete and continuous mixed problem.
Specifically, when randomly generating sample points, the values of discrete design variables in the sample points are determined as follows: randomly selecting a numerical value in the value range of the discrete design variable, converting the selected numerical value into a binary code, and converting the binary code into a Gray code. The conversion between the binary code and the gray code is not described in detail in the prior art.
For example, the design variables are from 0 to bi(i ═ 1,2,3 … n), and then a chromosome as a parent is combined. For example, the variable x1Get p at random3,x2Variable random q2If the corresponding gray codes are 011 and 01, respectively, the sequence of the parent individuals according to the design variables is { p }3,q2}。
For discrete design variables, each time a new chromosome is generated, there is a need for comparison with the already generated chromosomes, and no duplication of chromosomes can exist to ensure population diversity. Therefore, when genetic variation is performed on a chromosome including a discrete design variable, if a new chromosome obtained by the genetic variation is duplicated with a chromosome before the genetic variation, the genetic variation needs to be performed on the chromosome again. In specific implementation, whether to check the repeated chromosomes can be determined according to the solution space number and the population number, if the solution space number is more than 3 times of the population number, whether the repeated chromosomes exist needs to be checked, and otherwise, the repeated chromosomes do not need to be checked.
When performing the crossover operation on the chromosomes, the design variables in the chromosomes need to be subjected to the crossover operation one by one. For example, chromosome { p3,q2And chromosome { p }5,q1Is crossed, then p is added3And p5Cross over, q is2And q is1And crossing to obtain two new chromosomes. The process of interleaving the discrete design variables is as follows:
cross-over the first design variable in a chromosome (i.e., p)3And p5Cross), a location in the gray code is randomly selected, information behind the location is exchanged, and the location cannot be the last bit when attention is needed. For example, the design variable p3Is 011, design variable p5Is 110, the selected position is the second bit, p is swapped3Third bit of (a) and p5Third bit, the new variables produced by the crossover are: 111, and 010, where 111 is out of the design variable range, it needs to be dropped and the crossover operation is performed again. Cross-over (q) the second design variable in the chromosome2And q is1Crossover), the crossover process is as described above.
The variation process for discrete design variables is as follows: randomly selecting a position in Gray codes of the discrete design variables, wherein the position is changed into 1 if the position is 0, and is changed into 0 if the position is 1.
And if the new variable exceeds the value range, discarding the new variable and re-executing the crossover operation or mutation operation.
On the basis of any of the above embodiments, the termination condition of the genetic algorithm may include: in the process of solving the target agent model by adopting the genetic algorithm, the absolute value b is less than the threshold b for p times continuouslythWherein the absolute value b is the population Sn+1Average fitness and population S ofnThe absolute value of the difference between the average fitness of (2).
For this purpose, the population S is usednObtaining next generation population Sn+1Thereafter, the population S is calculatedn+1Fitness of each chromosome in the population S is obtainedn+1Average fitness of (2); calculating population Sn+1Average fitness and population S ofnThe absolute value b of the difference between the average fitness values of (a); if the absolute values b obtained in the genetic process of the successive p generations are all less than the threshold value bthTerminating the genetic algorithm and connecting the population Sn+1The optimal chromosome in (1) is used as the optimal solution of the target agent model, otherwise, the process is continued based on the population Sn+1And (4) carrying out heredity.
The termination condition of the genetic algorithm may further include: the inheritance frequency reaches a preset frequency. If the absolute values b obtained in the genetic process of the successive p generations are all less than the threshold value bthOr when the genetic times reach the preset times, terminating the genetic algorithm and enabling the population S to be the samen+1The optimal chromosome in (1) is used as the optimal solution of the target agent model, otherwise, the process is continued based on the population Sn+1And (4) carrying out heredity.
Wherein, p, bthThe value of the preset times can be determined according to application requirements and by combining experience, and the embodiment of the application is not limited. For example, in some application scenarios, the fetching of pA value of 5, bthThe value of (a) is 0.00001, and the value of the preset times is 1500.
By optimizing the convergence judgment standard (namely the termination condition of the genetic algorithm) of the genetic algorithm in the modeling process, the automatic judgment of convergence can be realized, the circulation can be stopped in time, and the time spent on invalid calculation is reduced, so that the modeling efficiency is optimized and improved. For example, the number of calculation iterations is set to 500, 500 loops are needed, and the optimal solution is stopped and output, whereas with the automatic determination convergence method provided in the present application, it is possible to meet the stop condition after 100 calculations, end the calculation and output the calculation result, and 400 invalid calculations can be reduced.
On the basis of any of the above embodiments, step S207 specifically includes: and for each agent model, if the agent model meets the preset condition corresponding to the incremental method, updating model parameters of the agent model based on the newly added q samples, and otherwise, reconstructing the agent model based on the sample data set after the newly added samples. Wherein the agent model comprises a target agent model and a constraint agent model.
Before each round of model iteration is started, an appropriate method is selected to update the proxy model according to the updating condition of the previous proxy model, when an increment method is selected, parameters of the proxy model are updated only on the basis of q newly added samples, the proxy model does not need to be reconstructed, the calculated amount can be greatly reduced on the premise of ensuring the precision of the proxy model, and the processing efficiency is improved; when the reconstruction method is selected, the proxy model can be reconstructed based on all samples in the sample data set, and the output precision of the proxy model is ensured. When the internal matrix scale of the proxy model is large, the reconstruction of the model takes hours or even more than ten hours, and the model updating time by adopting the incremental method only needs seconds, so that the calculation amount of the traditional simulation optimization method is reduced in magnitude while the design accuracy of global optimization is ensured, the optimization period of actual engineering design is greatly shortened, and a lot of design work which cannot be carried out becomes practical.
The reconstruction method in the embodiment of the application refers to: and training the proxy model based on all samples in the sample data set by means of maximum likelihood estimation or cross validation and the like to obtain the optimal model parameters corresponding to the proxy model. The specific implementation manner of the reconstruction method is similar to that in step S203, taking kriging as an example, reconstructing the proxy model, that is, finding the model parameter θ that maximizes L, and the specific process is the prior art and is not described again.
The incremental method in the embodiment of the application refers to: and on the basis of the existing agent model, the model parameter theta is unchanged, and q newly added samples are used for updating the model. Specifically, taking the kriging model as an example, the process of updating the proxy model by the incremental method mainly includes: calculating mathematical expected value beta related to model parameters of proxy model based on newly added q samples0Increment of (a) based on0Determining the updated model parameters theta' of the proxy model according to the increment and the existing model parameters theta of the proxy model.
Taking the kriging model as an example, the principle of the incremental method is as follows:
cholesky decomposition of the matrix R:
R=LLT
let F' be L-1F,ys'=L-1ysWherein F and ysSee proxy model component algorithm definition, L is a lower triangular matrix of n x n.
Carrying out QR decomposition on F': f' ═ QGTWhere Q is a column vector of n x 1, GTIf real, then: gTβ0=QTys', can give beta0
Figure BDA0003300140490000171
Where | | | | is the norm (square root) of the solution, then squared.
In each iteration process in the agent model optimization, the newly added sample point matrix is x(n1),x(n2)...x(nh)Wherein
Figure BDA0003300140490000172
m is the number of design variables. The calculated result of the sample point correspondence is y(n1),y(n2)...y(nh)Finishing, in orderAs a matrix: Δ ys=[y(n1),y(n2)…y(nh)]T. At this time, the matrix R in the proxy model operation is:
Figure BDA0003300140490000173
wherein the content of the first and second substances,
Figure BDA0003300140490000174
for the R matrix in the mechanism model of the previous iteration, the R matrix is marked as R0
Reissue to order
Figure BDA0003300140490000175
Figure BDA0003300140490000181
Then it is determined that,
Figure BDA0003300140490000182
performing Cholesky decomposition on R:
Figure BDA0003300140490000183
order to
Figure BDA0003300140490000184
Then there are:
Figure BDA0003300140490000185
(namely, to
Figure BDA0003300140490000186
Cholesky decomposition to obtain L3) Then, there are:
Figure BDA0003300140490000187
real response value y of sample used in previous iterations=ys0Y 'obtained from last iteration's=y's0F ' ═ F ' obtained in the previous iteration '0Corresponding QR is decomposed into
Figure BDA0003300140490000188
Then:
of the same wheel
Figure BDA0003300140490000189
Wherein:
Figure BDA00033001404900001810
Δysis the real response value vector of the newly added sample point.
Of the same wheel
Figure BDA00033001404900001811
Wherein:
Figure BDA00033001404900001812
F0=[1,1...1]T,F0n is 1; Δ F ═ 1,1.. 1]TΔ F has h 1 s.
QR decomposition is carried out on the delta F':
Figure BDA00033001404900001813
Figure BDA00033001404900001814
it is known that Δ Q is obtained
Then is formed by
Figure BDA00033001404900001816
To obtain beta0Increment of (a) delta beta0
Therefore:
beta of this wheel0Beta as the last round0+Δβ0
Of the same wheel
Figure BDA00033001404900001815
Y 'of the same wheel'sF' of the wheel and beta of the wheel0||2
Beta based on this wheel0And σ2The updated model parameter theta can be calculated, and the concrete calculation formula refers to the study progress of the kriging model and the proxy optimization algorithm.
In a possible implementation manner, the preset condition corresponding to the incremental method may be: the number proportion of the samples which do not participate in the reconstruction agent model in the sample data set is not less than the proportion requirement.
For example, the preset conditions corresponding to the incremental method may be: a first number MBAnd a second number MAIs smaller than the preset value U. Wherein the first number MBThe number of samples which do not participate in the reconstruction of the proxy model in the sample data set is determined; a second number MAAnd (4) the number of samples participating in the reconstruction of the proxy model in the sample data set, namely the number of samples used when the proxy model is established by using the reconstruction method at the last time.
Suppose that the proxy model optimizes to add 2 samples in each loop, the number of samples in the initial sample data set is 10, and U is 0.25.
A first round: constructing a proxy model by using a reconstruction method based on 10 samples in the initial sample data set, wherein M is the timeA10. After the first round is finished, 2 samples are added in the sample data set.
And a second round: in the sample data set, if 10 samples participating in the reconstruction method and 2 samples not participating in the reconstruction method are present, M isA=10,MB2, so MB/MA=0.2<U, so the second round updates the proxy model using the incremental method. And after the second round is finished, adding 2 samples in the sample data set.
And a third round: since the reconstruction method is only used in the first round, 10 samples already participating in the reconstruction method in the sample data set at this time are obtained, and none of the newly added 4 samples participate in the reconstruction of the proxy model at the end of the first round and the second round, then M is obtainedA=10,MB4, thus MB/MA=0.4>U, so the third round updates the proxy model using the reconstruction method, at which time 14 samples in the sample data set all participate in the reconstruction method. And after the third round is finished, adding 2 samples in the sample data set.
Fourth wheel: the third round was where 14 samples participated in the reconstruction method, then MA14, the newly added 2 samples after the third round are not involved in the reconstruction method, then MB2, so MB/MA=2/14<U, so the fourth round updates the proxy model using the incremental method. And after the fourth round is finished, adding 2 samples in the sample data set. And the rest can be done in the same way until the simulation termination condition is met.
In another possible implementation, the preset condition corresponding to the incremental method may be: the output error of the proxy model constructed in the previous round is smaller than the error requirement.
For example, the preset conditions corresponding to the incremental method may be: u. ofsumoi≤uTHWherein, in the step (A),
Figure BDA0003300140490000191
uTHis a preset threshold value, yiFor the true response value obtained based on the newly added sample,
Figure BDA0003300140490000192
for obtaining a prediction value s after inputting a newly added sample into the proxy modelsumoiThe mean square error of the proxy model is calculated based on the newly added samples. Wherein u isTHThe value of (a) can be determined according to actual requirements in combination with experience, e.g. uTHThe value of (A) can be 3,5, etc. In practical application, the newly added sample can be input into the existing commercial software (such as IDE) for calculating the objective function, so as to obtain the true response value y of the objective functioni
Adding a new sample after each iteration is finished, and calculating the output error of the proxy model (comprising a target proxy model and a constraint proxy model) for each proxy model obtained in the current iteration before starting the next iteration:
Figure BDA0003300140490000201
if u issumoi≤uTHAnd updating the model parameters of the proxy model by adopting an incremental method, otherwise, reconstructing the proxy model by adopting a reconstruction method.
E.g. uTHIs 3. The parameter of the last round of target agent model f is beta1And σ1The parameter of the constraint proxy model g is beta2And σ2The parameter of the constraint proxy model h is beta3And σ3. After 2 samples are added, before the next iteration, the output error of the target agent model f on the first newly added sample is calculated to be u1 sample 1The output error on the second new sample is u 21 sample 21.8, both output errors are less than 3, so the target agent model is updated by adopting an incremental method; calculating the output error of the constraint proxy model g on the first newly added sample as u2 sample 1The output error on the second new sample is u, 42 sample 2When the output error is larger than 3, a new constraint proxy model g is established by adopting a reconstruction method; calculating the output error of the constraint proxy model h on the first newly added sample as u3 sample 1The output error on the second new sample is u, 63 sample 2And 6, both output errors are larger than 3, so a new constraint proxy model h is established by adopting a reconstruction method.
Providing two choices of a reconstruction method and an incremental method when the proxy model is reconstructed each time, and judging whether preset conditions corresponding to the incremental method are met or not based on relevant data of the proxy model constructed in the previous round; if the preset conditions are met, updating the proxy model by adopting an incremental method, namely updating the model parameters of the proxy model only based on the newly added samples without reconstructing the proxy model; and if the preset condition is not met, reconstructing the proxy model based on all samples in the sample data set after the new sample is added. Wherein, the preset condition may be: and the output error of the proxy model constructed in the previous round is smaller than the error requirement, or the number proportion of the samples which do not participate in reconstructing the proxy model in the sample data set is not smaller than the proportion requirement. Therefore, under the condition that the output error of the proxy model is small or the sample ratio not participating in the reconstruction of the proxy model is small, the model parameters of the proxy model are updated by selecting an incremental method, so that the calculated amount can be greatly reduced and the processing efficiency can be improved on the premise of ensuring the precision of the proxy model; and under the condition that the output error of the proxy model is larger or the sample ratio not participating in reconstructing the proxy model is larger, reconstructing the proxy model based on all samples in the sample data set, and ensuring the output precision of the proxy model.
On the basis of any of the above embodiments, referring to fig. 3, step S202 includes the following steps:
s301, dividing the value range corresponding to each design variable into a intervals, randomly taking a numerical value from each interval of each design variable, and further obtaining a sample point set containing a sample points, wherein each sample point comprises a group of values of at least two design variables.
For example, the design variables include a1、a2And a3And the number of the sample points is 10, a is1Is divided into 10 intervals, and a numerical value is taken from each interval to obtain a1,1、a1,2……a1,10Obtaining a by the same method210 values of a2,1、a2,2……a2,10And a310 values of a3,1、a3,2……a3,10Then a is added1、a2And a3The 10 values are randomly combined to obtain 10 sample points.
S302, aiming at any sample point in the sample point set, carrying out numerical analysis on the sample point and obtaining a corresponding output value, if the output value is a real response value, adding the sample point and the corresponding real response value into the sample data set as a sample, deleting the sample point in the sample point set, and if the output value is an abnormal value, deleting the sample point.
In specific implementation, the sample points can be input into the existing commercial software (such as IDE) to obtain corresponding real response values, if the sample points are unreasonable, the commercial software returns abnormal values, and unreasonable sample points need to be removed.
S303, judging whether the number b of the samples in the sample data set is equal to a, if so, executing the step S203, otherwise, executing the step S304.
S304, dividing the value range corresponding to each design variable into (a-b) intervals, randomly taking a numerical value from each interval of each design variable, further obtaining (a-b) sample points, adding the sample points into a sample point set, and executing the step S305.
S305, aiming at any sample point in the sample point set, carrying out numerical analysis on the any sample point and obtaining a corresponding output value, if the output value is a real response value, adding the any sample point and the corresponding real response value into the sample data set as a sample, deleting any sample point in the sample point set, and if the output value is an abnormal value, deleting any sample point.
S306, carrying out duplicate removal processing on the samples in the sample data set, and returning to the step S303.
When the sample points are reselected, the space domain is newly divided, and the diversity of the selected sample points is ensured.
As shown in fig. 4, based on the same inventive concept as the above engineering design optimization method based on the genetic algorithm and the proxy model, the embodiment of the present application further provides an engineering design optimization apparatus 40 based on the genetic algorithm and the proxy model, including:
an input module 401, configured to obtain input parameters required for engineering design optimization, where the input parameters include: at least two design variables to be optimized, and an objective function and a constraint function for the design variables;
an initial sample generating module 402, configured to generate a sample data set, where each sample in the sample data set includes: a set of values of the at least two design variables, and true response values of the objective function and the constraint function obtained based on the set of values;
an initial model building module 403, configured to build, based on the sample data set, a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function;
an optimization module 404, configured to solve the target agent model by using a genetic algorithm to obtain an optimal solution of the target agent model under the constraint of the constraint agent model, where the optimal solution includes optimal values of the at least two design variables; wherein, in the population S for each generationnInheritance is performed to obtain a next generation population Sn+1Then, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining a variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding a corresponding variation disturbance value to each design variable of each chromosome to obtain a chromosome after variation; wherein, the population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for the at least two design variables;
a simulation termination judging module 405, configured to judge whether a simulation termination condition is met, if yes, execute the function of the output module 408, and otherwise execute the function of the newly added sample module 406;
a sample adding module 406, configured to add q samples in the sample data set;
a model updating module 407, configured to update the target agent model and the constraint agent model based on the sample data set after the new sample is added, and return to execute the function of the optimizing module 404;
and the output module 408 is configured to output the optimal solution as an optimization result of the design variable.
In a possible implementation, the optimization module 404 is specifically configured to:
when fitmax≠fitminAccording to the formula
Figure BDA0003300140490000231
t1=t3And t2=rt1Obtaining a population SnDeviation t of fitness of the kth chromosome2Therein, fitkAs a population SnFitness of the kth chromosome of (1), fitminAs a population SnMinimum fitness of (1), fitmaxAs a population SnMaximum fitness of (1);
if r1Not less than 0.5, w corresponding to the ith design variable in the kth chromosomei=ui+(vi-ui)*(1-t2) Otherwise wi=ui-ui*(1-t2) Wherein u isi=ivalue-imin,vi=imax-imin,ivalueFor the value of the ith design variable, iminFor the lower limit of the value range of the ith design variable, imaxUpper limit value of value range r and r for ith design variable1Is a random number in (0, 1);
if wi<0, then the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=0;
If 0 is less than or equal to wiV is less than or equal to v, then the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=wi
If wi>viThen the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=vi
In one possible embodiment, when fitmax=fitminThen, the population SnDeviation t of the kth chromosome in2=r3
In a possible implementation, the optimization module 404 is further configured to: based on the population SnObtaining next generation population Sn+1Thereafter, the population S is calculatedn+1Fitness of each chromosome in the population S is obtainedn+1Average fitness of (2); calculating population Sn+1Average fitness and population S ofnAbsolute difference of average fitness ofFor the value b; if the absolute values b obtained in the genetic process of the successive p generations are all less than the threshold value bthTerminating the genetic algorithm and connecting the population Sn+1The optimal chromosome in (1) is used as the optimal solution of the target agent model, otherwise, the process is continued based on the population Sn+1And (4) carrying out heredity.
In a possible embodiment, the optimization module 404 is further configured to generate an initialization population S of design variables by0
Randomly generating sample points, wherein the sample points comprise a group of values of the at least two design variables;
step two, carrying out numerical analysis on the sample points and obtaining corresponding output values, and if the output values are real response values, adding the sample points as a chromosome to the initialized population S0If the output value is an abnormal value, deleting the sample point;
repeating the first step and the second step until the initialization population S0Up to said preset number.
In a possible implementation, the optimization module 404 is further configured to determine, when the sample points are randomly generated, values of discrete design variables in the sample points by: randomly selecting a numerical value in the value range of the discrete design variable, converting the selected numerical value into a binary code, and converting the binary code into a Gray code.
In a possible embodiment, the optimization module 404 is further configured to, when a genetic variation is performed on a chromosome containing a discrete design variable, if a new chromosome obtained by the genetic variation is duplicated with a chromosome before the genetic variation, perform the genetic variation on the chromosome again.
In a possible implementation manner, the model updating module 407 is specifically configured to update, for each proxy model, model parameters of the proxy model based on q newly added samples if the proxy model meets a preset condition corresponding to an incremental method, and return to execute the function of the optimizing module 404, otherwise, reconstruct the proxy model based on a sample data set after the newly added samples, and return to execute the function of the optimizing module 404; wherein the agent model comprises the target agent model and the constraint agent model;
in a possible implementation manner, the model updating module 407 is specifically configured to: calculating a mathematical expected value beta related to the model parameters of the proxy model based on the newly added q samples for each proxy model0Increment of (a) based on0Determining the updated model parameter theta' of the proxy model by the increment and the existing model parameter theta of the proxy model; wherein the agent model comprises the target agent model and the constraint agent model.
In a possible implementation manner, the preset conditions corresponding to the incremental method are as follows: the ratio of a first quantity to a second quantity is smaller than a preset value, wherein the first quantity is the quantity of samples which do not participate in the reconstruction of the proxy model in the sample data set, and the second quantity is the quantity of samples which participate in the reconstruction of the proxy model in the sample data set.
In a possible implementation manner, the preset conditions corresponding to the incremental method are as follows: u. ofsumoi≤uTHWherein, in the step (A),
Figure BDA0003300140490000251
uTHis a preset threshold value, yiFor the true response value obtained based on the newly added sample,
Figure BDA0003300140490000252
for obtaining a prediction value s after inputting a newly added sample into the proxy modelsumoiThe mean square error of the proxy model is calculated based on the newly added samples.
In a possible implementation manner, the initial sample generating module 402 is specifically configured to:
s301, dividing a value range corresponding to each design variable into a intervals, randomly taking a numerical value from each interval of each design variable, and further obtaining a sample point set containing a sample points, wherein each sample point comprises a group of values of the at least two design variables;
s302, performing numerical analysis on any sample point in the sample point set and obtaining a corresponding output value, if the output value is a real response value, adding the sample point and the corresponding real response value into the sample point set as a sample, deleting the sample point in the sample point set, and if the output value is an abnormal value, deleting the sample point;
s303, judging whether the number b of the samples in the sample data set is equal to a, if so, executing a step S203, otherwise, executing a step S304;
s304, dividing the value range corresponding to each design variable into (a-b) intervals, randomly taking a numerical value from each interval of each design variable, further obtaining (a-b) sample points, adding the sample points into the sample point set, and executing the step S305;
s305, carrying out numerical analysis on any sample point in the sample point set and obtaining a corresponding output value, if the output value is a real response value, adding the sample point and the corresponding real response value into the sample data set as a sample, deleting the sample point in the sample point set, and if the output value is an abnormal value, deleting the sample point;
s306, carrying out duplicate removal processing on the samples in the sample data set, and returning to the step S303.
The engineering design optimization device based on the genetic algorithm and the proxy model and the engineering design optimization method based on the genetic algorithm and the proxy model adopt the same inventive concept, can obtain the same beneficial effects, and are not repeated herein.
Based on the same inventive concept as the engineering design optimization method based on the genetic algorithm and the agent model, the embodiment of the present application further provides an electronic device, which may be specifically (a control device or a control system inside the intelligent device, or an external device communicating with the intelligent device, for example) a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), a server, and the like. As shown in fig. 5, the electronic device 50 may include a processor 501 and a memory 502.
The Processor 501 may be a general-purpose Processor, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component, which may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present Application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
Memory 502, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charged Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 502 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; the computer storage media may be any available media or data storage device that can be accessed by a computer, including but not limited to: various media that can store program codes include a removable Memory device, a Random Access Memory (RAM), a magnetic Memory (e.g., a flexible disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical Memory (e.g., a CD, a DVD, a BD, an HVD, etc.), and a semiconductor Memory (e.g., a ROM, an EPROM, an EEPROM, a nonvolatile Memory (NAND FLASH), a Solid State Disk (SSD)).
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media that can store program codes include a removable Memory device, a Random Access Memory (RAM), a magnetic Memory (e.g., a flexible disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical Memory (e.g., a CD, a DVD, a BD, an HVD, etc.), and a semiconductor Memory (e.g., a ROM, an EPROM, an EEPROM, a nonvolatile Memory (NAND FLASH), a Solid State Disk (SSD)).
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An engineering design optimization method based on genetic algorithm and agent model is characterized by comprising the following steps:
s201, obtaining input parameters required by engineering design optimization, wherein the input parameters comprise: at least two design variables to be optimized, and an objective function and a constraint function for the design variables;
s202, generating a sample data set, wherein each sample in the sample data set comprises: a set of values of the at least two design variables, and true response values of the objective function and the constraint function obtained based on the set of values;
s203, constructing a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function based on the sample data set;
s204, solving the target agent model by adopting a genetic algorithm to obtain an optimal solution of the target agent model under the constraint of the constraint agent model, wherein the optimal solution comprises optimal values of the at least two design variables; wherein, in the population S for each generationnInheritance is performed to obtain a next generation population Sn+1Then, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining a variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding a corresponding variation disturbance value to each design variable of each chromosome to obtain a chromosome after variation; wherein, the population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for the at least two design variables;
s205, judging whether a simulation termination condition is met, if so, executing a step S208, otherwise, executing a step S206;
s206, newly adding q samples in the sample data set;
s207, updating the target agent model and the constraint agent model based on the sample data set after the new sample is added, and returning to the step S204;
and S208, taking the optimal solution as an optimization result of the design variable and outputting the optimization result.
2. The method of claim 1, wherein determining the variant perturbation value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome comprises:
when fitmax≠fitminAccording to the formula
Figure FDA0003300140480000021
t1=t3And
Figure FDA0003300140480000022
obtaining a population SnDeviation t of fitness of the kth chromosome2Therein, fitkAs a population SnFitness of the kth chromosome of (1), fitminAs a population SnMinimum fitness of (1), fitmaxAs a population SnMaximum fitness of (1);
if r1Not less than 0.5, w corresponding to the ith design variable in the kth chromosomei=ui+(vi-ui)*(1-t2) Otherwise wi=ui-ui*(1-t2) Wherein u isi=ivalue-imin,vi=imax-imin,ivalueFor the value of the ith design variable, iminFor the lower limit of the value range of the ith design variable, imaxUpper limit value of value range r and r for ith design variable1Is a random number in (0, 1);
if wi<0, then the population SnMutation of the ith design variable of the kth chromosomeDynamic value Wi=0;
If 0 is less than or equal to wiV is less than or equal to v, then the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=wi
If wi>viThen the population SnThe variation perturbation value W of the ith design variable of the kth chromosomei=vi
3. The method of claim 2, wherein when fitmax=fitminThen, the population SnDeviation t of the kth chromosome in2=r3
4. The method of claim 2, wherein the method is based on population SnObtaining next generation population Sn+1Thereafter, the method further comprises:
calculating population Sn+1Fitness of each chromosome in the population S is obtainedn+1Average fitness of (2);
calculating population Sn+1Average fitness and population S ofnThe absolute value b of the difference between the average fitness values of (a);
if the absolute values b obtained in the genetic process of the successive p generations are all less than the threshold value bthTerminating the genetic algorithm and connecting the population Sn+1The optimal chromosome in (1) is used as the optimal solution of the target agent model, otherwise, the process is continued based on the population Sn+1And (4) carrying out heredity.
5. Method according to any one of claims 1 to 4, characterized in that the initialisation population S of design variables is generated by0
Randomly generating sample points, wherein the sample points comprise a group of values of the at least two design variables;
step two, carrying out numerical analysis on the sample points and obtaining corresponding output values, and if the output values are real response values, adding the sample points as a chromosome to the initialized population S0If the output value is an abnormal value, deleting the sample point;
repeating the first step and the second step until the initialization population S0Up to said preset number.
6. The method of claim 5, wherein, when randomly generating sample points, the values of discrete design variables in the sample points are determined by:
randomly selecting a numerical value in the value range of the discrete design variable, converting the selected numerical value into a binary code, and converting the binary code into a Gray code.
7. The method of claim 6, further comprising:
when genetic variation is performed on a chromosome including a discrete design variable, if a new chromosome obtained by the genetic variation is duplicated with a chromosome before the genetic variation, the genetic variation is performed on the chromosome again.
8. An engineering design optimization device based on genetic algorithm and agent model, comprising:
an input module, configured to obtain input parameters required for engineering design optimization, where the input parameters include: at least two design variables to be optimized, and an objective function and a constraint function for the design variables;
an initial sample generation module, configured to generate a sample data set, where each sample in the sample data set includes: a set of values of the at least two design variables, and true response values of the objective function and the constraint function obtained based on the set of values;
the initial model building module is used for building a target agent model corresponding to the target function and a constraint agent model corresponding to the constraint function based on the sample data set;
an optimization module for solving the target agent model by using a genetic algorithm,obtaining an optimal solution of the target agent model under the constraint of the constraint agent model, wherein the optimal solution comprises optimal values of the at least two design variables; wherein, in the population S for each generationnInheritance is performed to obtain a next generation population Sn+1Then, the population S is treated in the following mannernPerforming mutation operations on each chromosome: obtaining a population SnDetermining the maximum fitness and the minimum fitness from the obtained fitness, determining a variation disturbance value corresponding to each design variable in each chromosome according to the maximum fitness, the minimum fitness, the fitness of each chromosome and the value of each design variable in each chromosome, and adding a corresponding variation disturbance value to each design variable of each chromosome to obtain a chromosome after variation; wherein, the population SnComprising a predetermined number of chromosomes, each chromosome comprising: a set of values for the at least two design variables;
the simulation termination judging module is used for judging whether the simulation termination condition is met, if so, executing the function of the output module, and otherwise, executing the function of the newly added sample module;
a new sample adding module for adding q samples in the sample data set;
the model updating module is used for updating the target agent model and the constraint agent model based on a sample data set after a sample is newly added and returning to execute the function of the optimizing module;
and the output module is used for taking the optimal solution as an optimization result of the design variable and outputting the optimization result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method of any one of claims 1 to 7.
CN202111188161.4A 2021-10-12 2021-10-12 Engineering design optimization method and device based on genetic algorithm and agent model Pending CN113935235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111188161.4A CN113935235A (en) 2021-10-12 2021-10-12 Engineering design optimization method and device based on genetic algorithm and agent model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111188161.4A CN113935235A (en) 2021-10-12 2021-10-12 Engineering design optimization method and device based on genetic algorithm and agent model

Publications (1)

Publication Number Publication Date
CN113935235A true CN113935235A (en) 2022-01-14

Family

ID=79278547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111188161.4A Pending CN113935235A (en) 2021-10-12 2021-10-12 Engineering design optimization method and device based on genetic algorithm and agent model

Country Status (1)

Country Link
CN (1) CN113935235A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115130322A (en) * 2022-07-22 2022-09-30 中国原子能科学研究院 Optimization method and optimization device of beam shaping device
CN116738639A (en) * 2023-07-24 2023-09-12 哈尔滨工程大学 Loop heat pipe radiation radiating fin structure optimization design method and device
CN116776600A (en) * 2023-06-21 2023-09-19 安徽工业大学 Wind turbine blade optimal design method and system based on self-adaptive proxy model

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115130322A (en) * 2022-07-22 2022-09-30 中国原子能科学研究院 Optimization method and optimization device of beam shaping device
CN115130322B (en) * 2022-07-22 2023-11-03 中国原子能科学研究院 Optimization method and optimization device of beam shaping device
CN116776600A (en) * 2023-06-21 2023-09-19 安徽工业大学 Wind turbine blade optimal design method and system based on self-adaptive proxy model
CN116776600B (en) * 2023-06-21 2024-04-12 安徽工业大学 Wind turbine blade optimal design method and system based on self-adaptive proxy model
CN116738639A (en) * 2023-07-24 2023-09-12 哈尔滨工程大学 Loop heat pipe radiation radiating fin structure optimization design method and device

Similar Documents

Publication Publication Date Title
CN112651509B (en) Method and device for determining quantum circuit
CN113935235A (en) Engineering design optimization method and device based on genetic algorithm and agent model
CN113821983B (en) Engineering design optimization method and device based on proxy model and electronic equipment
CN111465944A (en) Graphical neural network system for generating a structured representation of an object
CN113159239B (en) Method for processing graph data by quantum graph convolutional neural network
Chen et al. Scenario tree reduction methods through clustering nodes
KR20220051132A (en) Quantum circuit determination method and apparatus, device, and storage medium
Oh et al. Distributional reinforcement learning with the independent learners for flexible job shop scheduling problem with high variability
Colmenar et al. Automatic generation of models for energy demand estimation using Grammatical Evolution
CN114817571B (en) Dynamic knowledge graph-based achievement quoted quantity prediction method, medium and equipment
CN115593264B (en) Charging optimization control method and device based on edge calculation and computer equipment
Egelé et al. Asynchronous decentralized bayesian optimization for large scale hyperparameter optimization
Luo et al. Sampling-based adaptive bounding evolutionary algorithm for continuous optimization problems
CN114722490A (en) Agent model global optimization method based on mixed increase and interval reduction
Chang et al. A survey of some simulation-based algorithms for Markov decision processes
CN113220437B (en) Workflow multi-target scheduling method and device
CN111027709B (en) Information recommendation method and device, server and storage medium
Ni et al. Policy iteration for bounded-parameter POMDPs
CN113128771A (en) Expensive function optimization method and device for parallel differential evolution algorithm
CN112949154A (en) Parallel asynchronous particle swarm optimization method and system and electronic equipment
CN112214718A (en) Method for solving bounded knapsack problem based on improved dynamic programming algorithm
Cordeiro et al. Multi-objective optimization applied to unified second level cache memory hierarchy tuning aiming at energy and performance optimization
Ma et al. A new parallel framework algorithm for solving large-scale DEA models
Jun et al. An improved dynamic structure-based neural networks determination approaches to simulation optimization problems
Li et al. Surrogate-Assisted Evolution of Convolutional Neural Networks by Collaboratively Optimizing the Basic Blocks and Topologies

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination