# Exploratory Study of a Green Function Based Solver for Nonlinear Partial Differential Equations
## 3 Numerical Implementation
### The Numerical Transposition of the Integral Scheme
#### 3.2.3 Non-Homogeneous Terms
Operating with the nonlinear Schrodinger Equation [71] we recover,  
\[ \begin{split}\mathbf{i}\Psi_{t}=-\frac{1}{2}\Psi_{xx}+Q\Psi| \Psi|^{2}\ \frac{\Psi_{x}=u+\mathbf{i}v_{x}}{\left\{\begin{aligned} u_{t}=- \frac{1}{2}v_{xx}+Qv_{x}.\left(u^{2}+v^{2}\right)\\ v_{t}=+\frac{1}{2}u_{xx}+Qu\left(u^{2}+v^{2}\right)\end{aligned} \right.},\\ \Psi(x,0)=u_{0}(x)+\mathbf{i}v_{0}(x)=\phi_{0}\frac{\mathrm{Exp }(\mathbf{i}u_{e}x)}{\mathrm{Cosh}(\sqrt{Q}\phi_{0}x)},\quad\phi_{0}=\sqrt{ \frac{u_{e}^{2}-2u_{e}u_{p}}{Q}}\end{split}  \tag{60}\]  
where we have introduced already the initial condition that produces the traveling wave solution, \(\Psi(x,0)\). Furthermore, the parameters \(P,Q,u_{e},u_{p}\) are the standard parameters for soliton solutions as described in [70]. Hence, we have a crossed diffusion problem, where real part diffuses towards the imaginary one and vice versa, producing the pulsating behavior of the equation. Moreover,  
Figure 9: Temporal evolution (**left**) for the Burgers viscid equation test case under a non-constant transport coefficient over a homogeneous grid of \(N=100\), a stencil with \(q=9\), a timestep \(\tau=10^{-4}\) and a characteristic diffusion of \(10^{-5}\) and a comparison (**right**) between the direct error of the numerical norms of the evolution, following the definition from (59). we have a production term due to the potential \(\left|\Psi\right|^{2}\) that will inject or destroy information into the time evolution of the problem depending on the modulus of the wave function, controlling the growth and the norm of its evolution. These production terms are also found on chemical advection-diffusion-reaction equations and, due to their high variability in time and their control over some of the conserved quantities of the problem tend to be cumbersome to deal with, see [72]. Additionally, for the nonlinear Schrodinger equation, the energy of the system must be also a conserved quantity according to [PERSON]'s theorems [70], as a result we will have, apart from the general shape of the function, two numerical magnitudes that will serve as indicators of the quality of the time propagation scheme,  
\[n(t)=\sum_{i=-N}^{N}\Delta x^{\prime}\left|\Psi(x_{i},t)\right|^{2},\ \ e(t)=\sum_{i=-N}^{N} \Delta x^{\prime}\Big{(}\left|\Psi_{x}(x_{i},t)\right|^{2}-\left|\Psi(x_{i},t )\right|^{4}\Big{)}, \tag{61}\]  
where the primes over the grid step indicate that the first and last points are multiplied only by half \(\Delta x\). We present in Figure 10 the temporal evolution of the wave function, the real and imaginary parts of which oscillate measured with each other in order to produce the same soliton envelope as its modulus. It is important to recall that, for imaginary diffusion the standard choices for to the numerical parameters are no longer applicable as the Green function is no longer a Gaussian. Nonetheless, we can still take profit of the Taylor series expansion to _avoid_ this problematic and hold the same methodology we have introduced up to now. The only affection will be at the CFL and the stability, indeed, if we look back at Equation (60) the diffusion is now imaginary, and one component diffuses into the other and viceversa. This is why we need to go to time steps as low as \(10^{-12}\) to achieve a reasonable order of magnitude over the error of the conserved magnitudes, therefore increasing the computational cost of the whole simulation. While the order of magnitude of one time step is still the same as the one of the previous subsections, i.e., \(10^{5}\) for high order stencils and \(N\approx 10^{3}\), to reach a dimensional time where we can appreciate the evolution of the initial condition we require several order of magnitude of iterations. This is why the RK scheme for this application is critical as it allow to reduce significantly the number of iterations, up to two orders of magnitude according to the numerical experiments performed.