bug fix
This commit is contained in:
@@ -360,7 +360,7 @@ default_rules: list[Rule] = [
|
||||
fiber.V_eff_step_index,
|
||||
["l", "core_radius", "numerical_aperture", "interpolation_range"],
|
||||
),
|
||||
Rule("gamma", lambda gamma_arr: gamma_arr[0], proprities=-1),
|
||||
Rule("gamma", lambda gamma_arr: gamma_arr[0], priorities=-1),
|
||||
Rule("gamma_arr", fiber.gamma_parameter, ["n2", "w0", "A_eff_arr"]),
|
||||
Rule("n2", materials.gas_n2),
|
||||
Rule("n2", lambda: 2.2e-20, priorities=-1),
|
||||
|
||||
@@ -274,20 +274,19 @@ class RK4IP:
|
||||
progress_str = f"step {step} rejected with h = {h:.4e}, doing over"
|
||||
self.logger.debug(progress_str)
|
||||
keep = False
|
||||
h_next_step = h / 2
|
||||
self.state.h = h / 2
|
||||
elif cons_qty_change_ok < curr_p_change <= 2 * cons_qty_change_ok:
|
||||
keep = True
|
||||
h_next_step = h / self.size_fac
|
||||
self.state.h = h / self.size_fac
|
||||
elif curr_p_change < 0.1 * cons_qty_change_ok:
|
||||
keep = True
|
||||
h_next_step = h * self.size_fac
|
||||
self.state.h = h * self.size_fac
|
||||
else:
|
||||
keep = True
|
||||
h_next_step = h
|
||||
self.state.h = h
|
||||
else:
|
||||
keep = True
|
||||
self.state = new_state
|
||||
self.state.h = h_next_step
|
||||
self.state.z += h
|
||||
return h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user