function [val,seq] = BCSN_temp_analytic(x,y,N)
%

val = 0;
seq = zeros(1,N);
for n = 1:N
    if n>266
        tch = 0;
    end
    term1 = 2*(1-(-1)^n);
%    term2 = n*pi*(exp(n*pi)-exp(-n*pi));
    term2 = n*pi;
    term3 = sin(n*pi*x);
%    term4 = exp(n*pi*y) - exp(-n*pi*y);
    term4a = sinh(n*pi);
    if isinf(term4a)
        term4 = 1;
    else
        term4 = sinh(n*pi*y)/sinh(n*pi);
    end
    val = val + term1*term3*term4/term2;
    seq(n) = val;
end
