function [f,x,g] = FBgaussian2(N,beta,a)
%function [f,x,g] = FBgaussian(N,beta,a,gamma) obtiene la aproximacion Fourier-Bessel del perfil gaussiano
%Para que la raiz la obtengamos en 1, que ser´a los que nos interesara gamma se calcula a partir de beta.

%gamma = 1/(exp(1/beta)-1)
gamma=0;

[As,alphas] = coefAs(N,beta,a);

k=1;

for x=0:0.01:a
    B=0;
    for i=1:1:N
        B = B + ((1+gamma)*As(i) - 2*gamma/(a*alphas(i)*besselJ(1,a*alphas(i))))*besselJ(0,alphas(i)*x);
    end
    
    f(k) = B;
    g(k) = (1+gamma)*exp(-x^2/beta)-gamma;
    k=k+1;
end
x=0:0.01:a;    