function CoefficientAmpPlot(A)
% CoefficientAmpPlot(A)
% A - Opening Ratio in %
% This function plots the coefficient of amplification of the model.

% Global Variables initialized.
i=1;
j=1;
O = 0; %Incident Wave Direction

% ND1
T = [1.25 1.5 1.75 2 2.25 2.5 3]; %Wave Period (s)

for k = 1:length(A)
    for i = 1:length(T)
        if A(k) == 0.5 && T(i) == 1.25
        Eta2(i,k) = NaN;
        else
        [Eta2(i,k)] = PeakElevation(8,T(i),A(k),O);
        Eta2(i,k) = Eta2(i,k)/0.08;
        end
        L = SolveDispersionEquation(1.36,T(i),1);
        ND1(i) = L/0.225;
    end
    disp(k)
end

% ND2

H = [5 6.5 8 9.5 11 14]; %Wave Height (Cm)

for k = 1:length(A)
    for i = 1:length(H)
        [Eta1(i,k)] = PeakElevation(H(i),2,A(k),O);
        Eta1(i,k) = 100*Eta1(i,k)./(H(i)); %100 for conversion. H is expressed as cm, but Eta1 is expressed in meters.
        ND2(i) = (H(i)/100)/0.225;
    end
end

acon = aconfig('LineWidth',2,'Colormap',[0 0 0],'MarkerSize',10,'LineStyles','o:|x:|s:|d:|+:','FontSize',20,'fontWeight','bold','Grid',1);
afigure(acon)
subplot(2,1,1)
aplot(ND2,Eta1)
axis([0.2 0.7 0 2])
ylabel('$${C_a}$$','interpreter','latex')
xlabel('H/D','interpreter','latex')
ax = gca;
set(ax,'FontSize',20,'fontWeight','bold','ticklabelinterpreter','latex');

lab1 = '$\alpha = 0.5 \%$';
lab2 = '$\alpha = 0.7 \%$';
lab3 = '$\alpha = 1.0 \%$';
lab4 = '$\alpha = 1.5 \%$';
lab5 = '$\alpha = 2.0 \%$';

legend(lab1,lab2,lab3,lab4,lab5,'Interpreter','latex')
legend('boxoff')

subplot(2,1,2)
aplot(ND1,Eta2)
axis([10 50 0 2])
ylabel('$${C_a}$$','interpreter','latex')
xlabel('L/D','interpreter','latex')
ax = gca;
set(ax,'FontSize',20,'fontWeight','bold','ticklabelinterpreter','latex');

lab1 = '$\alpha = 0.5 \%$';
lab2 = '$\alpha = 0.7 \%$';
lab3 = '$\alpha = 1.0 \%$';
lab4 = '$\alpha = 1.5 \%$';
lab5 = '$\alpha = 2.0 \%$';

legend(lab1,lab2,lab3,lab4,lab5,'Interpreter','latex')
legend('boxoff')
end