To unsubscribe from the SUNDIALS-USERS list: write to: mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV
Your plot of y1 doesn't honor the initial condition, either (i.e., plot shows y1 starts at 5, not at 0.45). This suggests there's something up with your code.-Dave
Hi Eliott,
The discontinuity in the right-hand side from the max function may be the culprit. The underlying multistep methods in CVODE assume the solution is several times differentiable which is not the case. In the attachment, I modified your code slightly to enable rootfinding on that discontinuity, i.e., when 10*y2-y1=0. When the root is detected, CVODE is reinitialized. This gives the correct asymptotic value even for loose tolerances.
I’ll also not that most integrators do not give a monotonic solution when the RHS is nonnegative. These deviations from positivity will be on the order of the local truncation error, though, which is much smaller than the deviation you saw from the discontinuity.
Steven
From:
sundials-users <sundial...@llnl.gov> on behalf of Eliott Tixier <eliott...@NOVAINSILICO.AI>
Date: Friday, September 13, 2024 at 8:34 AM
To: sundials-users <sundial...@llnl.gov>
Subject: Re: [sundials-users] Numerical solution decreases even though ODE RHS is non-negative
Hi Dave,
You are right, I did accidentally omit the initial step in the plot. Here is the corrected version of the first plot (tolrel = tolabs1 = tolabs2 = 1e-6).
For the sake of completeness, I've also added the plot for tolrel = tolabs1 = tolabs2 = 1e-8.
On Thu, 12 Sept 2024 at 19:40, David Lorenzetti <dmlore...@lbl.gov> wrote:
Your plot of y1 doesn't honor the initial condition, either (i.e., plot shows y1 starts at 5, not at 0.45). This suggests there's something up with your code.
-Dave
This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby
notified that any review, dissemination, distribution or copying of this message is strictly prohibited. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it
should not be relied upon as such. All information is subject to change without notice.
To unsubscribe from the SUNDIALS-USERS list: write to: mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV