The-genetic-algorithm-VBA-code
Implementing a genetic algorithm to optimize rock cutting tools
Macro program description
The block diagram of the macro program for optimizing the tool geometry parameters depending on the operating conditions and the mechanical drilling speed is shown in Fig. 1.
The macro program performs the following procedures:
- Set the initial version of the tool geometry by setting the values of the parameters X1,. . . , Xn, as well as several options with tool geometry parameters, consisting of random numbers.
- The construction of the tool mesh is performed by substituting the values of the geometric parameters X1 ... Xn.
- Next, the model file system is prepared, where a new finite element mesh of the tool is combined with the main grid of the soil, and a contact surface and other model parameters are created.
Fig. 1. The block diagram of the macro program
- After the model is calculated from the output files, the values of the target functional F are determined, as well as the parameters specified as constraints.
- Then the genetic algorithm gets the value of the functional F and generates a new set of parameters X1,. . . , Xn, after which the step «2» is repeated.
- The calculation will be completed after the specified number of cycle steps has passed.
Fig. 2. The model in Ansys
Fig. 3. One of the realizations of the rock cutting tools