function err = err(Phi1,M1,Phi2,M2,a,b)
%%Computational error
L = b-a;

err=0;
for l=1:M1
    l2=1+(l-1)*M2/M1;
    err=err+abs((Phi1(1,l)-Phi2(1,l2)).^2)+abs((Phi1(2,l)-Phi2(2,l2)).^2);
    
end
total_prob=sum(abs(Phi2(1, :).^2) + abs(Phi2(2, :).^2) )*L/M2;
err=err*L/M1/total_prob;
err=sqrt(err);
end

