## 3 Numerical Implementation
### Numerical Implementation of the D-Bar Algorithm
As can be seen in  
Figure 1: Visualization of one stimulation pattern. \(\Omega\) surrounded by the thick black circle denotes the domain of interest. The red line indicates the current depending on the angle \(\Theta\). The dashed gray line denotes a current amplitude of zero. Note that this is not the domain used in this paper, but a standard circular domain for better visualization of the concept. Equation (6), \(s_{n}^{m}\) is independent of \(m\). This is because the geometry does not change with each current stimulation. The results are then formed to a vector, which is repeated \(M\) times to form the \(N\times M\) matrix \(\mathbf{U}\). \(\mathbf{R}_{\sigma}\) can be calculated with the help of \(\mathbf{J}\), \(\mathbf{U}\), and \(\mathbf{S}\) through  
\[\mathbf{R}_{\sigma}=\frac{1}{A}(\mathbf{J}\odot\mathbf{S})^{T}\mathbf{U}. \tag{7}\]  
\(A\) denotes the electrode area, while \(\odot\) is the elementwise multiplication and \({}^{T}\) represents the transpose. The last step is to invert \(\mathbf{R}_{\sigma}\) to finally obtain the DN matrix \(\mathbf{L}_{\sigma}~{}=~{}\mathbf{R}_{\sigma}^{-1}\). The calculation steps for the DN matrix can be efficiently performed in Matlab(r) through matrix multiplication. **Step 2**: Calculation of the scattering transform. The scattering transform can be viewed as a complex Fourier transformation. Instead of Equation (A5), we use an approximation of the scattering transform \(t^{exp}(k)~{}=~{}\int_{\partial\Omega}e^{i\vec{k}z}(\Lambda_{\sigma}~{}-~{} \Lambda_{1})e^{i\vec{k}z}ds\), which can be calculated according to [PERSON] and Mueller [30]: The functions \(e^{i\vec{k}z}|_{\partial\Omega}\) and \(e^{i\vec{k}z}|_{\partial\Omega}\) need to be expanded in their orthonormalized current pattern basis. The coefficients used are \(\vec{\epsilon}(k)~{}=~{}[c_{1}(k),\dots,c_{N}(k)]^{T}\) for \(e^{i\vec{k}z}\) and \(\vec{\mathbf{d}}(k)~{}=~{}[d_{1}(k),\dots,d_{N}(k)]^{T}\) for \(e^{i\vec{k}z}\). The coefficients are calculated with  
\[\vec{\epsilon}(k)~{}=~{}\mathbf{J}^{\prime}e^{i\vec{k}z}~{}and~{}\vec{\mathbf{d}}(k) =\mathbf{J}^{\prime}e^{i\vec{k}z}. \tag{8}\]  
The exponential approximation of the scattering transform is then expressed by  
\[\mathbf{t}^{exp}(k) \approx \sum_{i=1}^{N-1}\sum_{j=1}^{N-1}c_{j}(k)d_{i}(k)(\mathbf{L}_{\sigma}( i,j)~{}-~{}\mathbf{L}_{1}(i,j)) \tag{9}\] \[= \vec{\mathbf{d}}^{T}(k)\Big{(}\big{(}\mathbf{L}_{\sigma}~{}-~{}\mathbf{L}_{1 }\big{)}\vec{\epsilon}(k)\Big{)}. \tag{10}\]  
The scattering transform represents the data in a frequency-like complex-valued space called the \(k\)-_space_. Unlike the Fourier transformation, which is linear, in the sense that it represents a function through sinusoidal waves, the scattering transform represents the input via nonlinear waves. \(\mathbf{t}^{exp}(k)\) is only evaluated for values of \(|k|<R\), where \(R\) is called the truncation radius. This is due to the fact that high values of \(|k|\) lead to numerical instabilities. An example of the \(k\)-space for a specific conductivity enclosure and \(|k|<3.5\) can be observed in Figure 3.  
For the implementation of this computational step, a grid in the k-space has to be implemented. This becomes important, as choosing the grid wisely helps in the computation of the next step. In this work, we chose the strategy of [PERSON] and [PERSON], which is  
Figure 2: Visualization of the finite element method model with the electrode position in cyan and domain boundary in blue. \(r(\Theta_{1})\) and \(r(\Theta_{2})\) are the positional angles of the first and second electrodes. The angle difference \(\Delta\Theta_{2,1}\) is needed for the calculation of the derivative in Equation (6). presented in Chapter 15 of their book [28], for the selection of the grid. This strategy was used in this work. In the next step of the D-Bar algorithm, a singularity arises in the origin in the \(k\)-space. For the computations inside the \(k\)-space, a matrix \(K\) is formed. It has the shape \(P\times P=2^{p}\times 2^{p}\).