# Data-Driven Identification of Crane Dynamics Using Regularized Genetic Programming
## 2 Materials and Methods
### Genetic Operators  
There are two types of variation operators in G3P-SR, crossover, and mutation. The crossover operator \(Y_{X}:\mathcal{I}\times\mathcal{I}\to\mathcal{I}\times\mathcal{I}\) is a stochastic binary operator that takes two individuals \(p_{i1}^{j}\) and \(p_{i2}^{j}\) and outputs two new individuals \(\overset{\gamma j+1}{p_{i1}}\) and \(\overset{\gamma j+1}{p_{i2}}\). The variation operators are performed on the derivation tree: in subtree crossover parent trees, \(p_{i1}^{j}\) and \(p_{i2}^{j}\) are selected, a nonterminal node \(A\in p_{i1}^{j}\) is selected, and the derivation tree \(p_{i2}^{j}\) is searched for a nonterminal node that matches the nonterminal node selected in \(p_{i1}^{j}\). If no  
Figure 1: Derivation tree for function \(x_{1}x_{2}+x_{1}\).  
such node exists, no crossover occurs and the resulting children are clones of their parents; otherwise, \(A\in p_{i2}^{j}\) is selected and the subtrees below the selected nodes are swapped. The second type of crossover used in G3P-SR is similar to the high-level crossover used in MGGP [29]. The high-level crossover is a uniform crossover in which 1 to \(k_{max}\) trees comprising the individual are selected with equal probability and swapped, where \(k_{max}\) is a hyperparameter which limits the number of trees which can be crossed over in a single high-level crossover operation. It is important that the number of trees selected for both parents be equal, which is a difference between high-level crossover in G3P-SR and MGGP, so that the number of model terms in the individual remains constant. Figure 2 is an illustration of how the model terms are swapped during high-level crossover and the subtrees of the model terms are swapped during subtree crossover.  
The mutation operator \(Y_{M}:\mathcal{I}\rightarrow\mathcal{I}\) is a stochastic unitary operator that takes the individual \(p_{i}^{j}\) and perturbs it to output a new individual \(\widetilde{p}_{i}^{j+1}\). In subtree mutation, a parent tree \(p_{i}^{j}\) is selected, a nonterminal node \(A\in p_{i}^{j}\) is selected, and a new tree is randomly generated with the root node of the randomly generated tree matching the nonterminal node selected from \(p_{i}^{j}\). The subtree below the selected node of \(p_{i}^{j}\) is deleted and replaced with the newly generated tree. In point mutation, a terminal node is selected and replaced with another terminal node while making sure that the resulting offspring is syntactically correct. Figure 3 shows an illustration of subtree and point mutation.  
Since the individual in G3P-SR is composed of multiple model terms represented by trees, there is a selection process not only for the individual from the population but also a selection of the model terms that will undergo subtree crossover, subtree mutation, or point mutation. The model terms are selected from each parent with a probability that is proportional to its coefficient to bias the variation step [30]. In order to obtain the probability of selecting a model term, the coefficients are first normalized using (3) and then the probability of model term \(i\) being selected is given in (4).  
\[\overline{\theta_{i}}=\frac{\sum_{i=1}^{d}\lvert\theta_{i}\rvert-\lvert\theta _{i}\rvert}{\sum_{i=1}^{d}\lvert\theta_{i}\rvert} \tag{3}\]  
Figure 3: Mutation operators: (**a**) subtree mutation and (**b**) point mutation.  
Figure 2: Crossover operators: (**a**) high-level crossover and (**b**) subtree crossover.  
\[P=\frac{\exp\overline{\theta_{i}}}{\sum_{i=1}^{d}\exp\overline{\theta_{i}}} \tag{4}\]