-
-
Notifications
You must be signed in to change notification settings - Fork 235
Description
Many implicit ODE solvers suffer from too many Jacobian evaluations when solving mid-sized stiff ODE problems (~1000?). It is possible to reduce the time cost of Jacobian evaluations by reusing Jacobians from previous steps and utilizing ODE solvers that are less sensitive to the accuracy of Jacobians like those with Newton steps and Rosenbrock-W methods.
As we already have the solvers, we need to implement Jacobian reuse strategies for them. Currently, solvers like TRBDF2 and KenCarp4 are really good in terms of Jacobian reuse, but there is still space for improvements as CVODE_BDF from Sundials suite performs better in some cases. For Rosenbrock-W methods, new reuse strategies are needed since they don't have information like Newton iteration steps to indicate the accuracy of the Jacobian.
Here is what I found from CVODE 1.0.0, it re-evaluates the Jacobian when at least one of the following conditions is satisfied:
nst==0, number of internal steps == 0 .nst - nstlj > CVD_MSBJ, number of steps after last Jac eval exceed a threshold.convfail == FAIL_BAD_J, the value is passed if- The previous Newton corrector iteration did not converge and the linear solver's setup routine indicated that its Jacobian-related data is not current.
- During the previous Newton corrector iteration, the linear solver's solve routine failed in a recoverable manner and the linear solver's setup routine indicated that its Jacobian-related data is not current.
dgamma < CVD_DGMAX, the change of gamma between Jac eval exceed a threshold.convfail == FAIL_OTHER
during the current internal step try, the previous Newton iteration failed to converge even though the linear solver was using current Jacobian-related data.