-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Fix ATOL in advance_to_steady_state #1305
Conversation
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indeed does look like a typo - I believe the suggested fix is appropriate.
This does indeed make some situations crash that didn't use to crash, I was running a methane partial oxidation on Pt model simulation with a chain of CSTR, the tolerances I used was
I guess it's expected because the actual atol makes it stiffer, but that's probably a good reason to justify that an improvement to the steady-state solver is needed. There is an issue #654 about this. Since I came across this too, I will take a look at #1021, see if I could help on that one. |
@12Chao ... did you try passing a reduced |
No, I changed |
I believe that using |
1e-20 is really small for |
Thanks, that's good to know, I guess I'll try to avoid using very small |
I would bet that the problem is that |
The docstring says that if atol is 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. ).
Changes proposed in this pull request
atol = self.atol
inadvance_to_steady_state
as described in the method's docstrings.Checklist
scons build
&scons test
) and unit tests address code coverageWhat I haven't yet done is show what effect this has, but opening the PR now for comments.