## 2 Materials and Methods
Training data comes from subsequent states of the system in dynamic step-by-step simulation. Therefore, the built ANN must be used only in hybrid simulations with the same time step as set in dynamic FE simulation. Figure 2: Considered mechanical system: (**a**) idea of the interface between subsystems; (**b**) division for hybrid simulation. If the time course of the excitation forces \(\mathbf{F}(t)\) is exactly known _a priori_, the ANN can be trained based on FE simulations with the same force-time course. If \(\mathbf{F}(t)\) is ambiguous, the ANN can be trained for different variations assuming that they are finite and of a relatively small number. In other cases, \(\mathbf{F}(t)\) should be parametrized, and training data are generated for different sets of discrete values of parameters. For example, if \(\mathbf{F}(t)\) only has one non-zero element \(F_{0}(t)\) acting sinusoidally,  
\[F_{0}(t)=A\cdot\sin(\omega\cdot t), \tag{5}\]  
with amplitude in range \(A\in[A_{\text{min}},\,A_{\text{max}}]\) and circular frequency \(\omega\in[\omega\,_{\text{min}},\,\omega\,_{\text{max}}]\), \(n\times m\) dynamic FE simulations should be performed for every combination of \(A_{i}\in[A_{\text{min}},\,A_{\text{max}}]\) and \(\omega_{j}\in[\omega\,_{\text{min}},\,\omega\,_{\text{max}}]\), where \(i\) = 1,2,...,\(n\) and \(j\) = 1,2,...,\(m\). A similar approach is used for simulating input \(\mathbf{r}^{\mathbf{P}}(t)\). In principle, hybrid simulation is utilized for structures where the physical subsystem is difficult or impossible to model numerically. Therefore, dynamic FE simulations cannot imitate the behavior of \(\mathbf{\Omega}^{\mathbf{P}}\). Limit values of the nonlinear stiffness of the physical subsystem must be assumed: \(\mathbf{K}^{\mathbf{P}}\in[\mathbf{K}^{\mathbf{P}}\,_{\text{min}},\,\mathbf{K }^{\mathbf{P}}\,_{\text{max}}]\). A set of \(s\) dynamic FE simulations should be performed for every \(\mathbf{K}^{\mathbf{P}}_{k}\), where \(k\) = 1,2,...,\(s\). For example, concerning Equation (5), \(n\times m\times k\) simulations would be performed to generate the training data. ANNs have the ability to generalize; therefore, by training them using linear FE simulations, they will be able to perform nonlinear hybrid simulations. There is no unambiguous rule determining what architecture of ANN should be chosen for a given model for hybrid simulation. The trial and error method should be used in which architecture of the smallest possible number of neurons (that meets accuracy requirements) should be chosen--minimization of computational cost and the risk of overfitting the network. The author's experience is that two-layer feed-forward networks with sigmoid hidden neurons and linear output neurons often work well if properly trained--they mimic the FE model behavior with high accuracy and are resistant to noise. The most important problem with training the ANN using known algorithms (Levenberg-Marquardt [28; 29], Bayesian Regularization [30; 31], Scaled Conjugate Gradient [32; 33]) is that even if the ANN is trained resulting with high correlation and low error between outputs and reference data (divided to training, validation, and testing data), the ANN does not show convergence when working in recurrence during hybrid simulation. When outputs from ANN become its inputs in subsequent time steps, the common problem is that the results become inconsistent with reality either by large error or lack of convergence when \(\mathbf{u}^{\mathbf{I}}\rightarrow\pm\infty\). In order to solve this problem and obtain minimal architecture of the network, the author proposed to build and train the ANN according to the algorithm presented in Figure 3. The algorithm is dedicated to ANNs with one hidden layer, and extending it to networks with a greater number of hidden layers is trivial. Before starting the process, the minimum number of neurons in hidden layer \(N_{min}\) (in most cases \(N_{min}\) = 1) and a maximum number of attempts \(n\) to train the same architecture should be set.