From e0979b39f327b2e3306e8cfd7729ab59d13380a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Tue, 24 Aug 2021 16:38:00 +0200 Subject: [PATCH] w_eff marcuse equation, interp_range changes --- src/scgenerator/physics/fiber.py | 30 +++++++++++++++++++++++++---- src/scgenerator/physics/simulate.py | 8 ++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/scgenerator/physics/fiber.py b/src/scgenerator/physics/fiber.py index 5cfecc6..af63faf 100644 --- a/src/scgenerator/physics/fiber.py +++ b/src/scgenerator/physics/fiber.py @@ -291,6 +291,27 @@ def A_eff_hasan(core_radius, capillary_num, capillary_spacing): return M_f * core_radius ** 2 * np.exp((capillary_spacing / 22e-6) ** 2.5) +def A_eff_marcuse(wl: T, core_radius: float, numerical_aperture: float) -> T: + """According to Marcuse1978 + + Parameters + ---------- + wl : T + wavelength + core_radius : float + in m + numerical_aperture : float + NA + + Returns + ------- + T + A_eff as function of wl + """ + V = 2 * pi * core_radius * numerical_aperture / wl + w_eff = core_radius * (0.65 + 1.619 / V ** 1.5 + 2.879 / V ** 6) + + def HCPCF_find_with_given_ZDW( variable: Literal["pressure", "temperature"], target: float, @@ -779,7 +800,7 @@ def compute_dispersion(params: BareParams) -> tuple[np.ndarray, np.ndarray, tupl beta2 += plasma_dispersion(lambda_, params.plasma_density) beta2_coef = dispersion_coefficients( - lambda_, beta2, params.w0, params.interp_range, params.interpolation_degree + lambda_, beta2, params.w0, interp_range, params.interpolation_degree ) if gamma is None: @@ -824,9 +845,10 @@ def dispersion_coefficients( # 2 discrete gradients are computed before getting to # beta2, so we need to make sure coefficients are not affected # by edge effects - r = (lambda_ > max(lambda_[2], interp_range[0])) & ( - lambda_ < min(lambda_[-2], interp_range[1]) - ) + # r = (lambda_ >= max(lambda_[2], interp_range[0])) & ( + # lambda_ <= min(lambda_[-2], interp_range[1]) + # ) + r = slice(None, None) logger.debug( f"interpolating dispersion between {lambda_[r].min()*1e9:.1f}nm and {lambda_[r].max()*1e9:.1f}nm" ) diff --git a/src/scgenerator/physics/simulate.py b/src/scgenerator/physics/simulate.py index f3cd5b9..a6107b3 100644 --- a/src/scgenerator/physics/simulate.py +++ b/src/scgenerator/physics/simulate.py @@ -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( - 1 * spectrum, self.w, self.dw, self.gamma, self.alpha, h + 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( - 1 * spectrum, self.w, self.dw, self.gamma + 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( - 1 * spectrum, self.dw, self.alpha, h + 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( - 1 * spectrum, self.dw + spectrum, self.dw ) else: self.conserved_quantity_func = lambda spectrum, h: 0.0