# Genetic Algorithm-Based Model Updating in a Real-Time Digital Twin for Steel Bridge Monitoring
## 5 Model Updating and Results
Modal Shape Correlation: The modal assurance criterion (MAC) is employed to evaluate the consistency between real and numerical mode shapes (\(\phi_{real,i}\), \(\phi_{FE,i}\)): \[MAC_{i}=\frac{\left|\phi_{real,i}^{T}\cdot\phi_{FE,i}\right|^{2}}{\left(\phi_{ real,i}^{T}\cdot\phi_{FE,i}\right)\cdot\left(\phi_{FE,i}^{T}\cdot\phi_{FE,i} \right)}\] (5)  
A penalty term \(E_{MAC}=\sum_{i=1}^{n}(1-MAC_{i})\) is then added to the objective function to enforce spatial agreement in mode shapes, preventing erroneous mode-swapping issues common in modal analysis. The combined objective function is expressed as:  
\[J=\alpha\cdot E_{freq}+\beta\cdot E_{MAC} \tag{6}\]  
where \(\alpha\) and \(\beta\) are weighting coefficients that prioritize frequency matching versus modal shape fidelity. The weighting coefficients \(\alpha\) and \(\beta\) in the multi-objective fitness function (Equation (6)) were determined through a sensitivity analysis evaluating different \(\alpha:\beta\) ratios (1:1, 2:1, and 1:2). The 1:1 ratio (\(\alpha=0.5\), \(\beta=0.5\)) minimized both frequency errors (\(RMSE<0.5\) Hz) and modal assurance criterion (\(MAC>0.95\)) errors, providing the best balance between frequency matching and modal shape fidelity. This ratio ensured that neither objective was overemphasized, avoiding overfitting to either frequencies or mode shapes. Consequently, \(\alpha=0.5\) and \(\beta=0.5\) were used for the results presented in this study. The genetic algorithm implementation employs the PyGAD library [28] to drive the optimization process, utilizing its customizable operators for selection, crossover, and mutation to evolve candidate solutions, where each solution represents a unique set of elastic modulus values assigned to predefined bridge components. The hyperparameters used during optimization via PyGAD are reported in Table 3.  
To enhance computational efficiency, the finite element (FE) model in OpenseesPy [27] is automated via scripting: for each candidate solution, the updated elastic modulus values are assigned to relevant bridge elements, a modal analysis is executed, and the resulting natural frequencies and modal assurance criterion (MAC) values are extracted to compute the objective function \(J\). Constraints are imposed to restrict the steel elastic modulus variations to \(\pm 30\%\), ensuring material properties remain physically realistic. This process is further accelerated through parallel computation, which evaluates the fitness of population members across multiple concurrent FE model instances, drastically reducing optimization runtime while maintaining accuracy. The model updating procedure is illustrated in the flowchart in Figure 8. \begin{table}
\begin{tabular}{l c} \hline \hline Number of generations & 1000 \\ \hline Population size & 20 \\ \hline Number of genes & 6 \\ \hline Parent selection type & Tournament \\ \hline K tournament & 3 \\ \hline Cross over type & Two points \\ \hline Mutation type & Random \\ \hline Mutation probability & 0.1 \\ \hline Stop criteria & “Saturate 50” or “reach 1000” \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Hyperparameters adopted in PyGAD application for model updating. Table 4 reports the initial and calibrated elastic modulus of various members of the steel bridge obtained from the model updating procedure using PyGAD v 3.4.0. Table 5 summarizes the comparative analysis of modal parameters--natural frequencies and modal assurance criterion (MAC) values--derived from experimental measurements and finite element models (FEMs) before and after calibration. Post-calibration results demonstrate strong alignment between the updated FEM and experimental data, with frequency discrepancies reduced to less than 5% and MAC values substantially enhanced across all modes. Figure 9 shows the comparison of the MAC values between the initial and calibrated FE models. It highlights a substantial improvement in the accuracy of the numerical model after the updating process.