fixed bug with A_eff

This commit is contained in:
Benoît Sierro
2021-08-24 13:49:29 +02:00
parent 12013eb765
commit 754f528104

View File

@@ -73,7 +73,7 @@ class RK4IP:
self.z_final = params.length
self.beta = params.beta_func if params.beta_func is not None else params.beta
self.gamma = params.gamma_func if params.gamma_func is not None else params.gamma_arr
self.C_to_A_factor = (params.A_eff_arr / params.A_eff_arr[0]) ** (-1 / 4)
self.C_to_A_factor = (params.A_eff_arr / params.A_eff_arr[0]) ** (1 / 4)
self.behaviors = params.behaviors
self.raman_type = params.raman_type
self.hr_w = params.hr_w
@@ -104,22 +104,22 @@ class RK4IP:
if "raman" in self.behaviors and self.alpha is not None:
self.logger.debug("Conserved quantity : photon number with loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.photon_number_with_loss(
self.C_to_A_factor * spectrum, self.w, self.dw, self.gamma, self.alpha, h
1 * spectrum, self.w, self.dw, self.gamma, self.alpha, h
)
elif "raman" in self.behaviors:
self.logger.debug("Conserved quantity : photon number without loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.photon_number(
self.C_to_A_factor * spectrum, self.w, self.dw, self.gamma
1 * spectrum, self.w, self.dw, self.gamma
)
elif self.alpha is not None:
self.logger.debug("Conserved quantity : energy with loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy_with_loss(
self.C_to_A_factor * spectrum, self.dw, self.alpha, h
1 * spectrum, self.dw, self.alpha, h
)
else:
self.logger.debug("Conserved quantity : energy without loss")
self.conserved_quantity_func = lambda spectrum, h: pulse.pulse_energy(
self.C_to_A_factor * spectrum, self.dw
1 * spectrum, self.dw
)
else:
self.conserved_quantity_func = lambda spectrum, h: 0.0