Skip to content

Commit

Permalink
Update model_fitting_methods/kissinger.py
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
PPeitsch and coderabbitai[bot] authored Oct 16, 2024
1 parent 238035b commit 49bc643
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model_fitting_methods/kissinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def calculate_t_p(e_a: float, a: float, beta: np.ndarray) -> np.ndarray:
for i, b in enumerate(beta):
try:
t_p[i] = fsolve(kissinger_nonlinear_eq, x0=e_a / (R * 20), args=(e_a, a, b))[0]
except (RuntimeError, ValueError):
logger.warning(f"Failed to converge for heating rate {b}. Using initial guess.")
except (RuntimeError, ValueError) as e:
logger.warning(f"Failed to converge for heating rate {b}: {e}. Using initial guess.")
t_p[i] = e_a / (R * 20)
return t_p

Expand Down

0 comments on commit 49bc643

Please sign in to comment.