Telecominfraproject / oopt-gnpy

Optical Route Planning Library, Based on a Gaussian Noise Model
http://telecominfraproject.com
BSD 3-Clause "New" or "Revised" License
203 stars 88 forks source link

EDFA NF from polynomial fit #118

Open ojnas opened 5 years ago

ojnas commented 5 years ago

In the _calc_nf method in the EDFA class, for the advanced model, the average NF is evaluated from target gain and polynomial coefficients like this:

nf_avg = polyval(self.params.nf_fit_coeff, -dg)

where dg should be the difference between target gain and (average) design-flat gain but is calculated like this:

dg = max(self.params.gain_flatmax - gain_target, 0)

So for target gain > design-flat gain dg will be 0 and average NF will be constant. It this really a correct model? I think the polynomial fit should be valid for any target gain and dg should simply be calculated as:

dg = self.params.gain_flatmax - gain_target

dutc commented 5 years ago

Thank you for this feedback! @jeanluc-auge is putting together some comments and will provide feedback after the TIP Summit.

jeanluc-auge commented 5 years ago

Hi, thank you for your comments and taking the time to check the code. This is not a bug, and I stand by this implementation.

ojnas commented 5 years ago

@jeanluc-auge, thinking a bit more about this, I have larger issues with the EDFA model. Your reasoning above applies to variable gain EDFAs (with internal VOA). I think an "advanced model" should be able to model any type of EDFA. For example, fixed gain EDFAs (without internal VOA) typically specifies a gain range as well as an optimal flat gain between gain_max and gain_min. So three gain parameters would be needed instead of the two (gain_min and gain_flatmax) that are currently allowed. For such an EDFA, the tilt is a function of the gain (e.g. represented by the dgt - dynamic gain tilt) and it is not possible to set a tilt target independently of the gain.

In the current code, distinction between fixed_gain, variable_gain and "advanced model" is only done when calculating NF, not when calculating gain profile. I think this is confusing since it does not represent what is normally meant with fixed vs. variable gain EDFAs.

ojnas commented 5 years ago

Two more questions related to this:

  1. There is a hard-coded parameter TARGET_EXTENDED_GAIN in the select_edfa function. Shouldn't the extended gain range rather be specified per type_variety in eqpt_config.json?

  2. The fact that the gain starts to tilt when entering the extended gain range does not seem to be implemented in the code, or do I miss something?

jeanluc-auge commented 5 years ago
  1. The target_extended gain range is now parametrizable in the Span (eqpt_config.json) from the last Roadm equalization PR. But you are right it could make sense to have it specified in each amp type variety.
    1. I need to check too