% test the Dirichlet matrix
clear
L=1;
N = 8;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(1) = v(N-1)+pi^2;
Err(1) = v(N-2)+4*pi^2;

N = 16;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(2) = v(N-1)+pi^2;
Err(2) = v(N-2)+4*pi^2;

N = 32;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(3) = v(N-1)+pi^2;
Err(3) = v(N-2)+4*pi^2;

N = 64;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(4) = v(N-1)+pi^2;
Err(4) = v(N-2)+4*pi^2;

N = 128;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(5) = v(N-1)+pi^2;
Err(5) = v(N-2)+4*pi^2;

N = 256;
M = DirichletMatrix(N,L);
v = sort(eig(M));
err(6) = v(N-1)+pi^2
Err(6) = v(N-2)+4*pi^2

err(1:5)./err(2:6)
Err(1:5)./Err(2:6)

