CN115079995A - Method and system for sequencing measured sample measuring points of neutron spectrometer - Google Patents
Method and system for sequencing measured sample measuring points of neutron spectrometer Download PDFInfo
- Publication number
- CN115079995A CN115079995A CN202210859831.9A CN202210859831A CN115079995A CN 115079995 A CN115079995 A CN 115079995A CN 202210859831 A CN202210859831 A CN 202210859831A CN 115079995 A CN115079995 A CN 115079995A
- Authority
- CN
- China
- Prior art keywords
- measured
- point
- measuring
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/06—Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
- G06F7/08—Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16B—BIOINFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR GENETIC OR PROTEIN-RELATED DATA PROCESSING IN COMPUTATIONAL MOLECULAR BIOLOGY
- G16B20/00—ICT specially adapted for functional genomics or proteomics, e.g. genotype-phenotype associations
- G16B20/20—Allele or variant detection, e.g. single nucleotide polymorphism [SNP] detection
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E30/00—Energy generation of nuclear origin
- Y02E30/30—Nuclear fission reactors
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- Mathematical Analysis (AREA)
- Computational Mathematics (AREA)
- Biophysics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Algebra (AREA)
- Genetics & Genomics (AREA)
- Analytical Chemistry (AREA)
- Chemical & Material Sciences (AREA)
- Biotechnology (AREA)
- Medical Informatics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- Proteomics, Peptides & Aminoacids (AREA)
- Physiology (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- Operations Research (AREA)
- Probability & Statistics with Applications (AREA)
- Other Investigation Or Analysis Of Materials By Electrical Means (AREA)
- Analysing Materials By The Use Of Radiation (AREA)
Abstract
The application discloses a method and a system for sequencing measured points of a measured sample of a neutron spectrometer, wherein the method comprises the following steps: the coordinates of a measured point, a measured vector, the coordinates of a diffraction point and a scattering vector are represented in a base coordinate system; taking the minimum movement time of the sample stage as a target function; taking each measuring point sequencing scheme as a chromosome in a genetic algorithm; iteratively operating the chromosome according to the preset iteration times; calculating the corresponding fitness of each chromosome in each generation according to the fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample. The method and the device solve the problem that the measured sample measuring points of the neutron spectrometer are sequenced manually in the prior art, so that the measuring point sequence planning can be automatically completed on a computer, and the measuring time can be shortened and the measuring efficiency can be improved by moving the sample stage according to the planned measuring point sequence.
Description
Technical Field
The application relates to the field of measurement of residual stress of neutron scattering materials, in particular to a method and a system for sequencing measured points of a measured sample of a neutron spectrometer.
Background
The regulation and measurement of the internal stress of the material are one of factors influencing the level of the manufacturing industry, and the internal stress of the material has great influence on the manufacturing precision and the performance of the product. The method has the advantages of deeply researching the internal stress generation mechanism of the material, analyzing the internal stress distribution rule of the part, improving the internal stress measurement precision and having important significance for improving the development level of the high-precision manufacturing technology.
The neutron spectrometer is a device for detecting deep stress of various metal materials and engineering components, wherein a sample stage is one of important devices of the whole device. The neutron spectrometer sample platform is a device for installing a measured sample and moving a measuring point and a measuring direction on the measured sample to a neutron diffraction point and a scattering vector direction for stress measurement, and all moving pairs of the sample platform are required to be combined to act in the process of stress measurement of the sample, so that the measured points are accurately positioned. The sample platform often can occupy too much experimental time at the in-process of fixing a position every measurement station, because neutron beam has the radiativity, the experimental time overlength can influence the experimenter healthy, simultaneously because nuclear reactor can consume a large amount of neutron beams for work for a longer time, causes the energy waste, therefore the time should be shortened as far as possible in the process of neutron spectrometer stress measurement, improves measurement of efficiency.
In order to improve the measurement efficiency, the movement time of the sample stage can be reduced as much as possible by reasonably planning the movement path of the sample stage so as to improve the measurement efficiency, namely, the measured points of the measured sample are reasonably sequenced. At present, before a spectrometer is used for measuring stress, experimenters can carry out full preparation, the sequence of measured points is reasonably arranged manually, and the movement of a sample table is controlled according to the sequence, so that the process usually consumes a great deal of time and energy of the experimenters, and the working efficiency is low; meanwhile, the manual planning of the sequence of the measured points is difficult to realize that the total moving time of the sample table is shortest.
Disclosure of Invention
The embodiment of the application provides a method and a system for sequencing measured sample measuring points of a neutron spectrometer, which are used for at least solving the problem that the measured sample measuring points of the neutron spectrometer depend on manual sequencing in the prior art.
According to one aspect of the application, a method for sequencing measured sample measuring points of a neutron spectrometer is provided, and comprises the following steps: the coordinates of a measured point, a measured vector, the coordinates of a diffraction point and a scattering vector are represented in a base coordinate system; taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of the sample stage returning to the initial position after traversing and moving from the initial position to each measuring point, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector; taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position; performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes; calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the objective function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
Further, the objective function is:
wherein p is 0 Denotes the initial position of the sample stage, R = (p) 1 ,p 2 ,…,p N ) For a set of all measured points, N represents the measured pointThe number of the measuring points is greater than the total number of the measuring points,representing the final measured point sequencing scheme satisfying the objective function in R (a) 1 ,a 2 …,a N ) Represents a non-repeated number within the range of 1 to N,representing the measured pointWhen the position and the measured vector of (A) are located in the direction of the diffraction point and the scattering vector of (B)The position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,indicating the point to be measured when the sample stage is in the initial positionThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,representing the measured pointAnd measuring the time required by the sample platform to return to the initial position after the measurement is finished.
Further, the fitness function is:
wherein, fitness (i) is the fitness value of the ith individual in the population; t (i) is the corresponding measuring time of the ith individual in the population; minT is the minimum value of the corresponding measuring time of all individuals in the population; maxT is the maximum value of the corresponding measurement time of all individuals in the population; epsilon is a preset value to avoid the fitness function being invalid when maxT-minT =0.
Further, iteratively operating on the chromosome includes: each iteration operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes.
Further, the selecting operation includes: the fitness value of each individual in the population of the current generation is arranged from large to small, wherein a 1 、a n Respectively the maximum and minimum fitness value in the population, and the fitness a 1 Multiplying by the reward factor omega 1 (ii) a Degree of adaptation a n Multiplying by a penalty factor omega 2 (ii) a Wherein, ω is 1 >1,0<ω 2 <1。
Further, the interleaving operation comprises: generating a random number for a pair of chromosomes, if the random number is greater than or equal to the crossover probability P c And performing crossover operation, otherwise, reselecting a pair of chromosomes from the rest chromosomes to continue generating a random number, and judging whether crossover operation can be performed.
Further, the mutation operation comprises: generating a random number for each chromosome if the random number is greater than or equal to the mutation probability P m Any two locations are swapped for the coordinate number.
Further, the predetermined condition satisfied includes: acquiring a preset maximum iteration number MAX, counting an iteration number Gen in the iterative evolution process, and if the iteration number Gen is greater than the maximum iteration number MAX, terminating the iteration; or, setting the iteration number of which the optimal fitness keeps unchanged as F, acquiring the maximum preset iteration number of which the fitness keeps unchanged as MAX _ F, counting F in the iterative evolution process, and if F is greater than MAX _ F, terminating iteration.
According to another aspect of the application, a measured sample measuring point sequencing system of a neutron spectrometer is also provided, which comprises: the representing module is used for representing the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector in the base coordinate system; the processing module is used for taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector; the iteration module is used for taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position; performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes; the calculation module is used for calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the target function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
According to another aspect of the present application, there is also provided a memory for storing software for performing the above-described method.
According to another aspect of the application, there is also provided a processor for running software for performing the above method.
In the embodiment of the application, the coordinates of a measured point, a measured vector, the coordinates of a diffraction point and a scattering vector are expressed in a base coordinate system; taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector; taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position; performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes; calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the objective function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample. The method and the device solve the problem that the measured sample measuring points of the neutron spectrometer are sequenced manually in the prior art, so that the measuring point sequence planning can be automatically completed on a computer, and the measuring time can be shortened and the measuring efficiency can be improved by moving the sample stage according to the planned measuring point sequence.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a simplified structural diagram of a sample stage of a neutron spectrometer according to an embodiment of the present application;
FIG. 2 is a schematic diagram of neutron diffraction measurement of residual stress according to an embodiment of the present application;
FIG. 3 is a diagram of a roulette selection principle according to an embodiment of the present application;
FIG. 4 is a direct crossover schematic according to an embodiment of the present application;
FIG. 5 is a diagram of an improved crossover operation according to an embodiment of the present application;
FIG. 6 is a schematic diagram of variant operation according to an embodiment of the present application;
FIG. 7 is an overall flowchart of the intelligent sequencing of the measured sample measuring points of the neutron spectrometer according to the embodiment of the application;
FIG. 8 is a simplified diagram of the joint structure of the sample stage and a schematic diagram of the coordinate system of each stage joint and the table top according to the embodiment of the present application;
FIG. 9 is a schematic diagram of a coordinate system of a measured sample and a mounting position of the coordinate system on a table according to an embodiment of the present application;
FIG. 10 is a diagram of a relationship between a diffraction coordinate system and a base coordinate system (top view direction) according to an embodiment of the present application;
FIG. 11 is a schematic view of a station sequence according to an embodiment of the present application;
FIG. 12 is a graph of optimal sequencing convergence according to an embodiment of the present application;
FIG. 13 is a schematic diagram of a method for intelligently sequencing measured sample points of a neutron spectrometer according to an embodiment of the application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The structure and the operation principle of the sample stage in the following examples will be explained first. Fig. 1 is a schematic structural diagram of a sample stage of a neutron spectrometer according to an embodiment of the present application, and fig. 1 is a schematic structural diagram of the sample stage of the neutron spectrometer. The whole sample table of the neutron spectrometer has 4 degrees of freedom, wherein 1 is a rotary joint of the sample table rotating around a Z axis, 2 is a moving joint of the sample table in the Z axis direction, 3 is a moving joint of the sample table in the Y axis direction, 4 is a moving joint of the sample table in the X axis direction, and 5 is a table top of the sample table and used for mounting a sample 6 to be measured. When the residual stress of the measured sample is measured, the measured sample is installed on a table board, the measured sample is driven to move through joint actions of the sample table, the measured point position on the measured sample is aligned with a diffraction point, the measured vector is aligned with a scattering vector, and therefore neutron residual stress measurement is performed, the stress principle of neutron diffraction measurement is shown in fig. 2, a single-energy neutron incident beam irradiates the diffraction point of the measured sample through an incident slit to generate a transmitted beam and an emergent beam, the emergent beam reaches a two-dimensional position sensitive detector (PSD for short) through a receiving slit, and the scattering vector shown in fig. 2 can be obtained.
Based on the neutron spectrometer shown in fig. 1 and fig. 2, in this embodiment, a method for sequencing measured points of a measured sample of the neutron spectrometer is provided, where the method includes the following steps:
step S102, representing coordinates of a measured point, a measured vector, coordinates of a diffraction point and a scattering vector in a base coordinate system;
step S104, taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector;
step S106, taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position;
step S108, iteratively operating chromosomes according to preset iteration times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes;
step S110, calculating corresponding fitness for each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the objective function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
Through the steps, the problems existing in the prior art that the measured sample measuring points of the neutron spectrometer are sequenced manually are solved, so that the measuring point sequence planning can be automatically completed on a computer, and the measuring time can be shortened and the measuring efficiency can be improved by moving the sample table according to the planned measuring point sequence.
The present embodiment will be described with reference to the accompanying drawings. The embodiment relates to the field of neutron scattering-material residual stress measurement, in particular to a method for intelligently sequencing measured points of a measured sample of a neutron spectrometer. Fig. 13 is a schematic diagram of a method for intelligently sequencing measured sample points of a neutron spectrometer according to an embodiment of the application, and as shown in fig. 13, the method mainly includes three steps: (1) modeling the neutron spectrometer sample stage by kinematics: establishing a coordinate system for each joint of the sample table; the coordinates of the measured points and the measured vectors are represented in the base coordinate system; diffraction point coordinates and a scattering vector are shown in the base coordinate system. (2) Establishing an optimization objective function: and establishing an objective function by taking the minimum motion time of the sample stage as an optimization target. (3) And (3) improving a genetic algorithm: the coding, selection, crossing and mutation operations of the basic genetic algorithm are improved in combination with reality; designing a fitness function; and the whole process of the intelligent sequencing of the measured sample measuring points of the neutron spectrometer is provided by combining with an improved genetic algorithm. The above steps are explained below.
Kinematic modeling of sample stage
(1) Method for representing coordinates and vectors of measured points in base coordinate system
In order to show the coordinates and the measured vectors of the measured points in the base coordinate system, firstly establishing a coordinate system of each joint for the structure of the sample platform according to an improved D-H method, which specifically comprises the following steps: base coordinate system X 0 Y 0 Z 0 Z-axis rotary joint coordinate system X 1 Y 1 Z 1 Z-axis moving joint coordinate system X 2 Y 2 Z 2 Y-axis moving joint coordinate system X 3 Y 3 Z 3 X-axis moving joint coordinate system X 4 Y 4 Z 4 Table top coordinate system X 5 Y 5 Z 5 (ii) a And determining an improved D-H parameter table of each joint of the sample stage according to the established coordinate system.
According to a homogeneous transformation matrix between the i-1 and i coordinate systems of adjacent joints of the sample table:
in the formula of alpha i-1 Represents around X i-1 Axis from Z i-1 The shaft being rotated to Z i The angle of the shaft, i.e. the link torsion angle; a is i-1 Represents along X i-1 Axis from Z i-1 Movement of the shaft to Z i Distance of the shaft, i.e. link length; d i Represents along Z i Axis from X i-1 The shaft being moved to X i Distance of axes, i.e. link distance, theta i Represents around Z i Axis from X i-1 The shaft being rotated to X i The angle of the shaft, i.e. the link angle.
Substituting the improved D-H parameters of each level of joint of the sample stage into the formula to obtain a transformation matrix among four joint coordinate systems:、、、。
simultaneously according to the table coordinate system X 5 Y 5 Z 5 And X-axis moving joint coordinate system X 4 Y 4 Z 4 The transformation relation between the two coordinate systems can be obtained。
Let the coordinate system of the measured sample be X j Y j Z j Coordinate system X 5 Y 5 Z 5 And X j Y j Z j A transformation matrix of,The mounting position of the tested sample on the table top is specifically determined.
The position of a measured point in a measured sample coordinate system is (x) c ,y c ,z c ) The measured vector is expressed as (x) under the coordinate system of the measured sample v ,y v 0), the homogeneous coordinate C = (x) of the position coordinate of the measured point in the measured sample coordinate system c ,y c ,z c ,1) T And the homogeneous coordinate V = (x) of the measured vector in the measured sample coordinate system v ,y v ,0,0) T 。
According to the transformation matrix among the plurality of coordinate systems:、、、、、and the coordinate of the position of the measured point and the homogeneous coordinates C and V of the measured vector in the coordinate system of the measured sample can obtain the representation method of the coordinate of the measured point and the measured vector in the base coordinate system:
homogeneous coordinate of measured point coordinate under base coordinateComprises the following steps:
the coordinate of the measured point is expressed as (X) in the base coordinate system c ,Y c ,Z c )。
The measured vector is represented as (X) in the base coordinate system v ,Y v ,Z v )。
(2) Method for representing diffraction point coordinates and scattering vectors in base coordinate system
In order to represent the diffraction point coordinates and the scattering vector in the base coordinate system, a diffraction coordinate system is first established. The establishing method comprises the following steps: with diffraction point as origin and Z in vertical direction m Axis, incident beam direction X m Axis, Y determined by right-hand rule m Axis, can establish a diffraction coordinate system X m Y m Z m 。
According to a base coordinate system X 0 Y 0 Z 0 And a diffraction coordinate system X m Y m Z m The transformation relation between the two can obtain a transformation matrix between the two。
Let the diffraction point coordinate be (0,0, 0) in the diffraction coordinate system, and the scattering vector be (x) in the diffraction coordinate system q ,y q 0), the homogeneous coordinate M = (0,0,0,1) of the diffraction point coordinate in the diffraction coordinate system T Homogeneous coordinate Q = (x) of scattering vector in diffraction coordinate system q ,y q ,0,0) T 。
According to the transformation matrixAnd the coordinates of the diffraction points and the scattering vectors at the diffraction sitesThe homogeneous coordinates M and Q under the standard system can obtain the representation method of the diffraction point coordinates and the scattering vectors in the base coordinate system:
The diffraction point coordinates are expressed as (X) in the base coordinate system m ,Y m ,Z m )。
The scattering vector is then expressed as (X) in the base coordinate system q ,Y q ,Z q )。
Establishing an objective function
During stress measurement, the position coordinate (X) of the measured point is measured c ,Y c ,Z c ) Co-diffraction point coordinates (X) m ,Y m ,Z m ) Alignment, the vector (X) to be measured v ,Y v ,Z v ) Common scattering vector (X) q ,Y q ,Z q ) And aligning, wherein the four joint variables of the sample table are a set of fixed values, when the next measured point is measured, the four joint variables of the sample table are changed, and the absolute values of the changes of the four joint variables in the process are the translation or rotation amount of the corresponding joint.
In order to realize the intelligent sequencing of the measured sample measuring points in the neutron spectrometer and improve the measuring efficiency, the invention takes the minimum movement time of the sample stage as an objective function and provides the following objective functions:
wherein p is 0 Denotes the initial position of the sample stage, R = (p) 1 ,p 2 ,…,p N ) For a set of all measured points, N represents the number of measured points,representing the sequencing scheme of the final measured points satisfying the objective function in R (a) 1 ,a 2, …,a N ) Represents a non-repeated number within the range of 1 to N,representing the measured pointWhen the position and the measured vector of (A) are located in the direction of the diffraction point and the scattering vector of (B)The position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,indicating the point to be measured when the sample stage is in the initial positionThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,representing the measured pointAnd measuring the time required by the sample platform to return to the initial position after the measurement is finished.
wherein、、Respectively represent the measured pointsWhen the position and the measured vector of (A) are located in the direction of the diffraction point and the scattering vector of (B)The position and the measured vector of the sample stage are moved to the direction of the diffraction point and the scattering vector, and the X-axis translation amount, the Y-axis translation amount, the Z-axis translation amount and the Z-axis rotation angle of the sample stage are obtained;、、、respectively shows the measured points when the sample stage is at the initial positionThe position and the measured vector of the sample stage are moved to the direction of the diffraction point and the scattering vector, and the X-axis translation amount, the Y-axis translation amount, the Z-axis translation amount and the Z-axis rotation angle of the sample stage are obtained; respectively represent the measured pointsAfter the measurement is finished, when the sample platform returns to the initial position, the X-axis translation amount, the Y-axis translation amount, the Z-axis translation amount and the Z-axis rotation angle of the sample platform are measured; v. of x 、v y 、v z Respectively representing the X-axis, Y-axis and Z-axis moving speeds of the sample table, and omega representing the angular speed of the sample table rotating around the Z-axis.
Improved genetic algorithm
The genetic algorithm is a method for searching an optimal solution by simulating a natural evolution process, and has the main advantages that a structural object is directly operated, and a target function value is used as searching information, so that complex operations such as derivation and the like are avoided; by adopting a probabilistic optimization method, the optimized search space can be automatically acquired and guided without a determined rule, and the search direction is adaptively adjusted; the system has expandability and is convenient to be mixed with other technologies for use.
The algorithm firstly encodes potential solutions of problems, each individual represents a solution of a genetic algorithm, then processes of selection, crossing, variation and the like of chromosome genes in biological evolution are simulated, new filial generations are continuously generated, and the fitness function is adopted to simulate the advantages and disadvantages of the nature to judge the advantages and disadvantages of the new solutions until the optimal solutions are generated.
In the embodiment, the practical problems in the neutron spectrometer test process are combined, the genetic algorithm is adaptively improved, and the intelligent sequencing method for the measured sample measuring points of the neutron spectrometer based on the genetic algorithm is provided. In the steps, a neutron spectrometer sample table is subjected to kinematic modeling, an optimized objective function for intelligently sequencing measured points of a measured sample of the neutron spectrometer is established, and then the objective function needs to be solved.
The neutron spectrometer mainly has the following characteristics when measuring the stress of a measuring point of a measured workpiece:
(1) the sample table is in the original position when the measurement is started, and the sample table needs to return to the original position after the measurement is finished;
(2) in the stress measurement process, any measuring point on a measured sample is measured once, namely point positions in a measuring path cannot be repeated;
(3) the measured workpiece is a three-dimensional object, and the measuring point positions are widely distributed in the three-dimensional space of the measured workpiece.
The method is characterized in that partial key steps of a genetic algorithm are introduced as follows by combining the characteristics of a neutron spectrometer when measuring the stress of a measuring point of a measured workpiece:
(1) and (5) encoding. The measuring point sequence of the measured sample of the neutron spectrometer is used as a chromosome in a genetic algorithm, and the coding mode is very suitable for the problem of path optimization of measurement. In the chromosome coding process, the initial coding point position and the end coding point position are both assigned to be 0, which means that the position of the sample stage needs to return to the initial point before the measurement starts and after the measurement ends, and except that the head and the tail two chromosome coding point positions are 0, other coding point positions adopt the measuring point numbers to carry out non-repeated coding, so the chromosome length N = the measuring point number + 2.
(2) And (6) selecting operation. Selecting operation using an improved roulette strategy: firstly, the fitness value of each individual in the population of the current generation is arranged from large to small, wherein a 1 、a n Respectively the maximum and minimum fitness value in the population, and the fitness a 1 Multiplying by the reward factor omega 1 (ω 1 >1) So that the corresponding individuals can be better reserved in the next generation population; to fitness a n Multiplying by a penalty factor omega 2 (0<ω 2 <1) So that the corresponding individuals are easier to be eliminated, and the convergence of population iteration is improved. See formula:
an improved roulette selection scheme is shown in figure 3.
(3) And (4) performing a crossover operation. Generating a random number for a pair of chromosomes, if the random number is greater than or equal to the crossover probability P c And performing the following crossover operation, otherwise, reselecting a pair of chromosomes from the rest chromosomes to continuously generate a random number, and judging whether the crossover operation can be performed. As shown in fig. 4, in the chromosome crossing process, both the crossing start point and the crossing length are randomly generated to improve the randomness of the population and avoid the algorithm from falling into local convergence. If the direct crossing is carried out according to the conventional genetic algorithm crossing principle, repeated coding point positions appear on a chromosome after the crossing is finished, the specific expression of the repeated coding point positions is that a certain measuring point of a workpiece is repeatedly measured, while certain measuring points are not measured, and the chromosome of the coding mode does not conform to the process of measuring stress of a neutron spectrometer sample stage.
Therefore, it is necessary to improve the above-mentioned crossing operation to avoid the duplicate points on the chromosome, and the specific implementation principle is shown in fig. 5, in which the crossing length is exemplified by three points. And after determining the starting point position and the crossing length of the crossing, sequentially carrying out crossing operation according to the sequence of the point positions. Firstly, the first point location is crossed, the other point locations are unchanged, and corresponding numbers on non-crossed positions are exchanged in the crossing process, so that repeated numbers do not appear on a chromosome after crossing; and by analogy, until the dot position in the crossing length is crossed completely, repeated coding cannot occur on the whole chromosome, and the actual requirement is met.
(4) And (5) performing mutation operation. Generating a random number for each chromosome if the random number is greater than or equal to the mutation probability P m Any two positions are exchanged for the coordinate numbers as shown in fig. 6. This ensures that no repeated coding occurs on the chromosome after mutation.
(5) A fitness function. At present, the optimization problem with the minimum time as the optimization target usually selects the reciprocal of the time used by an individual as the fitness value of the individual, but the fitness value obtained in this way is not proportional to the time, which may cause instability in the solution process. Aiming at the embodiment of the invention, a fitness function shown as the following formula is designed:
wherein, fitness (i) is the fitness value of the ith individual in the population; t (i) is the corresponding measuring time of the ith individual in the population; minT is the minimum value of the corresponding measuring time of all individuals in the population; maxT is the maximum value of the corresponding measurement time of all individuals in the population; epsilon is a small value to avoid the fitness function being invalid when maxT-minT =0.
(6) And (5) an iteration termination condition. The genetic algorithm needs to specify an iteration termination condition in the iterative evolution process, and the currently commonly used iteration termination condition is as follows: presetting a maximum iteration number MAX in advance, counting an iteration number Gen in the iterative evolution process of the genetic algorithm, and if the iteration number Gen is greater than the maximum iteration number MAX, terminating the iteration; when the genetic algorithm reaches the optimal solution or falls into the local optimal solution in advance in the iterative evolution process, the iterative evolution can be continuously carried out under the limitation of the iterative termination condition, and the calculation efficiency is influenced.
In view of the above-mentioned shortcomings of the iteration termination condition, the embodiment of the present invention improves on the basis of the original iteration termination condition. And setting the iteration frequency of the optimal fitness keeping unchanged as F, and presetting the maximum iteration frequency of the fitness keeping unchanged as MAX _ F. The iteration termination condition provided by the invention is as follows: and F is counted in the iterative evolution process of the genetic algorithm, and if the F is larger than MAX _ F, the iteration is terminated.
In summary, the iteration termination condition of the embodiment of the present invention is: the genetic algorithm can terminate the iteration when the iterative evolution process meets any condition of Gen > MAX and F > MAX _ F.
In view of the above improvement on the genetic algorithm, the overall flowchart of the intelligent sequencing of the measured sample measuring points of the neutron spectrometer provided by this embodiment is shown in fig. 7. For the flowchart, the specific steps of the proposed scheme of the present embodiment are introduced as follows:
And 2, initializing the population. Initializing the parameter settings of the genetic algorithm: population number N, chromosome length M, maximum iteration number MAX _ F with constant optimal fitness, and cross probability P c Probability of variation P m (ii) a Importing the position and direction information of a measured point of a workpiece; the chromosomes are encoded and the original population is randomly generated.
And 3, calculating the fitness value of each chromosome in the population.
And 4, updating the iteration times of which the optimal fitness keeps unchanged.
And 5, carrying out selection operation.
And 6, performing cross operation.
And 7, performing mutation operation.
And 8, updating the iteration times.
And 9, judging whether the termination condition is met. If yes, outputting a final measuring point sequence.
The following description is made with reference to an example.
Sample stage structure and working principle
The sample stage of the neutron spectrometer in the embodiment can bear a large workpiece, can translate in three directions of an X, Y, Z axis and rotate around the Z axis, and has 4 degrees of freedom in movement. X, Y, the translation range of the axial direction is [ -250mm,250mm ], and the translation precision is less than 30 μm; the translation range [0,550mm ] in the Z-axis direction has the precision of 30 mu m; the rotation range is more than 360 degrees around the Z-axis direction, and the rotation precision is less than 0.05 degree; the sample stage can be used for bearing samples and sample environments such as high and low temperature, magnetic field and the like, and adjusting the samples to perform accurate angle control such as translation, rotation and the like. Wherein, the incident height of the neutron beam is 1400mm from the ground.
Kinematic modeling of sample stage
(1) Method for representing coordinates and vectors of measured points in base coordinate system
As shown in fig. 8, in order to show the coordinates of the measured point and the measured vector in the base coordinate system, the structure of the sample stage is first simplified, the coordinate systems of the joints are established according to the improved D-H method, and the coordinate system of the table top is established. Wherein X 0 Y 0 Z 0 Is a base coordinate system fixed on the ground, Z 0 The axis coincides with the central axis of the sample table; x 1 Y 1 Z 1 Is a Z-axis rotary joint coordinate system, Z 1 The axis coincides with the central axis of the sample table; x 2 Y 2 Z 2 Is a Z-axis moving joint coordinate system, Z 2 The axis coincides with the central axis of the sample table; x 3 Y 3 Z 3 Is a Y-axis moving joint coordinate system, Z 3 The axis coincides with the central axis of the ball screw moving along the Y axis; x 4 Y 4 Z 4 Is the X-axis moving joint coordinate system, Z 4 The axis coincides with the central axis of the ball screw moving along the Z axis; x 5 Y 5 Z 5 Is a table coordinate system, and the origin of the coordinate system is fixedly connected with the center of the table.
The table of the modified D-H parameters for each joint of the sample stage is shown in Table 1.
TABLE 1 improved D-H PARAMETERS OF JOINTS OF SAMPLE TABLE
Wherein theta is 1 The Z-axis rotation angle of the sample stage is represented, a positive value represents reverse rotation, and a negative value represents forward rotation; d 2 Represents X 2 Y 2 The value of the distance between the coordinate plane and the ground changes along with the movement of the Z axis of the sample table, wherein the increase represents the upward movement, and the decrease represents the downward movement; d 3 Indicating movement of the sample stage in the Y-axisDistance, positive values representing movement to the right and negative values representing movement to the left; d 4 The X-axis movement distance of the sample stage is represented, positive values represent forward movement, and negative values represent backward movement; a is 3 Represents the center distance of the X-axis and Y-axis ball screws of the sample stage, in this example, a 3 =150mm。
Each joint variable θ in the present embodiment 1 、d 2 、d 3 、d 4 The ranges of (A) are shown in Table 2.
TABLE 2 Joint variable Range
According to a homogeneous transformation matrix between the i-1 and i coordinate systems of adjacent joints of the sample table:
in the formula of alpha i-1 Represents around X i-1 Axis from Z i-1 The shaft being rotated to Z i The angle of the shaft, i.e. the link torsion angle; a is i-1 Represents along X i-1 Axis from Z i-1 Movement of the shaft to Z i Distance of the shaft, i.e. link length; d i Represents along Z i Axis from X i-1 The shaft being moved to X i Distance of axes, i.e. link distance, theta i Represents around Z i Axis from X i-1 The shaft being rotated to X i The angle of the shaft, i.e. the link angle.
The improved D-H parameters of each level of joint coordinate system of the sample stage are substituted into the formula to obtain a transformation matrix between each level of joint coordinate system、、、As shown in the following formula:
table coordinate system X shown in fig. 8 5 Y 5 Z 5 Moving the joint coordinate system X relative to the X-axis 4 Y 4 Z 4 The change relationship is as follows: coordinate system X 4 Y 4 Z 4 First winding Y 4 The axis rotates 90 degrees counterclockwise and then moves (0,0, t) to the table coordinate system X along X, Y, Z directions of the coordinate system after rotating 5 Y 5 Z 5 And t represents the distance between the center of the X-axis ball screw of the sample table and the table top, and t =150mm in the embodiment. Then coordinate system X 4 Y 4 Z 4 And X 5 Y 5 Z 5 Transformation matrix betweenComprises the following steps:
let the coordinate system of the measured sample be X j Y j Z j Coordinate system X 5 Y 5 Z 5 And X j Y j Z j A transformation matrix of,The mounting position of the tested sample on the table top is specifically determined. The coordinate system of the sample to be measured and the mounting position on the table-board in this embodiment are shown in fig. 9.
Wherein the coordinate of the origin of the coordinate system of the sample to be measured on the table top coordinate system is (40, -75, 0), and the coordinate system X of the sample to be measured j Y j Z j Is in relation to the table coordinate system X 5 Y 5 Z 5 The transformation relationship is as follows: rotated 90 about the Z5 axis. ThenComprises the following steps:
the position of a measured point in a measured sample coordinate system is (x) c ,y c ,z c ) The measured vector is expressed as (x) under the coordinate system of the measured sample v ,y v 0), homogeneous coordinate C = (x) of the position coordinate of the measured point in the coordinate system of the measured sample c ,y c ,z c ,1) T Is measuredHomogeneous coordinate V = (x) of vector under coordinate system of measured sample v ,y v ,0,0) T 。
In this embodiment, there are 16 sets of measured point information, each set of measured information includes the measured point position and the measured vector in the measured sample coordinate system, and the specific measured point information is shown in table 3.
Table 316 set of measured point information
According to the transformation matrix among the plurality of coordinate systems:、、、、、and homogeneous coordinates C and V of the position coordinates of the measured point and the measured vector in the coordinate system of the measured sample can obtain a representation method of the coordinates of the measured point and the measured vector in the base coordinate system, which comprises the following steps:
homogeneous coordinate of measured point coordinate under base coordinateComprises the following steps:
the coordinates of the measured point are expressed as (X) in the base coordinate system c, Y c ,Z c )。
the measured vector is represented as (X) in the base coordinate system v ,Y v ,Z v )。
Example X c ,Y c ,Z c ,X v ,Y v ,Z v Is a parameter (theta) 1 ,d 2 ,d 3 ,d 4 ,x c ,y c ,z c ,x v ,y v ) As a function of (c).
(2) Method for representing diffraction point coordinates and scattering vectors in basic coordinate system
Fig. 10 is a diagram showing a relationship between a diffraction coordinate system and a base coordinate system in a top view direction. With diffraction point as origin and Z in vertical direction m Axis, incident beam direction X m Axis, Y determined by right-hand rule m Axis, can establish a diffraction coordinate system X m Y m Z m 。
Let the coordinates of the origin of the diffraction coordinate system in the base coordinate system be (0,0, z) m ),X 0 The shaft rotates to X m The axial angle is theta, z in the present example m =1400mm, θ = -135 °. Then coordinate system X 0 Y 0 Z 0 And X m Y m Z m Transformation matrix betweenComprises the following steps:
let the diffraction point coordinate be (0,0, 0) in the diffraction coordinate system, and the scattering vector be (x) in the diffraction coordinate system q ,y q 0), the scattering vector in this embodiment is expressed as in the diffraction coordinate system. Then the homogeneous coordinate M = (0,0,0,1) of the diffraction point coordinate in the diffraction coordinate system T Homogeneous coordinate of scattering vector in diffraction coordinate system。
According to the transformation matrixAnd homogeneous coordinates M and Q of the diffraction point coordinates and the scattering vector in a diffraction coordinate system can obtain a representation method of the diffraction point coordinates and the scattering vector in a base coordinate system, which comprises the following steps:
The diffraction point coordinates are expressed as (X) in the base coordinate system m ,Y m ,Z m )。
The scattering vector is then expressed as (X) in the base coordinate system q ,Y q ,Z q ). Example X q ,Y q ,Z q Is a constant value.
Establishing an objective function
During stress measurement, the position coordinates (X) of the measured point c ,Y c ,Z c ) Co-diffraction point coordinates (X) m ,Y m ,Z m ) Alignment, the vector (X) to be measured v ,Y v ,Z v ) Common scattering vector (X) q ,Y q ,Z q ) And aligning, wherein the four joint variables of the sample table are a set of fixed values, when the next measured point is measured, the four joint variables of the sample table are changed, and the absolute values of the changes of the four joint variables in the process are the translation or rotation amount of the corresponding joint.
In the embodiment of the invention, 16 measuring points are used in total, in order to realize the intelligent sequencing of the measured sample measuring points in the neutron spectrometer and improve the measuring efficiency, the minimum movement time of the sample stage is taken as an objective function, and the following objective functions are proposed:
wherein p is 0 Denotes the initial position of the sample stage, R = (p) 1 ,p 2 ,…,p 16 ) Is a set of 16 measured points,representing the sequencing scheme of the final measured points satisfying the objective function in R (a) 1 ,a 2 …,a 16 ) Represents a non-repeated number within the range of 1 to 16,representing the measured pointWhen the position and measured vector of (A) are in the direction of diffraction point and scattering vectorMeasured pointThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,indicating the point to be measured when the sample stage is in the initial positionThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,representing the measured pointAnd measuring the time required by the sample platform to return to the initial position after the measurement is finished.
Suppose v x 、v y 、v z Respectively represent the X-axis, Y-axis and Z-axis moving speed of the sample stage, and omega represents the angular speed of the sample stage rotating around the Z-axis, in this embodiment, the sample stage v x =20mm/s,v y =20mm/s,v z =10mm/s, and the angular velocity ω =6 °/s of the rotation of the sample stage about the Z axis.
wherein、、、Respectively represent the measured pointsWhen the position and the measured vector of (2) are located in the directions of the diffraction point and the scattering vectorThe position and the measured vector of the sample stage are moved to the direction of the diffraction point and the scattering vector, and the X-axis translation amount, the Y-axis translation amount, the Z-axis translation amount and the Z-axis rotation angle of the sample stage are obtained;、、、respectively shows the measured points when the sample stage is at the initial positionThe position and the measured vector of the sample stage are moved to the directions of the diffraction point and the scattering vectorTranslation amount, Z-axis translation amount and Z-axis rotation angle;、、、respectively represent the measured pointsAnd after the measurement is finished, when the sample table returns to the initial position, the X-axis translation amount, the Y-axis translation amount, the Z-axis translation amount and the Z-axis rotation angle of the sample table are measured.
Improved genetic algorithm
In the steps, the neutron spectrometer sample platform is subjected to kinematic modeling, an optimized objective function for intelligently sequencing the measured points of the measured sample of the neutron spectrometer is established, and then the objective function needs to be solved.
The optional embodiment combines some advantages and disadvantages of the genetic algorithm and the practical problem of intelligent sequencing of the measured sample measuring points of the neutron spectrometer to improve the genetic algorithm so as to achieve the aim of the invention.
The neutron spectrometer mainly has the following characteristics when measuring the measuring point stress of a measured workpiece:
(1) the sample table is in the original position when the measurement is started, and the sample table needs to return to the original position after the measurement is finished;
(2) in the stress measurement process, any measuring point on a measured sample is measured once, namely point positions in a measuring path cannot be repeated;
(3) the measured workpiece is a three-dimensional object, and the measuring point positions are widely distributed in the three-dimensional space of the measured workpiece.
The method introduces part of key steps of a genetic algorithm by combining the characteristics of a neutron spectrometer when measuring the stress of a measuring point of a measured workpiece:
(1) and (5) encoding. The measuring point sequence of the measured sample of the neutron spectrometer is used as a chromosome in a genetic algorithm, and the coding mode is very suitable for the problem of path optimization of measurement. In the chromosome coding process, the initial coding point position and the end coding point position are both assigned to be "0", which means that the position of the sample stage needs to return to the initial point before the start of measurement and after the end of measurement, and except for the first and last chromosome coding point positions being "0", other coding point positions are coded by using the measuring point numbers without repetition, so that the chromosome length N = the number of measuring points +2, and the chromosome length N =18 in the optional embodiment.
(2) And (6) selecting operation. The selection is performed using a modified roulette strategy by first ranking the fitness value of each individual in the cohort of the current generation in descending order, where a 1 、a n Respectively the maximum and minimum fitness value in the population, and the fitness a 1 Multiplying by the reward factor omega 1 (ω 1 >1) So that the corresponding individuals can be better reserved in the next generation population; degree of adaptation a n Multiplying by a penalty factor omega 2 (0<ω 2 <1) So that the corresponding individuals are easier to be eliminated, and the convergence of population iteration is improved. See formula:
reward factor omega in this alternative embodiment 1 =1.2, penalty factor ω 2 =0.8。
(3) And (4) performing a crossover operation. Generating a random number for a pair of chromosomes, if the random number is greater than or equal to the crossover probability P c Performing the following crossover operation, otherwise, reselecting a pair of chromosomes from the rest chromosomes to continue generating a random number, and determining whether the crossover operation can be performed, wherein the crossover probability P in the optional embodiment c = 0.8. In the chromosome crossing process, the crossing starting point and the crossing length are randomly generated to improve the populationThe randomness of the algorithm avoids the algorithm from falling into local convergence. If the direct crossing is carried out according to the conventional genetic algorithm crossing principle, repeated coding point positions appear on a chromosome after the crossing is finished, the specific expression of the repeated coding point positions is that a certain measuring point of a workpiece is repeatedly measured, while certain measuring points are not measured, and the chromosome of the coding mode does not conform to the process of measuring stress of a neutron spectrometer sample stage.
Therefore, it is necessary to improve the above-mentioned crossing operation, avoid the duplicate point locations on the chromosome, and after determining the starting point location and the crossing length of the crossing, sequentially perform the crossing operation according to the order of the point locations. Firstly, the first point location is crossed, the other point locations are not changed, and corresponding numbers on non-crossed positions are also exchanged in the crossing process, so that repeated numbers do not appear on a crossed chromosome; and by analogy, until the dot position in the crossing length is crossed completely, repeated coding cannot occur on the whole chromosome, and the actual requirement is met.
(4) And (5) performing mutation operation. Generating a random number for each chromosome if the random number is greater than or equal to the mutation probability P m Then any two positions are taken to exchange the coordinate numbers, P in this alternative embodiment m And = 0.3. This ensures that no repeated coding occurs on the chromosome after mutation.
(5) A fitness function. At present, the optimization problem with the minimum time as the optimization target usually selects the reciprocal of the time used by an individual as the fitness value of the individual, but the fitness value obtained in this way is not proportional to the time, which may cause instability in the solution process. For the embodiment of the present invention, a fitness function is designed as shown in the following formula:
wherein, fitness (i) is the fitness value of the ith individual in the population; t (i) is the corresponding measuring time of the ith individual in the population; minT is the minimum value of the corresponding measurement time of all individuals in the population; maxT is the maximum value of the corresponding measurement time of all individuals in the population; epsilon is a small value to avoid the fitness function being invalid when maxT-minT =0, epsilon =0.0001 in this embodiment.
(6) And (5) an iteration termination condition. The genetic algorithm needs to specify an iteration termination condition in the iterative evolution process, and the currently commonly used iteration termination condition is as follows: presetting a maximum iteration number MAX in advance, counting an iteration number Gen in the iterative evolution process of the genetic algorithm, and if the iteration number Gen is greater than the maximum iteration number MAX, terminating the iteration; when the genetic algorithm reaches the optimal solution or falls into the local optimal solution in advance in the iterative evolution process, the iterative evolution can be continuously carried out under the limitation of the iterative termination condition, and the calculation efficiency is influenced.
Aiming at the defects of the iteration termination condition, the invention improves the original iteration termination condition. The iteration times of which the optimal fitness remains unchanged are set as F, and the maximum iteration times of which the fitness remains unchanged are preset as MAX _ F. The iteration termination condition provided by the invention is as follows: and F is counted in the iterative evolution process of the genetic algorithm, and if the F is larger than MAX _ F, the iteration is terminated.
In summary, the iteration termination condition of the present invention is: the genetic algorithm can terminate the iteration when the iterative evolution process meets any condition of Gen > MAX and F > MAX _ F. Aiming at the improvement of the genetic algorithm, the whole process of the intelligent sequencing of the measured sample measuring points of the neutron spectrometer provided by the invention is used for explaining the embodiment, as shown in fig. 7. Specific steps are introduced as follows for the flowchart:
And 2, initializing the population. Initializing the parameter settings of the genetic algorithm: population number N, chromosome length M, maximum iteration number MAX _ F with constant optimal fitness, and cross probability P c Probability of variation P m (ii) a Importing the position and the direction information of a measured point of a workpiece; the chromosomes are encoded and the original population is randomly generated. In this alternative embodiment, the population number N =100, the chromosome length M =18, the maximum iteration number MAX =500, the maximum iteration number MAX _ F =50 with the optimal fitness remaining unchanged, and the cross probability P c =0.8, probability of mutation P m = 0.3; the position and direction information of the measured point of the workpiece are shown in table 3.
And 3, calculating the fitness value of each chromosome in the population.
And 4, updating the iteration times of which the optimal fitness keeps unchanged.
And 5, carrying out selection operation.
And 6, performing cross operation.
And 7, performing mutation operation.
And 8, updating the iteration times.
And 9, judging whether the termination condition is met. If yes, outputting a final measuring point sequence.
After the above steps, the measurement sequence of 16 sets of measurement points in this alternative embodiment can be obtained as follows: 0- >13- >14- >15- >16- >9- >10- >11- >12- >1- >2- >3- >4- >8- >7- >6- >5- > 0.
Wherein 0 represents the sample stage in situ, 1-16 represents the number of 16 sets of measuring points, and the sequence diagram of the measuring points is shown in FIG. 11. The total time required for completing the movement of the sample stage of the measurement task through the measurement sequence is as follows: for 146 seconds.
The convergence curve for solving the optimal measurement sequence in this embodiment is shown in fig. 12. As can be seen from the convergence graph: the solution efficiency of the scheme on the optimal sequencing is high, and the optimal solution can be converged quickly. The figure shows that the time (optimal fitness) required by the movement of the sample stage is kept unchanged when the genetic algorithm is iterated to about 60 times, and if the iteration termination condition provided by the invention is used, the iteration process of the genetic algorithm can be terminated in advance, so that the calculation time is reduced, and the calculation efficiency is improved.
The embodiment provides the intelligent sequencing method for the measured sample measuring points of the neutron spectrometer, so that the traditional manual measuring point sequencing is replaced, the total moving time of a sample table is reduced, and the measuring efficiency is improved; the solution efficiency of the scheme on the optimal sequencing is high, the optimal solution can be quickly converged, and the technical effect is good.
In this embodiment, an electronic device is provided, comprising a memory in which a computer program is stored and a processor configured to run the computer program to perform the method in the above embodiments.
The programs described above may be run on a processor or may also be stored in memory (or referred to as computer-readable media), which includes both non-transitory and non-transitory, removable and non-removable media, that implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
These computer programs may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks, and corresponding steps may be implemented by different modules.
Such an apparatus or system is provided in this embodiment. The system is called a neutron spectrometer measured sample measuring point sequencing system, and comprises: the representing module is used for representing the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector in the base coordinate system; the processing module is used for taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector; the iteration module is used for taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position; performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes; the calculation module is used for calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the target function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
The system or the apparatus is used for implementing the functions of the method in the foregoing embodiments, and each module in the system or the apparatus corresponds to each step in the method, which has been described in the method and is not described herein again.
The above embodiment has the following features: (1) the technical scheme provided by the embodiment can intelligently sequence the measuring points of the measured sample of the neutron spectrometer, replaces the traditional manual measuring point sequencing, and reduces the experiment preparation time; (2) the technical scheme provided by the embodiment is used for sequencing the measuring points of the measured sample of the neutron spectrometer, and the test is carried out according to the programmed sequencing, so that the total moving time of the sample stage can be reduced, and the measuring efficiency is improved; (3) the technical scheme provided by the embodiment is beneficial to realizing the automatic control of the sample stage of the neutron spectrometer; (4) the basic genetic algorithm is improved in the technical scheme of the embodiment, so that the solving efficiency of the genetic algorithm on the measurement intelligent sequencing problem of the measured sample of the neutron spectrometer can be improved, and the capability of converging to the optimal solution can be improved.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (9)
1. A method for sequencing measured sample measuring points of a neutron spectrometer is characterized by comprising the following steps:
the coordinate of a measured point, a measured vector, the coordinate of a diffraction point and a scattering vector are represented in a base coordinate system;
taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector;
taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position;
performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes;
calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the objective function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
2. The method of claim 1, wherein the objective function is:
wherein p is 0 Denotes the initial position of the sample stage, R = (p) 1 ,p 2 ,…,p N ) For a set of all measured points, N represents the number of measured points, (p) a1 ,p a2 ,…,p aN ) Representing the final measured point sequencing scheme satisfying the objective function in R (a) 1 ,a 2 …,a N ) Represents a non-repeated number within the range of 1 to N,representing the measured pointWhen the position and the measured vector of (2) are located in the directions of the diffraction point and the scattering vectorThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,indicating the point to be measured when the sample stage is in the initial positionThe position of the diffraction point and the time required for the measured vector to move to the direction of the diffraction point and the scattering vector,representing the measured pointAnd measuring the time required by the sample platform to return to the initial position after the measurement is finished.
3. The method of claim 1, wherein the fitness function is:
wherein, fitness (i) is the fitness value of the ith individual in the population; t (i) is the corresponding measuring time of the ith individual in the population; minT is the minimum value of the corresponding measuring time of all individuals in the population; maxT is the maximum value of the corresponding measurement time of all individuals in the population; epsilon is a preset value to avoid the fitness function being invalid when maxT-minT =0.
4. The method of any one of claims 1 to 3, wherein iteratively operating on the chromosome comprises:
each iteration operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes.
5. The method of claim 4, wherein the selecting operation comprises:
the fitness value of each individual in the population of the current generation is arranged from large to small, wherein a 1 、a n Respectively the maximum and minimum fitness value in the population, and the fitness a 1 Multiplying by the reward factor omega 1 (ii) a Degree of adaptation a n Multiplying by a penalty factor omega 2 (ii) a Wherein, ω is 1 >1,0<ω 2 <1。
6. The method of claim 4, wherein the interleaving operation comprises:
generating a random number for a pair of chromosomes, if the random number is greater than or equal to the crossover probability P c And performing crossover operation, otherwise, reselecting a pair of chromosomes from the rest chromosomes to continuously generate a random number, and judging whether crossover operation can be performed.
7. The method of claim 4, wherein the mutation operation comprises:
generating a random number for each chromosome if the random number is greater than or equal to the mutation probability P m Any two locations are swapped for the coordinate number.
8. The method according to any one of claims 1 to 3, wherein the predetermined condition being met comprises:
acquiring a preset maximum iteration number MAX, counting an iteration number Gen in the process of iterative evolution, and if the iteration number Gen is greater than the maximum iteration number MAX, terminating iteration; or, setting the iteration number of which the optimal fitness keeps unchanged as F, acquiring the maximum preset iteration number of which the fitness keeps unchanged as MAX _ F, counting F in the iterative evolution process, and if F is greater than MAX _ F, terminating iteration.
9. The utility model provides a neutron spectrometer measured sample measurement station sequencing system which characterized in that includes:
the representing module is used for representing the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector in the base coordinate system;
the processing module is used for taking the minimum motion time of the sample stage as an objective function, wherein the objective function is used for indicating the motion time of returning to the initial position after the sample stage traverses and moves to each measuring point from the initial position, and the motion time is calculated according to the coordinates of the measured point, the measured vector, the coordinates of the diffraction point and the scattering vector;
the iteration module is used for taking each measuring point sequencing scheme as a chromosome in a genetic algorithm, wherein each chromosome comprises all measuring points in different sequences, an initial point and an end point, and the initial point and the end point are points corresponding to the initial position; performing iterative operation on chromosomes according to the preset iterative times, wherein each iterative operation is to perform selection operation, crossover operation and mutation operation on the previous generation of chromosomes to obtain the next generation of chromosomes;
the calculation module is used for calculating the corresponding fitness of each chromosome in each generation according to a fitness function until the fitness corresponding to the optimal individual in the obtained chromosome meets a preset condition, wherein the fitness function is established according to the target function; and the measuring point sequencing scheme corresponding to the optimal individual is used for measuring the measured sample.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210859831.9A CN115079995B (en) | 2022-07-22 | 2022-07-22 | Method and system for sequencing measured sample measuring points of neutron spectrometer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210859831.9A CN115079995B (en) | 2022-07-22 | 2022-07-22 | Method and system for sequencing measured sample measuring points of neutron spectrometer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115079995A true CN115079995A (en) | 2022-09-20 |
CN115079995B CN115079995B (en) | 2022-11-11 |
Family
ID=83241860
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210859831.9A Active CN115079995B (en) | 2022-07-22 | 2022-07-22 | Method and system for sequencing measured sample measuring points of neutron spectrometer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115079995B (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050074097A1 (en) * | 2003-10-07 | 2005-04-07 | Bruker Axs Gmbh | Method of determining parameters of a sample by X-ray scattering applying an extended genetic algorithm with truncated use of the mutation operator |
US20060188062A1 (en) * | 2005-02-24 | 2006-08-24 | Dileep Agnihotri | Material analysis using multiple x-ray reflectometry models |
CN101206112A (en) * | 2007-12-20 | 2008-06-25 | 中国科学院长春光学精密机械与物理研究所 | Method for measuring nano-scale multilayer film structure |
CN103167840A (en) * | 2010-10-25 | 2013-06-19 | 脱其泰有限责任公司 | Systems, devices, and methods including a dark-field reflected-illumination apparatus |
US20140213909A1 (en) * | 2013-01-31 | 2014-07-31 | Xerox Corporation | Control-based inversion for estimating a biological parameter vector for a biophysics model from diffused reflectance data |
CN107894591A (en) * | 2017-09-30 | 2018-04-10 | 沈阳航空航天大学 | Through-wall radar diffraction tomography method based on compressed sensing |
US20200378745A1 (en) * | 2019-05-28 | 2020-12-03 | University Of Central Florida Research Foundation, Inc. | Iterative Optical Diffraction Tomography (iODT) Method and Applications |
WO2021022637A1 (en) * | 2019-08-06 | 2021-02-11 | 南京赛沃夫海洋科技有限公司 | Unmanned surface vehicle path planning method and system based on improved genetic algorithm |
CN112364528A (en) * | 2020-12-09 | 2021-02-12 | 南京长峰航天电子科技有限公司 | Microwave darkroom multipath effect evaluation algorithm based on genetic algorithm |
CN112580265A (en) * | 2020-12-29 | 2021-03-30 | 南京航空航天大学 | High-precision aerospace shuttle aircraft pressure measuring hole layout method |
CN112797923A (en) * | 2021-01-05 | 2021-05-14 | 上海交通大学 | Method, system and medium for correcting center and Euler angle of particle diffraction image pattern |
CN113866817A (en) * | 2021-09-28 | 2021-12-31 | 中南大学 | Neutron diffraction peak position prediction method, device and medium based on neural network |
CN114004158A (en) * | 2021-11-02 | 2022-02-01 | 西安电子科技大学 | Sea surface electromagnetic scattering prediction method based on genetic algorithm optimization support vector machine |
US20220086372A1 (en) * | 2020-07-23 | 2022-03-17 | University Of Utah Research Foundation | Multi-Modal Computational Imaging via Metasurfaces |
-
2022
- 2022-07-22 CN CN202210859831.9A patent/CN115079995B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050074097A1 (en) * | 2003-10-07 | 2005-04-07 | Bruker Axs Gmbh | Method of determining parameters of a sample by X-ray scattering applying an extended genetic algorithm with truncated use of the mutation operator |
US20060188062A1 (en) * | 2005-02-24 | 2006-08-24 | Dileep Agnihotri | Material analysis using multiple x-ray reflectometry models |
CN101206112A (en) * | 2007-12-20 | 2008-06-25 | 中国科学院长春光学精密机械与物理研究所 | Method for measuring nano-scale multilayer film structure |
CN103167840A (en) * | 2010-10-25 | 2013-06-19 | 脱其泰有限责任公司 | Systems, devices, and methods including a dark-field reflected-illumination apparatus |
US20140213909A1 (en) * | 2013-01-31 | 2014-07-31 | Xerox Corporation | Control-based inversion for estimating a biological parameter vector for a biophysics model from diffused reflectance data |
CN107894591A (en) * | 2017-09-30 | 2018-04-10 | 沈阳航空航天大学 | Through-wall radar diffraction tomography method based on compressed sensing |
US20200378745A1 (en) * | 2019-05-28 | 2020-12-03 | University Of Central Florida Research Foundation, Inc. | Iterative Optical Diffraction Tomography (iODT) Method and Applications |
WO2021022637A1 (en) * | 2019-08-06 | 2021-02-11 | 南京赛沃夫海洋科技有限公司 | Unmanned surface vehicle path planning method and system based on improved genetic algorithm |
US20220086372A1 (en) * | 2020-07-23 | 2022-03-17 | University Of Utah Research Foundation | Multi-Modal Computational Imaging via Metasurfaces |
CN112364528A (en) * | 2020-12-09 | 2021-02-12 | 南京长峰航天电子科技有限公司 | Microwave darkroom multipath effect evaluation algorithm based on genetic algorithm |
CN112580265A (en) * | 2020-12-29 | 2021-03-30 | 南京航空航天大学 | High-precision aerospace shuttle aircraft pressure measuring hole layout method |
CN112797923A (en) * | 2021-01-05 | 2021-05-14 | 上海交通大学 | Method, system and medium for correcting center and Euler angle of particle diffraction image pattern |
CN113866817A (en) * | 2021-09-28 | 2021-12-31 | 中南大学 | Neutron diffraction peak position prediction method, device and medium based on neural network |
CN114004158A (en) * | 2021-11-02 | 2022-02-01 | 西安电子科技大学 | Sea surface electromagnetic scattering prediction method based on genetic algorithm optimization support vector machine |
Non-Patent Citations (2)
Title |
---|
李玉等: "自适应量子遗传算法的遥感图像自动增强", 《光学精密工程》 * |
王琳等: "电子衍射谱仪探测负载惯量优化控制", 《计算机仿真》 * |
Also Published As
Publication number | Publication date |
---|---|
CN115079995B (en) | 2022-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112526927B (en) | Quick optimization compensation method for space positioning error of rotating shaft of five-axis numerical control machine tool | |
Taufik et al. | Role of build orientation in layered manufacturing: a review | |
JP5414902B2 (en) | System and method for optimizing machining simulation | |
CN106052556B (en) | A kind of three coordinate measuring machine spatial domain coordinates compensation method | |
JP5805322B2 (en) | Computer program product and method for generating and simulating an object model | |
CN110500969B (en) | High-gradient complex curved surface in-situ measurement planning method | |
JP2019070916A (en) | Cutting simulation method and device | |
Stojadinovic et al. | Ants colony optimisation of a measuring path of prismatic parts on a CMM | |
CN107817763A (en) | A kind of control method of motion trace, device, laser marking machine and storage medium | |
CN107480356B (en) | Component design and inspection integrated method based on CATIA and laser tracker | |
Dong et al. | An improved signal processing method for the laser displacement sensor in mechanical systems | |
CN112091950A (en) | Robot kinematic parameter identification method based on hybrid genetic simulated annealing algorithm | |
CN115079995B (en) | Method and system for sequencing measured sample measuring points of neutron spectrometer | |
CN116560301A (en) | Machine tool feeding system mathematical model parameter identification method based on gradient optimization | |
CN114995989A (en) | Multi-underwater robot task allocation method and system based on self-organizing neural network | |
Xie et al. | A tool-path planning method used in computer controlled optical surfacing based on improved prim algorithm | |
CN113910001A (en) | Numerical control machine tool space error identification method | |
CN1702824A (en) | Topology simulation system, topology simulation method, and computer product | |
Saadatseresht et al. | Automatic camera placement in vision metrology based on a fuzzy inference system | |
Kang | Specified-duration shapers for suppressing residual vibrations | |
Jywe et al. | Verification and evaluation method for volumetric and positional errors of CNC machine tools | |
JP2003281194A (en) | Optimum design support method for device, optimum design support system for the device and computer program | |
Cai et al. | Face gear generating grinding residual model based on the normal cutting depth iterative method | |
CN117773940B (en) | Absolute positioning error prediction compensation method for industrial robot under multi-factor influence | |
CN117790300B (en) | Dynamic etching compensation method for fine circuit |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |