% The disorder function in real space
% Input: 
%   D - vector of k-valued disorder
%   u - the value of point in real space to be evaluated
%   eta - dimensionless string velocity
%   lambda - string length
%   order - when is set to 0 then D(u) is returned, when is set to 2 D''(u)
%   is returned

function Du = realDis(D,u,order)
    N = length(D);
    sum = 0.5;
    for n = 1:N-1;
        k = 2*pi*n/N;
        if order == 0
            sum = sum + cos(k*u)*D(n);
        elseif order == 2
            sum = sum + cos(k*u)*k^2*D(n);
        end
    end
    
    Du = sum/N;
