Phononic crystal topological optimization method, system and equipment based on improved genetic algorithm and medium
By introducing the method of introducing hash tables in the optimization of Shengzi Crystal Top, combined with the combined simulation of Matlab and COMSOL, the problem of low optimization efficiency and large calculation in the existing technologies achieved more efficient sound -crystal topological optimization.
Patent Information
- Application Number
- CN202411552407.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-01
Smart Images

Figure CN119358345A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of phononic crystal topology optimization, and relates to a phononic crystal topology optimization method, system, equipment and medium based on an improved genetic algorithm. Background Art
[0002] Phononic crystals are a periodic medium with elastic wave band gaps, and have broad application prospects in the field of vibration and noise reduction. The key property of phononic crystals is the band gap characteristic. Within the band gap range, the propagation of vibration and noise is limited by phononic crystals, thereby achieving the effect of vibration and noise reduction. The band gap of phononic crystals is related to its geometric parameters and material properties. In engineering practice, it is often necessary to design the corresponding phononic crystal structure according to the frequency band where vibration or noise is concentrated, which requires the use of phononic crystal topology optimization methods. The phononic crystal topology optimization method takes the optimization target as input and automatically designs the phononic crystal topology structure that meets the optimization target.
[0003] In the prior art, phononic crystal topology optimization methods based on genetic algorithms and finite element methods have problems such as large solution space and relatively low optimization efficiency. In order to improve the resolution of the phononic crystal topological structure, it is often necessary to discretize the phononic crystal structure to a sufficiently small size, greatly increasing the size of the solution space; at the same time, the finite element method takes a lot of time to solve the phononic crystal band gap, especially when faced with complex phononic crystal design problems. The algorithm may need to calculate the band gaps of thousands of phononic crystals before converging to a satisfactory solution, which to a certain extent limits the application of genetic algorithms in the field of phononic crystal optimization. Contents of the invention In view of the problems existing in the prior art, the present invention proposes a phononic crystal topology optimization method and system based on an improved genetic algorithm. The method is implemented through joint simulation of MATLAB and COMSOL. The phononic crystal structure is optimized by genetic algorithm in MATLAB, and the band gap of the phononic crystal is calculated by finite element method in COMSOL. The amount of finite element calculation is greatly reduced by introducing a hash table, thereby improving the optimization efficiency. The method can optimize the phononic crystal topology structure that meets the engineering requirements in a relatively short time according to the needs of the optimization target, and has a higher optimization efficiency than the traditional phononic crystal topology optimization method based on genetic algorithm.
[0004] The present invention is achieved through the following technical solutions: A phononic crystal topology optimization method based on an improved genetic algorithm, comprising: Establish a finite element model of the phononic crystal and import it into the genetic algorithm, establish a hash table to store the calculated phononic crystal band gap information, and obtain genetic parameters; Initialize the population based on genetic parameters to obtain the initial population; The band gaps of the phononic crystals corresponding to all individuals in the current population are calculated based on the initial population, the finite element model of the phononic crystal and the hash table storing the calculated band gap information of the phononic crystal, and the band gap information is stored in the hash table; For all generations except the first generation of the initial population in the hash table, elite retention is performed and iterative optimization is performed to select the optimal phononic crystal structure and its band gap characteristics to achieve topological optimization of the phononic crystal.
[0005] Preferably, the finite element model of the phononic crystal is introduced into the genetic algorithm, and the specific process is: The overall structure of the phononic crystal to be optimized is drawn in COMSOL and discretized into several grids. The material properties of the phononic crystal material are written into the finite element model. Floquet periodic conditions are applied to the opposite sides of the phononic crystal, and the grids are divided to obtain the finite element model of the phononic crystal. The connection between COMSOL and MATLAB was established through COMSOL LiveLink for MATLAB, the finite element model of the phononic crystal was written into the variables of the genetic algorithm, and the COMSOL simulation process was controlled through instructions in MATLAB.
[0006] Preferably, the specific process of establishing a hash table for storing the calculated phononic crystal band gap information is as follows: In MATLAB, a hash table is established through dictionary or containers.Map mapping container, where the key of the hash table is the character code corresponding to the band gap of the current phononic crystal, and the value of the hash table is the fitness of the phononic crystal.
[0007] Preferably, the genetic parameters include population size, chromosome length, crossover probability, mutation probability and termination condition.
[0008] Preferably, the population initialization specifically includes the following steps: Genetic parameters are generated into a random matrix with the number of rows equal to the population size, the number of columns equal to the chromosome length, and the elements being 0 or 1.
[0009] Preferably, the specific process of calculating the band gap of the phononic crystal corresponding to all individuals in the contemporary population is as follows: Check whether there is band gap data of the phononic crystal corresponding to the current individual in the hash table; if yes, query the hash table to directly obtain the band gap of the phononic crystal corresponding to the current individual; if not, obtain the band gap of the phononic crystal corresponding to the current individual through finite element calculation based on the finite element model of the phononic crystal, and store the band gap data of the phononic crystal in the hash table.
[0010] Preferably, for all generations except the first generation of the initial population in the hash table, elite retention is performed, and selection, crossover, and mutation are performed in sequence to form a new population and replace the old population, and the current algebraic progress, the contemporary best individual and its corresponding band gap are output to achieve topological optimization of the phononic crystal.
[0011] A phononic crystal topology optimization system based on an improved genetic algorithm, comprising: A model building module is used to build a finite element model of a phononic crystal, import it into a genetic algorithm, store a hash table of calculated phononic crystal band gap information, and obtain genetic parameters; A population initialization module is used to initialize the population based on genetic parameters and obtain the initial population; A calculation simulation module is used to calculate the band gaps of the phononic crystals corresponding to all individuals in the contemporary population based on the initial population, the finite element model of the phononic crystal and the hash table storing the calculated band gap information of the phononic crystal, and store the band gap information in the hash table; The simulation optimization module performs elite retention and iterative optimization for all generations except the first generation of the initial population in the hash table to obtain the optimal phononic crystal structure and its band gap characteristics, thereby realizing the topological optimization of the phononic crystal.
[0012] An electronic device comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction stored in the memory is executed to implement the phononic crystal topology optimization method based on an improved genetic algorithm as described above.
[0013] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for optimizing phononic crystal topology based on an improved genetic algorithm is implemented.
[0014] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention provides a phononic crystal topology optimization method and system based on an improved genetic algorithm. The method is based on a genetic algorithm and a finite element method, and is implemented through a joint simulation of MATLAB and COMSOL. In addition, according to the fact that the fitness calculation of the phononic crystal topology optimization problem requires the use of the finite element method, and the finite element calculation is time-consuming, the method simplifies the calculation amount of the finite element by introducing a hash table method. Establish a finite element model of the phononic crystal and a hash table that stores the calculated phononic crystal band gap information; perform population initialization, calculate the phononic crystal band gaps corresponding to all individuals in the contemporary population, and for the phononic crystal structure that has been calculated, directly call its band gap information from the hash table, and other phononic crystal structures calculate their band gaps by the finite element method; for all generations except the first generation, perform elite retention, and perform selection, crossover and mutation in sequence; finally, check whether the contemporary population meets the termination condition, if it meets it, terminate the iteration, if not, return to the band gap calculation step until the termination condition is met. Compared with the traditional phononic crystal topology optimization method based on a genetic algorithm, the present invention improves the optimization efficiency of the algorithm and greatly reduces the optimization time. In three random tests, the amount of finite element calculations was reduced by about 90%.
[0015] Furthermore, due to the improvement in the efficiency of phononic crystal topology optimization, the resolution of the optimized phononic crystal topology structure can be improved under the same optimization time, making the optimized phononic crystal topology structure more refined. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is the technical route of the present invention; Figure 2 It is a schematic diagram of 1 / 8 symmetrical structure coding; Figure 3 The irreducible Brillouin zone of a two-dimensional phononic crystal with a 1 / 8 symmetric structure; Figure 4 is the structure diagram of the phononic crystal after discretization; Figure 5 Setting boundary conditions in phononic crystal finite element model; Figure 6 Grid diagram after meshing the discretized phononic crystal structure; Figure 7 To improve the fitness curve graph during the iteration process of the genetic algorithm; Figure 8 To improve the phononic crystal topology diagram corresponding to certain generations in the iterative process of the genetic algorithm; Fig. 9 This is the energy band structure diagram of the optimized phononic crystal structure. DETAILED DESCRIPTION
[0017] The present invention is further described in detail below in conjunction with specific embodiments, which are intended to explain the present invention rather than to limit it.
[0018] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0019] Embodiment 1, a phononic crystal topology optimization method and system based on an improved genetic algorithm, wherein the improved genetic algorithm is executed in MATLAB to optimize the phononic crystal structure, the band gap of the phononic crystal is calculated by the finite element method in COMSOL, and the optimization efficiency of the traditional phononic crystal topology optimization method based on the genetic algorithm is improved by introducing a hash table, characterized in that the method comprises the following steps: S1, establish a finite element model of the phononic crystal and import the model into the genetic algorithm; S2, establishing a hash table to store the calculated phononic crystal band gap information and inputting genetic parameters; S3, population initialization; S4, calculate the band gaps of the phononic crystals corresponding to all individuals in the contemporary population, and store the band gap information in a hash table; S5. For all generations except the first generation, perform elite retention. Perform selection, crossover, and mutation in sequence to form a new population and replace the old population. Output the current generation progress, the best individual of the current generation, and its corresponding band gap; S6: Check whether the current population meets the termination condition. If so, terminate the iteration; if not, return to S4 and continue iterating until the termination condition is met.
[0020] The finite element model of the phononic crystal described in S1 is established as follows: The phononic crystal is discretized into a 2N×2N grid. Several candidate materials for the phononic crystal are initially determined according to actual needs. The material properties are stored in the model. Floquet periodic conditions are applied to the opposite sides of the phononic crystal, and the grid is divided to obtain a finite element model of the phononic crystal. Among them, by establishing the "Solid Mechanics" physical field interface, setting boundary conditions, and dividing the grid, the wave vector k By scanning along the path of the irreducible Brillouin zone of the phononic crystal and performing a "characteristic frequency" study on the phononic crystal, the band gap of the phononic crystal can be calculated.
[0021] The model is imported into the genetic algorithm as described in S1. The specific process is as follows: The connection between COMSOL and MATLAB is established through COMSOL LiveLink for MATLAB, and the phononic crystal finite element model established in COMSOL is written into the mphmodel variable of MATLAB, so that MATLAB can control the simulation process in COMSOL and call COMSOL to calculate the band gap of the current phononic crystal through the finite element method during the optimization process.
[0022] Preferably, the data structure of the mphmodel variable is a MATLAB object provided in COMSOL LiveLink for MATLAB for storing COMSOL models.
[0023] The hash table storing the calculated band gap information of the phononic crystal described in S2 has a key which is the character code corresponding to the calculated phononic crystal and a value which is the fitness of the phononic crystal. The fitness is determined according to the optimization goal. Typical optimization goals include requiring the optimized phononic crystal to have the largest band gap width in a certain frequency band, or requiring the optimized phononic crystal to have the smallest weight while ensuring a certain band gap.
[0024] The genetic parameters described in S2 include population size, chromosome length, crossover probability, mutation probability and termination condition, where population size, crossover probability, mutation probability and termination condition are determined based on experience, where population size is usually 20-100, crossover probability is usually 0.6-0.9, and mutation probability is usually 0.01-0.1. The chromosome length is determined based on the number of discretized grids and the number of materials to be selected.
[0025] The population initialization described in S3 is as follows: Generate a random matrix with the number of rows equal to the population size, the number of columns equal to the chromosome length, and the elements are either 0 or 1.
[0026] The band gap of the phononic crystal corresponding to all individuals in the contemporary population is calculated as described in S4. The specific process is: Check whether there is band gap data of the current individual in the hash table. If yes, query the hash table to directly obtain the band gap of the phononic crystal corresponding to the current individual; if no, calculate the band gap of the phononic crystal corresponding to the current individual by finite element method, and store its band gap data in the hash table.
[0027] The specific process of elite retention described in S5 is as follows: The best individuals that have appeared in the population so far in the evolutionary process (called elite individuals) are directly copied to the next generation without crossover and mutation.
[0028] The selection described in S5 can use roulette selection method, tournament selection method, linear sorting selection method, or exponential sorting selection method according to the needs of the actual optimization problem.
[0029] The crossover described in S5 can use a crossover method such as single-point crossover, multi-point crossover or uniform crossover according to the needs of the actual optimization problem.
[0030] The mutation described in S5 can use mutation methods such as position mutation, random relocation mutation, inversion mutation or shift mutation according to the needs of the actual optimization problem.
[0031] The termination condition described in S6 is generally to terminate when the iteration exceeds a certain number of generations, or to terminate when the fitness does not change for more than a certain number of generations, or to use both of the above termination conditions at the same time.
[0032] Embodiment 2, a phononic crystal topology optimization system based on an improved genetic algorithm, comprising: The genetic algorithm module is improved, and the improved genetic algorithm is executed in MATLAB by introducing a hash table to optimize the topological structure of the phononic crystal.
[0033] The module for calculating the band structure of phononic crystals uses the finite element method in COMSOL to calculate the band structure of phononic crystals and returns the band gap information to MATLAB.
[0034] An electronic device comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction stored in the memory is executed to implement the phononic crystal topology optimization method based on an improved genetic algorithm as described above.
[0035] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the phononic crystal topology optimization method based on an improved genetic algorithm is implemented.
[0036] The phononic crystal topology optimization method based on the improved genetic algorithm of the present invention can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. If the method of the present invention is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0037] Based on such understanding, in an exemplary embodiment, if the phononic crystal topology optimization method based on the improved genetic algorithm of the present invention is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals. Among them, the computer storage medium can be any available medium or data storage device that can be accessed by the computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0038] An embodiment of the present invention provides a terminal device. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor.
[0039] When the processor executes the computer program, the steps of the phononic crystal topology optimization method based on the improved genetic algorithm are implemented; or, when the processor executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are implemented. The terminal device can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory.
[0040] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0041] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0042] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0043] It should be noted that the terms in the specification and claims of the present invention and the above-mentioned drawings that include a series of steps or units in the process, method, system, product or equipment are not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0044] Example 3, reference Figure 1 It is the overall implementation scheme technical route of the present invention.
[0045] The present invention provides a phononic crystal topology optimization method and system based on an improved genetic algorithm. The method is based on a genetic algorithm and a finite element method, and is implemented through a joint simulation of MATLAB and COMSOL. In addition, according to the fact that the fitness calculation of the phononic crystal topology optimization problem requires the use of the finite element method, and the finite element calculation is time-consuming, the method simplifies the calculation amount of the finite element by introducing a hash table method. Establish a finite element model of the phononic crystal and a hash table that stores the calculated phononic crystal band gap information; perform population initialization, calculate the phononic crystal band gaps corresponding to all individuals in the contemporary population, and for the phononic crystal structure that has been calculated, directly call its band gap information from the hash table, and other phononic crystal structures calculate their band gaps by the finite element method; for all generations except the first generation, perform elite retention, and perform selection, crossover and mutation in sequence; finally, check whether the contemporary population meets the termination condition, if it meets it, terminate the iteration, if not, return to the band gap calculation step until the termination condition is met. Compared with the traditional phononic crystal topology optimization method based on a genetic algorithm, the present invention improves the optimization efficiency of the algorithm and greatly reduces the optimization time. In three random tests, the amount of finite element calculations was reduced by about 90%.
[0046] The present invention proposes a phononic crystal topology optimization method based on an improved genetic algorithm, which is implemented according to the following specific steps: S1, establish a finite element model of the phononic crystal and import the model into the genetic algorithm; S2, establishing a hash table to store the calculated phononic crystal band gap information and inputting genetic parameters; S3, population initialization; S4, calculate the band gaps of the phononic crystals corresponding to all individuals in the contemporary population, and store the band gap information in a hash table; S5. For all generations except the first generation, perform elite retention. Perform selection, crossover, and mutation in sequence to form a new population and replace the old population. Output the current generation progress, the best individual of the current generation, and its corresponding band gap; S6: Check whether the current population meets the termination condition. If so, terminate the iteration; if not, return to S4 and continue iterating until the termination condition is met.
[0047] (1) Establishing the finite element model of phononic crystal Draw the structure of the phononic crystal in COMSOL and discretize it into a suitable grid structure. Select several candidate materials for the phononic crystal based on experience and write the material properties into the finite element model. Establish the "Solid Mechanics" physical field interface, apply Floquet periodicity conditions on the opposite sides of the phononic crystal, and divide the grid. Let the wave vector kBy scanning along the boundary of the irreducible Brillouin zone of the phononic crystal and performing a "characteristic frequency" study on the phononic crystal, the band gap of the phononic crystal can be calculated.
[0048] (2) Importing the finite element model of phononic crystal into the genetic algorithm The connection between COMSOL and MATLAB is established through COMSOL LiveLink for MATLAB, and the established phononic crystal finite element model is written into the mphmodel variable of MATLAB, so that MATLAB can control the simulation process in COMSOL and call COMSOL to calculate the band gap of the current phononic crystal through the finite element method during the optimization process.
[0049] (3) Establish a hash table to store the calculated phononic crystal band gap information In MATLAB, a hash table is established by mapping containers through dictionary or containers.Map. The key of the hash table is the character code corresponding to the calculated phononic crystal, and the value is the fitness of the phononic crystal.
[0050] (4) Input genetic parameters The population size, crossover probability, mutation probability and termination conditions are determined based on experience, where the population size is usually 20-100, the crossover probability is usually 0.6-0.9, and the mutation probability is usually 0.01-0.1. The chromosome length is determined based on the number of discretized grids and the number of materials to be selected.
[0051] (5) Population initialization Generate a random matrix with the number of rows equal to the population size, the number of columns equal to the chromosome length, and elements equal to 0 or 1. The row vector of the matrix represents the topological structure of the phononic crystal.
[0052] (6) Calculate the band gap of the phononic crystal corresponding to all individuals in the contemporary population For each individual of the contemporary population, that is, each row vector in the matrix, convert it into a decimal character in turn and compare it with the key in the hash table. If the key exists in the hash table, the value corresponding to the key is queried and returned to the algorithm; if the key does not exist, the row vector is sent to the finite element model of COMSOL, and the row vector is parsed into the corresponding phononic crystal topology in MATLAB through COMSOL LiveLink for MATLAB, that is, the corresponding material properties are assigned to the corresponding grid in the phononic crystal according to the element composition in the row vector. MATLAB calls the finite element model originally established in COMSOL, performs the "characteristic frequency" study, obtains the band gap of the phononic crystal topology, and transmits the band gap information back to MATLAB.
[0053] (7) Store the band gap information in the hash table For the phononic crystal topological structure with a band gap calculated by COMSOL using the finite element method, its row vector is converted into decimal characters and stored in a hash table as the key of the hash table; its fitness is also stored in the hash table as the value of this key in the hash table, forming a mapping relationship with the key in the hash table.
[0054] (8) For all generations except the first generation, perform elite retention If the fitness of the best individual of the current generation is smaller than that of the best individual of the previous generation, the individual with the lowest fitness of the current generation will be replaced by the best individual of the previous generation (called the "elite").
[0055] (9) Perform selection, crossover, and mutation in sequence to form a new population and replace the old population Choose appropriate selection, crossover and mutation methods according to actual problem needs. Common selection methods include roulette selection, tournament selection, linear sorting selection, exponential sorting selection, etc. Common crossover methods include single-point crossover, multi-point crossover and uniform crossover, etc. Common mutation methods include bit mutation, random reset mutation, inversion mutation and shift mutation, etc. Replace the old population with the new population formed after selection, crossover and mutation to participate in the next iteration.
[0056] (10) Output the current algebraic progress, the best individual of the current era and its corresponding band gap This operation is to facilitate monitoring of the phononic crystal topology optimization process. This part of the data will be used to draw the subsequent fitness curve.
[0057] (11) Check whether the contemporary population meets the termination conditions If satisfied, the iteration is terminated and the fitness curve is output; if not satisfied, return to step 6 "calculate the band gap of the phononic crystal corresponding to all individuals in the contemporary population" and continue iterating until the termination condition is met.
[0058] The following is a specific application example. In this application example, the topology optimization of a square two-dimensional phononic crystal with a diagonal of 242 mm is considered. The optimization goal is to maximize the band gap width of the optimized two-dimensional phononic crystal in the frequency band of 550~950 Hz. The candidate materials are epoxy resin, silicone rubber and lead. Their material properties are: the density of epoxy resin , Young's modulus , Poisson's ratio ; Density of silicone rubber , Young's modulus , Poisson's ratio ; Density of H62 brass , Young's modulus , Poisson's ratio .
[0059] In order to reduce the amount of calculation, the phononic crystal adopts a 1 / 8 symmetric structure. The 1 / 8 symmetric structure of the phononic crystal after 8×8 grid discretization is as follows: Figure 2 As shown. The green area is the area that the genetic algorithm needs to encode, and the materials in the white area are determined by the materials in the green area. The same serial number means that the same material is used. Because there are three materials to be selected, a binary variable is used. To represent the material properties of a unit, specify
[0060] The irreducible Brillouin zone of a two-dimensional phononic crystal with 1 / 8 symmetry is as follows Figure 3 shown.
[0061] Establish a finite element model of the phononic crystal. Draw the structure of the two-dimensional phononic crystal in COMSOL and discretize it into a 20×20 grid, such as Figure 4 As shown in the figure. After discretization, the side length of each grid is 2.852 mm. The material properties of the three candidate materials, epoxy resin, silicone rubber and lead, are written into the finite element model. The "Solid Mechanics" physical field interface is established in the two-dimensional phononic crystal. x Direction and y The Floquet periodicity condition is imposed in the direction, such as Figure 5 As shown. Divide the grid, such as Figure 6 As shown. Let the wave vector k By scanning along the path of the irreducible Brillouin zone M→Γ→X→M and performing a “characteristic frequency” study on the phononic crystal, the band gap of the phononic crystal can be calculated.
[0062] Import the finite element model into the genetic algorithm. Establish a connection between COMSOL and MATLAB through COMSOL LiveLink for MATLAB, write the established phononic crystal finite element model into the mphmodel variable of MATLAB, so that MATLAB can control the simulation process in COMSOL, and call COMSOL to calculate the band gap of the current phononic crystal through the finite element method during the optimization process.
[0063] Create a hash table to store the calculated phononic crystal band gap information. In MATLAB, use dictionary or containers.Map to map containers to create a hash table. The key of the hash table is the character code corresponding to the calculated phononic crystal, and the value is the fitness of the phononic crystal. In this example, the fitness is determined as the band gap width of the current phononic crystal in the 0~200Hz frequency range according to the optimization goal.
[0064] Enter the genetic parameters. The genetic parameters are set to: population size , crossover probability , mutation probability The termination condition is that the iteration exceeds 1000 generations, or the fitness does not change for more than 100 generations. A 20×20 grid discretized 1 / 8 symmetric structure two-dimensional phononic crystal needs to determine its topological structure through 55 grids, and each grid requires 2 binary characters to determine its material properties, so the chromosome length chromlength =110.
[0065] The population is initialized. The number of generated rows is popsize , the number of columns is chromlength , a random matrix whose elements are 0 or 1. The row vector of the matrix represents the topological structure of the phononic crystal.
[0066] Calculate the band gap of the phononic crystal corresponding to all individuals in the contemporary population. For each individual in the contemporary population, that is, each row vector in the matrix, convert it into a decimal character in turn and compare it with the key in the hash table. If there is this key in the hash table, query the value corresponding to the key and return it to the algorithm; if there is no such key, send the row vector to the finite element model of COMSOL, and parse the row vector into the corresponding phononic crystal topology in MATLAB through COMSOL LiveLink for MATLAB, that is, assign corresponding material properties to the corresponding grid in the phononic crystal according to the element composition in the row vector. MATLAB calls the finite element model originally established in COMSOL, performs the "characteristic frequency" study, obtains the band gap of the phononic crystal topology, and transmits the band gap information back to MATLAB.
[0067] The band gap information is stored in the hash table. For the phononic crystal topology structure with band gap calculated by COMSOL through the finite element method, its row vector is converted into decimal characters and stored in the hash table as the key of the hash table; its fitness is also stored in the hash table as the value of this key in the hash table, forming a mapping relationship with the key in the hash table.
[0068] For all generations except the first, elite preservation is performed. If the fitness of the best individual of the current generation is smaller than the fitness of the best individual of the previous generation, the individual with the lowest fitness of the current generation is replaced by the best individual of the previous generation (called the "elite").
[0069] Perform selection, crossover, and mutation in sequence to form a new population and replace the old one. Roulette selection is used for selection, single-point crossover is used for crossover, and bit mutation is used for mutation. The new population formed after selection, crossover, and mutation replaces the old population and participates in the next iteration.
[0070] Output the current algebraic progress, the best individual of the current era and its corresponding band gap. This operation is to facilitate the monitoring of the process of phononic crystal topology optimization. This part of the data will be used for the subsequent drawing of the fitness curve.
[0071] Check whether the current population meets the termination condition. If it does, terminate the iteration and output the fitness curve. If it does not, return to the step of "calculating the band gap of the phononic crystal corresponding to all individuals in the current population" and continue iterating until the termination condition is met. The fitness curve after the iteration is as follows: Figure 7 As shown in the figure, the topological structures of the phononic crystal at several nodes during the iteration process are as follows: Figure 8 The energy band structure of the best individual with a thickness of 4 mm after optimization is shown in Fig. 9 As shown in the figure, there is a bandgap between the sixth energy band and the seventh energy band, and the bandgap range is 199~729Hz; there is a second bandgap between the seventh energy band and the eighth energy band, and the bandgap range is 735~935Hz; the total bandgap bandwidth accounts for about 95% of the optimized target frequency band, which achieves the design goal well.
[0072] In order to reflect the optimization efficiency of the improved genetic algorithm, three random tests were conducted, and the test results are shown in Table 1. As can be seen from Table 1, in the three random tests, the average reduction in the finite element band gap calculation amount exceeded 90% compared with the genetic algorithm before the improvement. This shows that by combining the hash table with the genetic algorithm, the optimization efficiency is greatly accelerated, and the optimized phononic crystal sound insulation and noise reduction topology structure can be obtained in a relatively short time.
[0073] Table 1 Results of three random tests
[0074] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any ordinary technician in the industry can smoothly implement the present invention as shown in the drawings and described above. However, any equivalent changes, modifications and evolutions made by technicians familiar with the profession without departing from the scope of the technical solution of the present invention using the technical content disclosed above are all equivalent embodiments of the present invention. At the same time, any equivalent changes, modifications and evolutions made to the above embodiments based on the essential technology of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A phononic crystal topology optimization method based on an improved genetic algorithm, characterized in that: include, Establish a finite element model of the phononic crystal and import it into the genetic algorithm, establish a hash table to store the calculated phononic crystal band gap information, and obtain genetic parameters; Initialize the population based on genetic parameters to obtain the initial population; The band gaps of the phononic crystals corresponding to all individuals in the current population are calculated based on the initial population, the finite element model of the phononic crystal and the hash table storing the calculated band gap information of the phononic crystal, and the band gap information is stored in the hash table; The population in the hash table is iteratively optimized to select the optimal phononic crystal structure and its band gap characteristics, thereby achieving topological optimization of the phononic crystal.
2. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The finite element model of the phononic crystal is introduced into the genetic algorithm, and the specific process is as follows: The overall structure of the phononic crystal to be optimized is drawn in COMSOL and discretized into several grids. The material properties of the phononic crystal material are written into the finite element model. Floquet periodic conditions are applied to the opposite sides of the phononic crystal, and the grids are divided to obtain the finite element model of the phononic crystal. The connection between COMSOL and MATLAB was established through COMSOL LiveLink for MATLAB, the finite element model of the phononic crystal was written into the variables of the genetic algorithm, and the COMSOL simulation process was controlled through instructions in MATLAB.
3. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The specific process of establishing a hash table to store the calculated phononic crystal band gap information is as follows: In MATLAB, a hash table is established through dictionary or containers.Map mapping container, where the key of the hash table is the character code corresponding to the band gap of the current phononic crystal, and the value of the hash table is the fitness of the phononic crystal.
4. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The genetic parameters include population size, chromosome length, crossover probability, mutation probability and termination condition.
5. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The specific process of population initialization is as follows: Genetic parameters are generated into a random matrix with the number of rows equal to the population size, the number of columns equal to the chromosome length, and the elements being 0 or 1, wherein the row vector of the matrix represents the topological structure of the phononic crystal.
6. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The specific process of calculating the band gap of the phononic crystal corresponding to all individuals in the contemporary population is as follows: For each individual of the contemporary population, convert it into decimal characters in turn, and then compare it with the key in the hash table; query the hash table to see whether there is band gap data of the phononic crystal corresponding to the current individual; if so, query the hash table to directly obtain the band gap of the phononic crystal corresponding to the current individual; If not, the band gap of the phononic crystal corresponding to the current individual is obtained through finite element calculation based on the finite element model of the phononic crystal, and the band gap data of the phononic crystal is stored in the hash table.
7. The phononic crystal topology optimization method based on an improved genetic algorithm according to claim 1, characterized in that: The iterative optimization of the population in the hash table to select the optimal phononic crystal structure and its band gap characteristics is specifically as follows; For all generations except the first generation of the population in the hash table, elite retention is performed, and selection, crossover, and mutation are performed in sequence to form a new population and replace the old population. The current generational progress, the contemporary best individual and its corresponding band gap are output to achieve topological optimization of the phononic crystal.
8. A phononic crystal topology optimization system based on an improved genetic algorithm, based on the phononic crystal topology optimization method according to any one of claims 1 to 7, characterized in that: include: A model building module is used to build a finite element model of the phononic crystal, import it into the genetic algorithm, store a hash table of the calculated phononic crystal band gap information, and obtain genetic parameters; A population initialization module is used to initialize the population based on genetic parameters and obtain the initial population; A calculation simulation module is used to calculate the band gaps of the phononic crystals corresponding to all individuals in the contemporary population based on the initial population, the finite element model of the phononic crystal and the hash table storing the calculated band gap information of the phononic crystal, and store the band gap information in the hash table; The simulation optimization module performs elite retention and iterative optimization for all generations except the first generation of the initial population in the hash table to obtain the optimal phononic crystal structure and its band gap characteristics, thereby realizing the topological optimization of the phononic crystal.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction stored in the memory is executed to implement the phononic crystal topology optimization method based on the improved genetic algorithm as described in claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method for optimizing the topology of phononic crystals based on an improved genetic algorithm as described in claims 1 to 7 is implemented.
Citation Information
Patent Citations
Liquid-liquid photonic crystal topological optimization method based on genetic algorithm and finite element method
CN103246767A
Optimization method of two-dimension solid-phase phonon crystal mixed mode band gap
CN103310049A
Two-dimensional solid-phase phonon crystal XY module cord gap optimization method based on genetic algorithm
CN103324786A
Phononic crystal band gap design method and design system based on intelligent coding
CN116776752A
Acoustic metamaterial design method based on non-gradient topological optimization
WO2022087770A1
Cited By
Piezoelectric-viscoelastic photonic crystal topological optimization method based on genetic algorithm
CN121365591A
Topological optimization method of piezoelectric-viscoelastic phononic crystals based on genetic algorithm
CN121365591B