## 2 Methods
### Validation Procedures
#### 2.3.2 System Tests: MMS  
The MMS is a mathematical technique that is typically used for code verification and can be understood as a system test since it checks the formulation [19], which is critical for the features of the application. The MMS consists of choosing (manufacturing) a solution of some (partial differential), calculating the excitation terms by plugging the manufactured solution in the equation, and running the code with that manufactured excitation. Then, the numerical solution provided by the code can be compared with the prescribed manufactured solution.  
More specifically, we can summarize the whole procedure in four steps:  
1. Pick the differential operator \(\mathbf{\mathcal{L}}\) and a function as manufactured solution, \(\mathbf{E}^{\text{mms}}\).
2. Generate \(\mathbf{\mathbf{f}}^{\text{mms}}=\mathbf{\mathcal{L}}\mathbf{E}^{\text{mms}}\).
3. Solve \(\mathbf{\mathcal{L}}\mathbf{E}^{\text{sol}}=\mathbf{\mathbf{f}}^{\text{mms}}\).
4. Compare the numerical results \(\mathbf{E}^{\text{sol}}\) with \(\mathbf{E}^{\text{mms}}\).  
In our case, we use the following norms  
\[\mathbf{\mathbf{e}}_{\text{field}} =\frac{\|\mathbf{E}^{\text{sol}}-\mathbf{E}^{\text{mms}}\|_{2}}{\|\mathbf{E} ^{\text{mms}}\|_{2}}, \tag{15a}\] \[\mathbf{\mathbf{e}}_{\text{rot}} =\frac{\|\mathbf{\
abla}\times\mathbf{E}^{\text{sol}}-\mathbf{\
abla}\times \mathbf{E}^{\text{mms}}\|_{2}}{\|\mathbf{\
abla}\times\mathbf{E}^{\text{mms}}\|_{2}}. \tag{15b}\]  
One of the advantages of MMS is the possibility of testing independently the different terms present in the formulation of the problem, (9). Thus, we can divide the application of MMS into four incremental tests:  
1. \(\mathbf{\mathcal{L}}=\mathbf{I}\) and Dirichlet boundary conditions. We test here the Dirichlet procedure and the third and fourth terms from (9), i.e., Find \(\mathbf{F}\in\mathbf{H}_{0}(\text{curl},\Omega)\) such as: \[\int_{\Omega}\mathbf{F}\cdot\mathbf{E}d\Omega=\int_{\Omega}\mathbf{F}\cdot\mathbf{E}^{\text{ mms}}d\Omega\] (16)
2. \(\mathbf{\mathcal{L}}\) from (1) and Dirichlet boundary conditions. We add now the first term from (9), as in: Find \(\mathbf{F}\in\mathbf{H}_{0}(\text{curl},\Omega)\) such as: \[\int_{\Omega}(\mathbf{\
abla}\times\mathbf{F})\cdot(\mathbf{\
abla}\times \mathbf{E})d\Omega-k_{0}^{2}\int_{\Omega}\mathbf{F}\cdot\mathbf{E}d\Omega=\] (17) \[\int_{\Omega}\mathbf{F}\cdot\Big{[}\mathbf{\
abla}\times(\mathbf{\
abla} \times\mathbf{E}^{\text{mms}})-k_{0}^{2}\mathbf{E}^{\text{mms}}\Big{]}d\Omega\]
3. The same \(\mathbf{\mathcal{L}}\) but now using Neumann instead of Dirichlet boundary conditions, adding the last term from (9). This means: Find \(\mathbf{F}\in\mathbf{H}_{0}(\text{curl},\Omega)\) such as: \[\int_{\Omega}(\mathbf{\
abla}\times\mathbf{F})\cdot(\mathbf{\
abla}\times \mathbf{E})d\Omega-k_{0}^{2}\int_{\Omega}\mathbf{F}\cdot\mathbf{E}d\Omega=\] (18) \[\int_{\Omega}\mathbf{F}\cdot\Big{[}\mathbf{\
abla}\times(\mathbf{\
abla} \times\mathbf{E}^{\text{mms}})-k_{0}^{2}\mathbf{E}^{\text{mms}}\Big{]}d\Omega\] \[-\int_{\Gamma_{N}}\mathbf{F}\cdot(\mathbf{\hat{n}}\times(\mathbf{\
abla} \times\mathbf{E}^{\text{mms}}))d\Gamma_{N}\]
4. We change Neumann to Cauchy boundary condition, where the last term is the same, and we add the second term in (9), testing all the elementary terms from the variational formulation:\[\int_{\Omega}(\mathbf{\
abla}\times\mathbf{F})\cdot(\mathbf{\
abla}\times\mathbf{E})d \Omega-k_{0}^{2}\int_{\Omega}\mathbf{F}\cdot\mathbf{E}d\Omega \tag{19}\] \[+\int_{\Gamma_{C}}(\mathbf{\hat{n}}\times\mathbf{F})\cdot(\mathbf{\hat{n}} \times\mathbf{E})=\int_{\Omega}\mathbf{F}\cdot\Big{[}\mathbf{\
abla}\times(\mathbf{\
abla} \times\mathbf{E}^{\text{mms}})-k_{0}^{2}\mathbf{E}^{\text{mms}}\Big{]}d\Omega\] \[-\int_{\Gamma_{C}}\mathbf{F}\cdot(\mathbf{\hat{n}}\times(\mathbf{\
abla} \times\mathbf{E}^{\text{mms}}))d\Gamma_{C}\]  
Note that this way of application of MMS follows the TDD paradigm since we design tests for small, incremental terms in the formulation.