# Finite Element Simulation of HELICOIL(r) Inserts
## 4 Materials and Methods
### Algorithm  
FEAs were performed using the MSC Marc software. Algorithms were created, using an application programming interface (API), as Python scripts. The API was used to improve the functionality of MSC Mentat. We used two modules: the PyMentat module and the PyPost module. The former was used to modify the parameters and monitor thesimulations, while the latter was used to work with a Marc post file. The simulation model can be created independently and imported, or created in the PyMentat module. The entire algorithm was divided into two parts: the screening phase and the identification phase. In this section, the basic framework of the algorithm and the identification phase are described. The screening phase is defined as a set of rules, and its use is tied to the current data. The procedure used in this paper is presented in Algorithm 1, which depends on the initial estimate of the curve, its shape, POF values, and so on. Therefore, the use of rules, and not a complete algorithm, is described here. In the basic framework of the algorithm, the identification phase alternates with the screening phase. The number of these cycles is denoted by \(s\). The phase changes according to the current convergence value \(\varepsilon\) (8) and the minimum convergence rate \(\varepsilon_{min}\). The set of parameters is identified when the objective function value drops to/below the desired value \(f_{L}\). The limit value \(f_{S}\) changes during the solution, and is chosen based on the current values. The current best values are denoted as \(\mathbf{P}^{F}\) and \(f^{F}\). The procedure is described in detail in Algorithm 1. ```
0:\(\mathbf{P}\); \(f_{L}\); \(\varepsilon_{min}\); \(\Gamma()\); \(\mathbf{R}\); \(\hat{\mathbf{Y}}\); \(N^{1}\)
0:\(\mathbf{P}^{F}\)
```
1:\(\mathbf{P}^{F}\leftarrow\mathbf{P}^{0}\leftarrow\mathbf{P}\) \(\triangleright\) Start
2:\(\mathbf{P}^{F},f^{F}\leftarrow\mathbf{P}^{1},f^{\dagger}\leftarrow\mathbf{min }_{\mathbf{P}^{F}=min}f(\Gamma(\mathbf{P}^{0},\mathbf{R}),\hat{\mathbf{Y}})\)\(\triangleright\) Identification phase
3:\(s\gets 1\)
4:\(\mathbf{P}^{*}\gets Add_{1}(\mathbf{P}^{F},N^{1})\); \((f_{S})\)\(\triangleright\) Screening phase
5:while\((Re_{3}(\mathbf{P}^{*},f_{S})\cap Re_{4}(\mathbf{P}^{*},\mathbf{P}^{F}))\
eq \emptyset\)do
6:\(\mathbf{P}^{s+1}=Re_{2}(\mathbf{P}^{F})\cup(Re_{3}(\mathbf{P}^{*},f_{S})\cap Re _{4}(\mathbf{P}^{*},\mathbf{P}^{F}))\)\(\triangleright\) Screening phase
7:\(\mathbf{P}^{F},f^{F}\leftarrow\mathbf{P}^{s+2},f^{s+2}\leftarrow\mathbf{min }_{\mathbf{P}^{F}=min}f(\Gamma(\mathbf{P}^{s+1},\mathbf{R}),\hat{\mathbf{Y}})\); \((f_{S})\)\(\triangleright\) Identification phase
8:\(s\gets s+2\)
9:endwhile
10:while\(f^{F}>f_{L}\)do
11:\(\mathbf{P}^{*}\gets Add_{2}(\mathbf{P}^{F},f_{S})\)\(\triangleright\) Screening phase
12:\(\mathbf{P}^{s+1}=Re_{2}(\mathbf{P}^{F})\cup Re_{3}(\mathbf{P}^{*},f_{S})\)\(\triangleright\) Screening phase
13:\(\mathbf{P}^{F},f^{F}\leftarrow\mathbf{P}^{s+2},f^{s+2}\leftarrow\mathbf{min}_{ \mathbf{P}^{F}=min}f(\Gamma(\mathbf{P}^{s+1},\mathbf{R}),\hat{\mathbf{Y}})\); \((f_{S})\)\(\triangleright\) Identification phase
14:\(s\gets s+2\)
15:endwhile \(\triangleright\) Finish ```
**Algorithm 1** Find \(\mathbf{P}\)  
During the identification phase, the parameter values are searched, but their number does not change. Cycles are denoted as follows: \(a\) represents the total number of FEA cycles for identification, \(b\) represents the number of calculations of the search direction, and \(c\) represents the number of iterative formula calculations for the current search direction. The basic description is given in Section 4.3. An accelerator \(\alpha_{a}\approx\) 0-1 is also used in the algorithm. Universal termination criteria based on the number of computation cycles were used during the testing of this algorithm: \(c_{max}\) is the maximum number of steps to restart the search direction, and \(a_{max}\) is the maximum number of steps to restart Algorithm 2.