Correct design: apply saturation in all cases

Previously saturation was not checked during design if amp type was set.
This commit also applies saturation for these amplifiers.

This changes some of the autodesign result (since range for selection
is changed). For example, this changes some of the gains, or type variety
of amplifier of test files.

The commit also removes one of the rounding in the design phase, and
applies rounding only for printing purpose.

It also adds minor refactor on a function

In order to keep power sweep behaviour in case of saturation, the saturation
check in amplifier element uses initial power targets set by user instead
of a possible autodesign delta_p result.

Note that gain_mode is unchanged: design in gain mode means that delta_p
is set to None during the build process, even if the user defined a value
in operational.delta_p.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Idc5cfc8263cf678473acb6ec490207d9d6ba5c0a
This commit is contained in:
EstherLerouzic
2022-03-16 16:54:54 +01:00
parent 41d9d156a6
commit 3510d59250
6 changed files with 49 additions and 50 deletions

View File

@@ -856,7 +856,12 @@ class Edfa(_Node):
"""in power mode: delta_p is defined and can be used to calculate the power target
This power target is used calculate the amplifier gain"""
pref = spectral_info.pref
if self.delta_p is not None:
if self.delta_p is not None and self.operational.delta_p is not None:
# use the user defined target
self.target_pch_out_db = round(self.operational.delta_p + pref.p_span0, 2)
self.effective_gain = self.target_pch_out_db - pref.p_spani
elif self.delta_p is not None:
# use the design target if no target were set
self.target_pch_out_db = round(self.delta_p + pref.p_span0, 2)
self.effective_gain = self.target_pch_out_db - pref.p_spani