Skip to content

Commit

Permalink
[Python] Fix ATOL in advance_to_steady_state
Browse files Browse the repository at this point in the history
The docstring says that if undefined it should match the solver ATOL,
which makes sense to me. What the code in fact did was atol = self.rtol,
which I presume is a typo, so have changed to atol = self.atol.

Since RTOL is often ten or more orders of magnitude larger than ATOL,
this could make some significant differences to people trying to use this 
method. 

However, the changes could be bad: if now we can't ever reach the steady state,
or it takes much longer to reach steady state (already a complaint I hear),
folks may complain that this commit just made it a bunch slower and less stable. 

(But at least they're now getting what they ask for, instead of just getting
the wrong answer quicker).
  • Loading branch information
rwest authored and ischoegl committed Jun 1, 2022
1 parent f7c18fa commit 1ab81ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/reactor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ cdef class ReactorNet:
"""
# get default tolerances:
if not atol:
atol = self.rtol
atol = self.atol
if not residual_threshold:
residual_threshold = 10. * self.rtol
if residual_threshold <= self.rtol:
Expand Down

0 comments on commit 1ab81ac

Please sign in to comment.