# Model Updating of a Freight Wagon Based on Dynamic Tests under Different Loading Scenarios
## 5 Calibration
### Optimization  
The optimization of the numerical models (unloaded and loaded configurations) was performed using an iterative methodology based on a genetic algorithm. The implemented strategy relied on the interaction between two commercial softwares, MATLAB [60] and ANSYS [55], as presented in Figure 13.  
Firstly, in ANSYS, a numerical model was developed based on a set of initial numerical parameters randomly generated by the Latin hypercube method, considering the bounds of each individual parameter presented in Table 2. After, a numerical modal analysis was performed to evaluate the natural frequencies and mode shapes, which are exported to MATLAB through text files. In MATLAB, the mode pairing between numerical and experimental mode shapes was performed, associating each experimental mode with the correspondent numerical mode based on the highest MAC value. Finally, a new set of numerical parameters was estimated by means of a genetic algorithm aiming to minimize the residuals of an objective function. This process was repeated until the maximum number of iterations was reached. This stopping criterion has already been used in other similar applications of GA, since, typically, there have been small improvements on the residual of the objective function in the last generations, even in situations where apparently no upgrades were verified in the previous generations [24; 31]. Figure 12: Spearman correlation matrix: (**a**) unloaded configuration, (**b**) loaded configuration. The optimization aimed to find the optimal values of the numerical parameters based on the modal responses. The level of agreement between numerical and experimental modal responses was evaluated based on the following objective function (_f_):  
\[f=a\sum_{i=1}^{5}\left|\frac{f_{i}^{exp}-f_{i}^{num}}{f_{i}^{exp}}\right|+b\sum_{ i=1}^{5}\left|1-MAC(\phi_{i}^{exp},\phi_{i}^{num})\right| \tag{2}\]  
where \(a\) and \(b\) are the residuals weights, \(f_{i}^{exp}\) is the vibration frequency of the \(i\)th experimental mode, \(f_{i}^{num}\) is the vibration frequency of the \(i\)th numerical mode and \(MAC(\phi_{i}^{exp},\phi_{i}^{num})\) is the MAC value between the \(i\)th numerical and experimental modal configurations. The value of the weights \(a\) and \(b\) are assumed equal to 1.20 and 0.80, respectively, which gave more importance to the frequency residues. These weights consider the importance of each of the residues and the uncertainty that is associated with the experimental estimation of their dependent responses. Typically, the natural frequencies are more rigorously estimated than the mode shapes, and therefore its residues should have a higher weight [61]. The iterative process started with an initial population of 30 individuals, randomly generated by the Latin hypercube method, whose size has been maintained over 100 generations, totaling 3000 individuals. Each individual of the genetic algorithm is formed by a set of genes in correspondence with the numerical parameters of the optimization problem. The genetic algorithm requires some specific definitions for the selection crossover and mutation operators. The selection operator was based on the stochastic universal sampling (SUS) technique proposed by [PERSON] [62]. This technique defines a line, in which each of the possible parents occupy a space proportional to its fitness. After, the algorithm moves along the line in equally spaced steps, where the step length is equal to the line length divided by the number of individuals to be selected. The position of the first step is chosen randomly between zero and the step length. For each step location, a parent is selected based on the corresponding section of the line. Concerning the crossover, a scattered crossover operator was used. This operator relies on the random generation of a binary vector with the same number of genes of the parents. Each gene (i.e., numerical parameter) of the offspring is defined based on  
Figure 13: Model calibration strategy.