Automatically Differentiating a Two-dimensional Finite-Difference Time-Domain Program.




Numerical simulations of electromagnetic phenomena are increasingly becoming the starting point of further scientific investigations. Examples include assessing the robustness of a given simulation code, fitting parameters of a computer model to experimental data, or designing an appropriate computer model of a technical system. Derivatives play an important role in these analyzes. Rather than using numerical differentiation based on divided differencing, we sketch the transformation of a simulation code written in MATLAB into a new MATLAB program capable of evaluating the derivatives without truncation error.