I'm trying to simulate self focusing in  the case of anomalous dispersion and positive Kerr nonlinearity in the nonlinear Schrdinger equation $\frac{\partial a}{\partial t} -  i\frac{\partial^2 a}{\partial z^2} + i\epsilon|a|^2a = 0$.Here $t$ is time and $z$ is a spatial coordinate (Though I guess it doesn't really matter). I set $\epsilon$ to be 50 just to make sure that I am above the critical power. In order to simulate the wave propagation, I use the split step method applied on initial Gaussian pulse. I  implemented it in a MATLAB code as follows:N = 512000;                 % Number of Fourier modedt = .001;                  % Time steptfinal = 10;                % Final timeM = round(tfinal./dt);      % Total number of time stepsL = 500;                    % Total space lengthh = L/N;                    % Space stepn =( -N/2:1:N/2-1)';        % Indicesx = n*h;                    % Grid pointsu = exp(-(x/2).^2);         %Intial pulsek = 2*n*pi/L;               % wavenumber values.epsilon = 50;               % nonlinear coefficientfor m = 1:1:M               % Start time loop    plot(x, abs(u), 'o');    axis([-10 10 0 max(abs(u))]);    pause(0.05);    % Here are split step steps.    u = exp(dt*1i* epsilon *(abs(u).^2)).*u; % Propagate non-linear part of NLSE    c = fftshift(fft(u));                % Take Fourier transform    c = exp(-dt*1i*k.^2 ).*c;            % Advance in Fourier space    u = ifft(fftshift(c));               % Fourier transform back to Physical SpaceendNo matter how I change the values of the code, the initial pulse starts to focus and then it get dispersed after a while. I tried to change the resolution in both spatial and frequency domain, it didn't help. Is there something wrong with my code, or maybe the split step method breaks under certain conditions?
Split step method applied on nonlinear Schrodinger equation does not result in self focusing
matlab;nonlinear programming