## 4 Calculation of Potential at Measurement Points Position  
For stress-strain analysis, thermal analysis, and now analysis of flow through a porous medium, we used PAK (Program za Analizu Konstrukcija, engl. Software for Structure Analysis), a Multiphysics FEM software developed at the engineering software laboratory at the Faculty of Engineering, University of Kragujevac, Serbia. The implementation of in-house developed software allowed us full access to source code and to improve the program with the algorithms and equations presented in this paper. The PAKS module [48] of PAK-Multiphysics was used for stress-strain analysis, while PAKT was used for thermal analysis [49], and the recently developed module PAKV was used for the analysis of groundwater flow through porous media. These programs were modified to calculate and print numerical values at the measuring points (Figure 9). The input file, pakp.dat, for the PAKV program contains all of the finite element data about the model (nodes, elements, material characteristics, boundary conditions, etc.) and an identifier indicating whether or not to read the measurement points, the locations of which were saved in the file PIJEZ.DAT. Figure 8: Part of PIJEZ.DAT file. Figure 7: FEM model of dam with highlighted elements of measured points. Figure 9: A flow chart of the PAKV/PAKT/PAKS programs. The potential/temperature at the location of the measuring point is calculated in the print subroutine and written to the file pijeznivoPAK.CSV. The potential/temperature at the measuring point (\(\varphi_{M_{p}}\)) is calculated by interpolation based on the potential/temperature in the nodes of the element in which it is located and the local coordinates of the measuring point according to Equation (8):  
\[\varphi_{M_{p}}=\sum_{i=1}^{10}h_{i}\varphi_{i} \tag{8}\]  
The variable definitions are as follows:  
\(h_{i}\)--is the interpolation functions given in Table 1,  
\(q_{i}\)--is the potential/temperature in the node \(i\). The potential values at the measuring points are printed in the file pijeznivoPAK.csv, which contains the designation of the measuring point and the potential. Points 4 and 5 in the flow chart in Figure 9 are part of the calibration phase. The calibration procedure was performed using a hybrid procedure of the FE model and existing neural networks described in [50; 51], as depicted in Figure 10.  
The calibration of the FE model was carried out through multi-criteria optimization to minimize the deviation between calculated and observed values for the selected set of parameters. The genetic NSGA-II algorithm was used for multi-criteria optimization. The input data for neural network training consisted of a limited set of possible combinations of FE model parameters. It was necessary to test the trained neural network with combinations of model parameters that were not used during training. Therefore, additional FE calculations should be performed by randomly selecting parameters. New combinations are generated, and the results of the FE calculations are compared with those given by the neural network. If the results align with the desired accuracy, the trained neural network is used to calibrate the model parameters. Otherwise, the network is re-trained using different parameter ranges or with a different number of hidden neurons. Once trained, the neural network is used for calibrating model parameters instead of the FE model. For known observed quantities (temperature, potential, etc. ), populations are created with individuals that contain the values of the parameters to be calibrated. The evaluation of individuals is performed by calculations on the neural network, rather than the FE model. The goal is to minimize the difference between the calculated and observed values defined through the calibration criterion. When the convergence criterion is met, the best individual contains the calibrated values of the FEM model parameters. Stationary analysis was used to calibrate the filtration coefficients (PAKV).