frequency = 3e9;
lambda = 3e8/frequency;
antenna_spacing = lambda/2;
x_number = 10; y_number = 10;z_number = 10;
axis = cell(x_number*y_number*z_number,1);
for i = 1:x_number
    for j = 1:y_number
        for k = 1:z_number
            axis{(i-1)*y_number*z_number+(j-1)*z_number+k} = [i*antenna_spacing,j*antenna_spacing,k*antenna_spacing];
        end
    end
end

[kernel_matrix] = kernel_calculate(frequency,axis,"ball");

eigen_value = eig(kernel_matrix);
eigen_value = flip(eigen_value);
eigen_value = eigen_value/eigen_value(1);

[kernel_matrix1] = kernel_calculate(frequency,axis,"sphere");

eigen_value1 = eig(kernel_matrix1);
eigen_value1 = flip(eigen_value1);
eigen_value1 = eigen_value1/eigen_value1(1);

[kernel_matrix2] = kernel_calculate([frequency,frequency-frequency/20],axis,"sphere_shell");

eigen_value2 = eig(kernel_matrix2);
eigen_value2 = flip(eigen_value2);
eigen_value2 = eigen_value2/eigen_value2(1);

[kernel_matrix3] = kernel_calculate([frequency,frequency-frequency/3],axis,"sphere_shell");

eigen_value3 = eig(kernel_matrix3);
eigen_value3 = flip(eigen_value3);
eigen_value3 = eigen_value3/eigen_value3(1);

x = 1:20:x_number*y_number*z_number;
close all
plot(x,eigen_value(1:20:end),'-s','color','red','Linewidth',1.5,'markersize',4)
hold on
plot(x,eigen_value3(1:20:end),'-o','color','m','Linewidth',1.5,'markersize',4)
hold on
plot(x,eigen_value2(1:20:end),'-+','color','green','Linewidth',1.5,'markersize',4)
hold on
plot(x,eigen_value1(1:20:end),'-^','color','blue','Linewidth',1.5,'markersize',4)
grid on
xlabel('Eigenvalue Index','Interpreter','latex','FontSize',14);
ylabel('Eigenvalue','Interpreter','latex','FontSize',14);
legend('ball','sphere thick shell','sphere thin shell','sphere surface','Interpreter','latex')
