From 754f5281044ffc1921c69f32f4b44fd15d990dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Tue, 24 Aug 2021 13:49:29 +0200 Subject: [PATCH] fixed bug with A_eff --- src/scgenerator/physics/simulate.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scgenerator/physics/simulate.py b/src/scgenerator/physics/simulate.py index 3c7910c..f3cd5b9 100644 --- a/src/scgenerator/physics/simulate.py +++ b/src/scgenerator/physics/simulate.py @@ -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