I am trying to understand how CVode()'s error control relates to
actual errors. To that end, I am running CVode() on the simplest
system I could think of:
dydx = -0.05 * y
Since I can solve it analytically, I can compare the output to the
analytic solution.
I call CVodeSStolerances(cvode_mem, 1e-10, 1e-10).
I am using the Adams-Moulton method.
I set the initial value to 10. I then call CVode() repeatedly to
deliver solutions at x = 1, 2, ..., 100.
The analytic solution is y = 10*exp(-0.05 * x). I computed the
differences between the CVode() output and the analytic solution,
and divided by the analytic solution for a relative error. Here is
the result, which shows numerical errors quite a bit larger than
1e-10:
Is there any statement that can be made to connect these real
errors with the settings of atol and rtol?
We use CVode() as the engine for a feature in our scientific
graphing and numerical analysis application Igor Pro.
Thanks much,
John Weeks
WaveMetrics, a division of Sutter Instrument, inc.
To unsubscribe from the SUNDIALS-USERS list: write to: mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV
Thank you, Daniel, for your thoughtful answer to my question.
I do understand the difference between local errors and global
errors. I was hoping that they might be connected by some
predictable relationship, like multiplying by step size or number
of steps. And it occurs to me now that each point on my graph is
the result of integration from the previous point. That is, the
previous point is the initial condition for the next.
My goal is to write something like unit tests that will identify
when we have broken something about the solver code, or if an
update of SUNDIALS breaks something. So I guess the answer is that
I can't really count on a given actual global error, but I can
count on being able to test the global error in a more generalized
way. And perhaps the test has to be written based on empirical
evidence, as opposed to what I was trying which was to compute a
limit.
John Weeks