Skip to content

Commit 9db91ed

Browse files
author
lgiacome
committed
fix: wrong bounds of bisect
1 parent 671b043 commit 9db91ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pywit/landau_damping.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ def f(b_direct):
111111
try:
112112
# we use 1e-15 as a bound instead of 0 because 0 would cause a divsion by 0 in dispersion_integral_2d
113113
if reference_b_direct > 0:
114-
b_direct_new = bisect(f, 1e-15, 10 * reference_b_direct)
114+
b_direct_new = bisect(f, 1e-15, 100 * reference_b_direct)
115115
else:
116-
b_direct_new = bisect(f, 100 * reference_b_direct, 1e-15)
116+
b_direct_new = bisect(f, 100 * reference_b_direct, -1e-15)
117+
117118
except RuntimeError:
118119
b_direct_new = np.nan
119120
else:

0 commit comments

Comments
 (0)