4 Numerical experiments
4.1 A Poisson problem
The first model problem that we consider is a 2D parametric Poisson problem: find such that
with , , , . Here, f and g are such that the exact solution u of (1.6) is given by
In this case, controls the amplitude of the solution, the size of its support, its position on the -axis, and its stretching along the latter. We consider the optimization problem (1.4), with . We assume that observed values are available at given points , . In order to validate the algorithm, we start by setting an optimal value and , .
To ensure that the values are not all close to zero, the measure points are chosen randomly with uniform distribution in the set . For direct computations, we use a neural network constructed and trained as described in Section 2. The training set is composed by data coming from 4000 finite element simulations, and the training of the network takes around 2.5 hours in this case. For more details on the building and training of the network, we refer to [3].
4.1.1 Results with the particle-swarm optimization method
Table 1.1 illustrates the mean value of the computed μ, as well as the standard deviation over a sample of 10 realizations of the PSO algorithm. The measure points are chosen randomly in at the beginning of each realization of the algorithm; they thus differ from one realization to the other. The algorithm has always stopped before reaching the maximum number of iterations.
Table 1.1Results of the PSO algorithm, for , , , , and various values of .
| (exact) | (computed) |
| (5.5,5.5,550,1.15) | (5.50,5.50,551,1.15)±(0.000356,0.00799,0.463,0.000668) |
| (8.5,1,1000,0.3) | (8.50,0.935,988.5,0.293)±(0.000371,0.00638,5.10,0.000712) |
| (1.5,1,100,2) | (1.50,1.22,102,2.01)±(0.0130,0.107,5.02,0.0629) |
| (5,1,1000,2) | (5.00,1.01,1001,2.00)±(0.00145,0.00412,1.81,0.00209) |
| (5,10,100,0.3) | (5.00,10.2,104,0.306)±(0.000679,0.336,2.86,0.00336) |
| (5,10,1000,1) | (5.00,9.99,1002,1.00)±(0.000657,0.0199,1.15,0.000480) |
Note that the parameter in the first line of Table 1.1 is at the center of . All the other parameters lie on the boundary of , and are therefore more challenging to recover. We notice that, even in these extreme cases, is recovered with good accuracy and small variability among calculations. Figure 1.1 shows the evolution of the cost functional (1.4) during the iterations of the PSO algorithm, for 10 realizations of the algorithm and different . For each parameter, three distinct phases are observed during the PSO algorithm: first, the particles explore the parameter space and the cost functional decreases only slowly. Then particles all converge toward the (approximated) optimal parameter, and the cost functional drops drastically, before finally oscillating around the optimal parameter in a stationary manner. Note that for the cost remains relatively high (around 10). This is explained by the fact that this parameter corresponds to the solution with the highest amplitude and the strongest gradients, being thus one of the most challenging to capture correctly with the neural network. For this model problem, the PSO algorithm typically takes around to converge. Note that no finite element simulations are performed during the optimization algorithm.

Figure 1.1 Evolution of the cost functional during the PSO iterations, for different parameters ( , , ).
4.1.2 Results with the gradient method
In order to compare the performance of the PSO and gradient descent algorithms, we test the gradient approach using the same parameters as in the previous section. The mean and the standard deviation of the recovered parameters over 10 realizations of the algorithm are reported in Table 1.2, for , , , and . Note that the parameters are more accurately recovered with the PSO algorithm.
Table 1.2Results of the gradient algorithm, for , , , , and various values of .
| (exact) | (computed) |
| (5.5,5.5,550,1.15) | (5.51,6.04,584,1.19)±(0.0134,0.668,0.89.5,0.0998) |
| (8.5,1,1000,0.3) | (7.29,0.887,981,0.355)±(1.07,0.177,131,0.0842) |
| (1.5,1,100,2) | (1.50,1.06,93.5,1.95)±(0.0220,0.220,13.0,0.110) |
| (5,1,1000,2) | (5.00,0.642,849,1.85)±(0.0201,0.267,103,0.0991) |
| (5,10,100,0.3) | (5.16,9.05,105,0.332)±(0.821,1.37,12.2,0.0647) |
| (5,10,1000,1) | (5.00,8.63,971,0.978)±(0.0166,0.879,74.3,0.0486) |
Figures 1.2 and 1.3 show the evolution of the cost functional during the gradient iterations. We observe that the gradient method is efficient in terms of convergence speed. However, as illustrated in Figure 1.2, the method does not always converge toward the global minimum when the initial guess is too far from the solution ( ). Actually the method requires an initial guess that is very close to the optimal solution for the method to converge and lacks robustness for particular values of the parameters . Figure 1.3 illustrates that effect for a given value of and several values of γ.

Figure 1.2 Evolution of the cost functional during the gradient iterations, for different parameters ( , , ).

Figure 1.3 Evolution of the cost functional during the gradient iterations, for different values of γ and ( , ). From left to right: .
Therefore, for these robustness reasons, we favor the PSO approach in the next numerical experiments. Note that a PSO method can be afforded as long as the evaluation of F—and thus —is not too costly. This is the case for the kind of neural networks used here.
4.2 A hyperbolic problem
We consider a parametric transport equation in two dimensions of space and set . Given , the problem consists in finding satisfying
together with the initial condition for all and , with and . The vector field a is chosen such that there is no inflow boundary, and thus no boundary condition to enforce. We consider , , , and we set and .
In this particular case, is a parameter ruling the velocity, characterizes the size of the support of the initial condition , and is a regularization parameter for the initial condition. As before, we assume that observed values are available at given points , , and that there is no noise in the measurements. We start by choosing in the objective function (1.4). To ensure that the values allow to recover the optimal parameter, the points are chosen randomly with uniform distribution in the set . For direct computations, we use a neural network constructed and trained as in Section 2. See [2] for more details.
Numerical results are illustrated in Table 1.3, for two different numbers of measure points and different . As for the elliptic problem, we report the mean value and the standard deviation of the computed μ over a sample of 10 realizations of the PSO algorithm, with the measure points changing from one realization to the other. Note that all parameters , except the first one, lie on the boundary of , and should therefore be more challenging to capture accurately. In each case, the algorithm has stopped before reaching the maximum number of iterations.
Table 1.3Results of the PSO algorithm, for , , , and various values of .
| (exact) | (computed) |
| (1.25,0.225,100) | (1.25,0.225,107)±(0.00106,0.000327,13.2) |
| (2,0.3,50) | (2.00,0.300,52.1)±(0.00187,0.000958,3.21) |
| (2,0.15,100) | (2.00,0.150,113)±(0.00261,0.000823,8.56) |
| (0.5,0.3,50) | (0.498,0.302,55.2)±(0.00584,0.00459,22.9) |
| (1,0.2,150) | (1.01,0.209,134)±(0.0273,0.0255,25.3) |
| (0.5,0.15,150) | (0.500,0.151,136)±(0.000745,0.000828,12.3) |
| (1.25,0.225,100) | (1.25,0.225,100)±(0.0000964,0.0000404,0.746) |
| (2,0.3,50) | (2.00,0.300,53.4)±(0.00142,0.000384,5.35) |
| (2,0.15,100) | (2.00,0.150,109)±(0.000451,0.000168,4.37) |
| (0.5,0.3,50) | (0.496,0.302,47.3)±(0.00206,0.00254,5.58) |
| (1,0.2,150) | (1.00,0.201,138)±(0.000731,0.00310,21.3) |
| (0.5,0.15,150) | (0.501,0.152,128)±(0.00395,0.00512,9.66) |
We note that and are recovered with good accuracy for all the parameters that we tested. Nevertheless, we observe in some cases less accurate recovery and/or large variability among calculations for the parameter ruling the size of the boundary layer. This lack of accuracy may come from the error introduced by the neural network approximation and/or from the low number of observations in the boundary layer around the initial condition. Furthermore, we see that, as expected, the larger the number of observations ( ), the smaller the standard deviation of the results.
In order to increase the accuracy of the recovered , we investigate whether a -based objective function is more efficient to capture the sharp gradients in the boundary layer. Thus, we consider the cost functional (1.4) with .
Numerical results for are shown in Table 1.4. We note that the choice of a cost functional indeed allows in most cases to capture more accurately and to reduce the variability across calculations. The uncertainty that remains in the recovery of is explained by the fact that this parameter corresponds to the function with the smallest support and the steepest boundary layer, making it hard to capture exactly by the neural network.
Table 1.4Results of the PSO algorithm, for , , , , and various values of .
| (exact) | (computed) |
| (1.25,0.225,100) | (1.25,0.225,103)±(0.00290,0.00150,7.27) |
| (2,0.3,50) | (2.00,0.299,51.3)±(0.00107,0.000302,1.12) |
| (2,0.15,100) | (2.00,0.149,104)±(0.000424,0.000124,2.70) |
| (0.5,0.3,50) | (0.495,0.301,50.9)±(0.00226,0.00147,1.96) |
| (1,0.2,150) | (1.00,0.200,148)±(0.000148,0.0000729,4.38) |
| (0.5,0.15,150) | (0.500,0.151,134)±(0.000216,0.000605,9.03) |
Figure 1.4 shows the evolution of the cost functional during the iterations of the PSO algorithm, for 10 realizations of the algorithm and different . The cost functional evolves in a very similar way to the elliptic model problem, with three distinct phases. Note that for and , the parameters are accurately recovered, but the cost functional stagnates above , mainly due to error introduced by the neural network approximation. For this model problem with , the PSO algorithm typically takes around when and when .

Figure 1.4 Evolution of the cost functional during the PSO iterations, for different parameters . , , , .
4.3 An elliptic problem with more parameters
Finally, we choose as a last numerical experiment the elliptic problem
As in [9], we take , , and consider and , with
where , , are the four first eigenpairs of the Karhunen–Loève expansion of a 1D Gaussian random field of covariance . We refer to [9] for an illustration of the basis functions . Figure 1.5 shows the solution corresponding to different parameters μ.

Figure 1.5 Left: Snapshot of an averaged solution . Right: Cut of the solutions along the diagonal for various parameters μ.
We truncate the expansion of a at , , and (corresponding to the eigenpairs , for , resp.), obtaining thus three different networks , , and . To train the latter, 3000 finite element simulations are performed, which takes around 7 hours offline. The training of the networks then take around 11 hours offline in the three cases.
Unlike the first two test cases, no analytical solution is known for the problem (1.8). For each of the three sizes of expansion, we therefore use the finite element solution computed on a very fine grid (with mesh size ) as the exact solution to generate the data .
In the sequel, we compare the performances of the PSO algorithm for the different expansions and different number of measures points and number of particles.
Table 1.5 reports the mean value ± the standard deviation of the objective function F and the CPU time, computed over 50 realizations of the algorithm, performed with randomly chosen parameters. We observe that the performances of the algorithm are not significantly impacted as the dimension of the parameter space is increased. Similarly, the time taken by the algorithm to converge naturally depends on the number of observation points and of particles, but only weakly on the dimension of the parameter space.
Table 1.5Average performances of the PSO algorithm, for different number of observations , number of particles and different sizes of expansion .
| F | [s] | |||
| 4 | 100 | 100 | 9.07±3.18 | |
| 1000 | 32.9±12.0 | |||
| 400 | 100 | 17.43±7.55 | ||
| 1000 | 124±48.8 | |||
| 9 | 100 | 100 | 11.8±3.80 | |
| 1000 | 45.1±13.1 | |||
| 400 | 100 | 24.9±8.43 | ||
| 1000 | 171±36.7 | |||
| 16 | 100 | 100 | 12.6±4.14 | |
| 1000 | 53.4±15.9 | |||
| 400 | 100 | 28.1±8.06 | ||
| 1000 | 184±56.5 |
Table 1.6 illustrates, for and , the mean value ± the standard deviation of the error committed on each component of the parameters μ. We observe that the last components of the parameter become more and more difficult to recover accurately. This is easily explained as those components correspond to the basis functions that are more oscillatory and have smaller amplitude.
Table 1.6Average error for each component of the targeted parameter μ and different sizes of expansions .
| 4 | 9 | 16 | |
Finally, Table 1.7 illustrates, similar to the other experiments, for , , , and different targeted parameters , the parameters returned by the PSO algorithm.
Table 1.7Results of the PSO algorithm, for , , , , and various values of .
| (exact) | (computed) |
| (0.866, 0.866, 0.866, 0.866, 0.866, 0.866, 0.866, 0.866, 0.866) | (0.869, 0.866, 0.861, 0.866, 0.861, 0.860, 0.865, 0.845, 0.848) ± (0.00154, 0.00371, 0.00505, 0.0166, 0.00921, 0.0104, 0.0282, 0.0251, 0.100) |
| (−0.957, −0.0973, 0.114, 0.144, −1.17, 1.30, −1.44, −0.904, 0.663) | (−0.955, −0.0999, 0.111, 0.150, −1.17, 1.30, −1.45, −0.923, 0.623) ± (0.00141, 0.00460, 0.00785, 0.0165, 0.00987, 0.00957, 0.0500, 0.0293, 0.0733) |
| (1.73, 1.73, 1.73, 1.73, 1.73, 1.73, 1.73, 1.73, 1.73) | (1.73, 1.71, 1.72, 1.67, 1.71, 1.73, 1.67, 1.79, 1.80) ± (0.00164, 0.00468, 0.00353, 0.0255, 0.0142, 0.0118, 0.0314, 0.219, 0.147) |
| (1.73, 1.73, −1.73, 1.73, −1.73, −1.73, −1.73, 1.73, 1.73) | (1.74, 1.72, −1.73, 1.71, −1.75, −1.75, −1.74, 1.72, 1.81) ± (0.00265, 0.00524, 0.00473, 0.0220, 0.0171, 0.0136, 0.0422, 0.0541, 0.155) |
| (0, 0, 0, 0, 0, 0, 0, 0, 1.73) | (0.00135, −0.0079, −0.00370, 0.00798, 0.00753, −0.00182, 0.00857, 0.0126, 1.65) ± (0.00155, 0.00565, 0.00409, 0.00812, 0.0107, 0.00863, 0.0288, 0.0356, 0.0369) |
We note that the algorithm allows to recover a good approximation of the parameter overall. As already underlined above, the components of the parameter become harder to capture accurately as the corresponding basis functions become more oscillatory and of smaller amplitude. Finally, we note that the value of the cost functional is lower than for the first two test cases. This can be explained by the fact that the solution u has much higher amplitude in the first test case and exhibits boundary layers that are hard to capture correctly in the second test case, whereas the solution is much smoother and has smaller amplitude for this last experiment. Figure 1.6 shows the evolution of the cost functional for 10 iterations of the PSO algorithm and different . We note that the evolution is similar to the one observed for the first two test cases, and thus does not depend significantly on the dimension of the parameter space.

Figure 1.6 Evolution of the cost functional during the PSO iterations, for different parameters . , .