# Green Scalar Function Method for Analyzing Dielectric Media
## 2 Theoretical Background
### Discretization of the Equations  
Consider the Helmholtz scalar equation applied to the electric field and applied to a Green scalar function  
\[\
abla^{2}E(\mathbf{r})+k_{0}^{2}\varepsilon_{B}E(\mathbf{r})=-k_{0}^{2}\Delta \varepsilon(\mathbf{r})E(\mathbf{r}) \tag{8}\]  
\[\Big{(}\
abla^{2}+k_{0}^{2}\varepsilon_{B}\Big{)}g(\mathbf{r},\mathbf{r^{\prime}})=- \delta(\mathbf{r},\mathbf{r^{\prime}}) \tag{9}\]  
where \(\Delta\varepsilon(\mathbf{r})=\varepsilon(\mathbf{r})-\varepsilon_{B}\) is the dielectric contrast, indicating the difference in dielectric permittivity between the object \(\varepsilon(\mathbf{r})\) and the background \(\varepsilon_{B}\). The procedure followed toobtain the scattered pattern is analogous to the one described in Section II.A of [25] except that we address the scalar case. On the other hand, if we introduce Equation (9) into Equation (8), electric field \(E(\mathbf{r})\) can be obtained by  
\[E(\mathbf{r})=E^{(1)}(\mathbf{r})+\int_{V}g(\mathbf{r},\mathbf{r}^{\prime})\cdot k_{0}^{2} \Delta\varepsilon(\mathbf{r}^{\prime})E(\mathbf{r}^{\prime})d\mathbf{r}^{\prime} \tag{10}\]  
where the integration is calculated over the whole volume of the chosen simulated region and \(E^{(1)}(\mathbf{r})\) refers to the incident electric field. The circumstance to be solved that may arise in the study of a reduced volume is the singularity \(|\mathbf{r}-\mathbf{r}^{\prime}|\to 0\). Therefore, when \(\mathbf{r}\approx\mathbf{r}^{\prime}\), the singularity can be avoided if we exclude that infinitesimal element of volume \(\delta V\) where this singularity is found. We can then treat this singularity separately, rewriting Equation (10) as  
\[E(\mathbf{r})=E^{(1)}(\mathbf{r})+\lim_{\delta V\to 0}\int_{V-\delta V}g(\mathbf{r},\mathbf{r}^{ \prime})\cdot k_{0}^{2}\Delta\varepsilon(\mathbf{r}^{\prime})E(\mathbf{r}^{\prime})d \mathbf{r}^{\prime}-L\cdot\frac{\Delta\varepsilon(\mathbf{r})}{\varepsilon_{B}}E(\bm {r}) \tag{11}\]  
where \(L\) is a scalar term derived from the dyad \(\mathbf{L}\)[25] which depends on the geometry of the excluded volume \(\delta V\). Thus, in our work, the observation point \(\mathbf{r}\) is located outside the dispersive medium or \"scatterer\", whose position is given by \(\mathbf{r}^{\prime}\). To solve Equation (11) numerically, we must first define a grating of \(N\) nodes which represents the system. Each node \(i\) will be centered in a position \(\mathbf{r}_{i}\) and will present a volume \(V_{i}\) if we are in 3D or an area in 2D and a value of dielectric contrast. Following, electric field \(E_{i}=E(\mathbf{r}_{i})\) must be discretized as well as scalar Green's function \(g_{i,j}=g(\mathbf{r}_{i},\mathbf{r}_{j})\). \[E_{i}=E_{i}^{(1)}+\sum_{ \begin{subarray}{c}j=1\\ j\
eq i\end{subarray} }^{N}g_{i,j}\cdot k_{0}^{2}\Delta\varepsilon_{j}E_{j}V_{ j}+M_{i}\cdot k_{0}^{2}\Delta\varepsilon_{i}E_{i}-L\cdot\frac{\Delta\varepsilon_{i}}{ \varepsilon_{B}}E_{i}\hskip 28.452756 pti=1,\ldots,N \tag{12}\]  
and  
\[M_{i}=\lim_{\delta V\to 0}\int_{V_{i}-\delta V}g(\mathbf{r}_{i},\mathbf{r}^{\prime})d\mathbf{r}^{\prime} \tag{13}\]  
Throughout the implementation of the codes and simulations, it has become clear that the terms where the scalar Green's function or the geometric factor \(L\) appears, these prevail over \(M_{i}\). However, many authors for more complex geometries than the ones we will deal with in the project show that the \(M_{i}\) term is more relevant than the \(L\) term \(E_{i}\) as in [25]. Equation (12) represents a linear system of equations that can be solved with simple numerical methods. Expressing the system of equations in the form  
\[E_{i}^{(1)}=E_{i}\cdot\left[1-M_{i}k_{0}^{2}\Delta\varepsilon_{i}+L\frac{ \Delta\varepsilon_{i}}{\varepsilon_{B}}\right]-\sum_{ \begin{subarray}{c}j=1\\ j\
eq i\end{subarray}