## 3 Numerical Implementation  
### Numerical Implementation of the D-Bar Algorithm  
We now describe the numerical implementation of the D-Bar algorithm used in this work. All simulations were carried out using EIDORS [19]. We provide the original functions in Matlab\(\circled{0}\) used for this paper as Supplementary Materials along with this paper. Throughout this paper, \(N\) denotes the number of electrodes, while \(M\) denotes the number of linear independent stimulation current patterns. In the setting of EIT, \(M=N-1\) holds true as the maximum number of linear independent current patterns. Note that this is true for the chosen trigonometric current pattern. Different choices of patterns may result in a reduced number of linear independent patterns. An example of a stimulation pattern is given in Figure 1 with a _cosine_ stimulation around a circular domain. The current through each electrode is given by \(cos(8\cdot\Theta_{n})\) (\(n\) denotes the \(n^{th}\) electrode), which is similar to the case \(m=N/2\) in Equation (5) (\(m\) denotes the \(m^{th}\) stimulation pattern). The standard circular domain was used for better visualization. **Step 1**: Compute the DN map \(\Lambda_{\sigma}\) from the voltage measurements and known stimulation currents. \(\Lambda_{\sigma}\) is an operator that can map a given set of boundary voltages to its resulting boundary currents. \(\Lambda_{\sigma}\) is approximated through a matrix \(\mathbf{L}_{\sigma}\) with the dimension \(N-1\times N-1\)[28]. Thus, to map a discrete voltage measurement to its corresponding current stimulation, the vector of voltage measurements on each electrode can be multiplied by \(\mathbf{L}_{\sigma}\) to obtain the corresponding current distribution. We first compute the Neumman-to-Dirichlet (ND) matrix \(\mathbf{R}_{\sigma}\) and then invert it to obtain \(\mathbf{L}_{\sigma}\), because the direct computation of the DN matrix \(\mathbf{L}_{\sigma}\) involves derivatives. Let \(\mathbf{J}\) be the matrix of stimulated current distributions, whose columns contain one stimulation pattern each with the appropriate current on every electrode. \(\mathbf{J}\) is defined as  
\[J_{n}^{m}\ =\ \begin{cases}I\cos(m\Theta_{n}),&m=1,\ldots,N/2-1\\ I\cos(\tau n),&m=N/2\\ I\sin((m-N/2)\Theta_{n}),&m=N/2+1,\ldots,N-1\end{cases} , \tag{5}\]  
where \(m\) is the column index (one specific stimulation), \(n\) is the row index (the electrode position), \(I\) is the current amplitude, and \(\Theta_{n}\) is the position angle of the \(n^{th}\) electrode from the model center. Since the maximum number of linear independent measurements is \(M=N-1\) and the number of electrodes is \(N\), the matrix has a shape of \(N\times N-1=N\times M\). The matrix of voltages measured \(\mathbf{U}\) describes the voltage on every electrode for each stimulation pattern and has the same shape as \(\mathbf{J}\). Each column of \(\mathbf{U}\) contains the voltages measured on the electrodes. The voltage on the \(n^{th}\) electrode for the \(m^{th}\) stimulation pattern is \(u_{n}^{m}\). Regarding the \(m^{th}\) stimulation pattern, the voltages on the electrodes must fulfill \(\sum_{n=1}^{N}u_{n}^{m}\ =\ 0\). \(\mathbf{U}\) can be assembled with \([\mathbf{U}]_{n,m}=u_{n}^{m}\). We also need a geometrical correction term (see Figure 2), which scales each entry of \(\mathbf{R}_{\sigma}\) with the arc length differential, since our domain is not circular. This technique was introduced by [PERSON] et al. [29]. The arc length differential for each electrode position \(n\) and current injection \(m\) is calculated by  
\[s_{n}^{m}=\sqrt{r^{2}(\Theta_{n})\ +\ \frac{r(\Theta_{n})-r(\Theta_{n-1})^{2}} {\Delta\Theta_{n,n-1}}}\cdot\Delta\Theta_{n,n-1}\approx\sqrt{r^{2}(\Theta_{n })\ +\ \frac{\partial r(\Theta_{n})}{\partial\Theta_{n}}^{2}}\cdot d\Theta, \tag{6}\]  
where \(r(\Theta_{n})\) is the radius (distance from model center to electrode) of the model at electrode angle \(\Theta_{n}\). The correction matrix \(\mathbf{S}\) can be assembled by \([\mathbf{S}]_{n,m}=s_{n}^{m}\).