# Bayesian Optimal Experimental Design for Race Tracking in Resin Transfer Moulding
## 6 Bayesian Optimal Experimental Design
### Method  
We have \(N\in\mathbb{N}\) sensors; we wish to place them within the mould so that when considering all potential permeability scenarios, the variance in parameters is minimised. One way to achieve this is to determine the covariance matrix for a variety of permeability scenarios with a sensor setup \(S\). Then, we aim to minimise the sum of these covariance traces, which is known as A-optimality [33; 34; 35; 36; 37; 38; 39; 40]. In essence, this is minimising the following cost function:  
\[\min_{S}\sum_{i=1}^{M}\text{tr}(\Gamma_{\text{post}}^{S}(k_{i})), \tag{42}\]  
where \(M\) is the number of permeability scenarios considered and \(\Gamma_{\text{post}}^{S}(k_{i})\) is the posterior covariance for the permeability scenario \(k_{i}\) and sensor design \(S\). A-optimality is appealing for this problem, where we could be interested in using the MAP permeability estimate to predict future resin flow and want minimal uncertainty in each individual estimate. Common alternatives, such as D-optimality or E-optimality [33], would consider the off-diagonal elements of the posterior covariance, which are not as relevant for this situation. To simplify this problem, potential sensor locations will be limited to discrete locations spaced 0.025 m apart throughout the domain, resulting in 697 potential locations. When considering that the possible number of locations for \(N\) sensors is \(697^{N}\), we will limit the optimisation to follow a greedy decision process [36; 39]. That is, the optimal location for the first sensor will be found, and then the second sensor will be optimally placed, given that the first is fixed. The process will be repeated for all \(N\) sensors. Sensors are also prohibited from occupying the same position. An advantage of the greedy algorithm is that the optimal design for \(N\) sensors gives us the optimal design for all \(n<N\) sensors. Despite reducing the computation time significantly with a greedy algorithm, the computation for solving this problem is still extremely intensive. Determining the MAP estimate by optimisation took 1-2 h on a standard desktop computer (12 th Gen Intel Core i7-12700 \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \(c_{1}\) & \(c_{2}\) & \(c_{3}\) \\ \hline Truth & \(-0.141\) & \(0.531\) & \(-1.758\) \\ Prior & \(0.000\pm 1.500\) & \(0.000\pm 2.121\) & \(-0.144\pm 1.500\) \\ Posterior (2 Sensor) & \(-0.128\pm 0.034\) & \(0.537\pm 0.036\) & \(-1.731\pm 0.076\) \\ Posterior (10 Sensor) & \(-0.127\pm 0.020\) & \(0.533\pm 0.015\) & \(-1.747\pm 0.034\) \\ \hline  & \(\alpha_{1}\) & \(\alpha_{2}\) & \(\alpha_{3}\) \\ \hline Truth & \(3.737\) & \(2.824\) & \(2.189\) \\ Prior & \(2.000\pm 4.243\) & \(2.000\pm 4.243\) & \(2.000\pm 4.243\) \\ Posterior (2 Sensor) & \(3.751\pm 0.421\) & \(2.612\pm 0.166\) & \(2.093\pm 0.563\) \\ Posterior (10 Sensor) & \(3.653\pm 0.254\) & \(2.605\pm 0.196\) & \(2.067\pm 0.379\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Figures 4 and 5 summarised in a table. Confidence intervals are 99% based on 3 standard deviations. CPU, no GPU acceleration). For more complex geometries and finer meshes, this time can significantly increase. Solving this inverse problem \(M\) times for each sensor location will take \(697M\) times longer for every sensor. Although this could be parallelised, this would still take too long (potentially years) to receive a solution in a reasonable amount of time. As a computationally feasible approximation [39], we use:  
\[\boldsymbol{\Gamma}^{\prime}_{\text{post}}=(\boldsymbol{\mathcal{J}}^{T}_{ \text{true}}\boldsymbol{\Gamma}^{-1}_{\epsilon}\boldsymbol{\mathcal{J}}_{\text {true}}+\boldsymbol{\Gamma}^{-1}_{k})^{-1}, \tag{43}\]  
where \(\boldsymbol{\mathcal{J}}^{T}_{\text{true}}\) is the Jacobian of the forward model evaluated at \(\boldsymbol{k}_{\text{true}}\). This is in contrast to Equation (31), where now we use the Jacobian evaluated at \(\boldsymbol{k}_{\text{true}}\) for the current sample, instead of evaluating it at the MAP estimate.