SignalLambda = 1550;
PumpLambda = 1480;
LaunchPowerPump = -2;
LaunchPowerSignal = 20;

% -------------------------------------------------------------------------
% relation between the SRS penalty and the fiber attenuation
% -------------------------------------------------------------------------

axis_x = [0:0.5:20]; % ;
axis_z = [0.2:0.005:0.35];
axis_y_simple = zeros(max(size(axis_z)),max(size(axis_x)));
axis_y_detailed = zeros(max(size(axis_z)),max(size(axis_x)));

% calculate the SRS penalty versus the fibre attenuation ...
i=0;
for att = 0.2:0.005:0.35
    [Result_simple,attS,attP] = SRS_power_penalty(att,'c','min',axis_x,LaunchPowerSignal,LaunchPowerPump,SignalLambda,PumpLambda,true);
    [Result_detailed,attS,attP] = SRS_power_penalty(att,'c','min',axis_x,LaunchPowerSignal,LaunchPowerPump,SignalLambda,PumpLambda,false);
    axis_y_simple(i+1,:) = Result_simple(2,:);
    axis_y_detailed(i+1,:) = Result_detailed(2,:);
    i = i + 1;
end

axis_y_delta = axis_y_simple-axis_y_detailed;
axis_y_delta_relative = abs(axis_y_delta)./axis_y_detailed*100;

% prepare the charts with the presentation of signal penalty as a function
% of the transmission distance and the launch power for the video overlay

axisYLabel = 'Fiber attenuation at 1550 nm [dB/km]';

figure(1);
handle0 = surface(axis_x,axis_z,axis_y_simple);
title('Signal penalty for simplified model');
view(-45,45);
xlabel('Transmission distance [km]');
ylabel(axisYLabel);
zlabel('SRS induced penalty [dB]');
ylim([min(axis_z) max(axis_z)]);
grid on;
axis square;
set(gcf,'Color','w');

figure(2);
surface(axis_x,axis_z,axis_y_detailed)
title('Signal penalty for exact model');
view(-45,45);
xlabel('Transmission distance [km]');
ylabel(axisYLabel);
zlabel('SRS induced penalty [dB]');
ylim([min(axis_z) max(axis_z)]);
grid on;
axis square;
set(gcf,'Color','w');

figure(3);
surface(axis_x,axis_z,axis_y_delta)
title('Signal penalty difference between the exact and simplified model');
view(-45,45);
xlabel('Transmission distance [km]');
ylabel(axisYLabel);
zlabel('Signal penalty delta [%]');
ylim([min(axis_z) max(axis_z)]);
grid on;
axis square;
set(gcf,'Color','w');



