We found what CVODE is doing differently here. Turns out that on the chosen problem the nonlinear solvers seem to always converge in one iteration, while our method always did at least two iterations to check the convergence rate. We just need to add a fast path for that behavior.
SciML:master
← SciML:myb/single_conv_newton
opened 09:25PM - 07 May 24 UTC
CVODE estimates the convergence of the first iteration by reusing the
convergen… ce rate of the previous nonlinear solver iteration.
Reference: https://github.com/LLNL/sundials/blob/2abd63bd6cbc354fb4861bba8e98d0b95d65e24a/src/cvodes/cvodes_nls.c#L325-L331
MWE: https://discourse.julialang.org/t/cvode-bdf-outperforms-julia-solvers-for-stiff-system-biology-model/113936
Master branch:
```julia
julia> sol = solve(oprob_jac, FBDF()).stats
SciMLBase.DEStats
Number of function 1 evaluations: 311
Number of function 2 evaluations: 0
Number of W matrix evaluations: 31
Number of linear solves: 222
Number of Jacobians created: 2
Number of nonlinear solver iterations: 212
Number of nonlinear solver convergence failures: 0
Number of fixed-point solver iterations: 0
Number of fixed-point solver convergence failures: 0
Number of rootfind condition calls: 0
Number of accepted steps: 84
Number of rejected steps: 2
```
This PR:
```julia
julia> sol = solve(oprob_jac, FBDF()).stats
SciMLBase.DEStats
Number of function 1 evaluations: 251
Number of function 2 evaluations: 0
Number of W matrix evaluations: 32
Number of linear solves: 159
Number of Jacobians created: 2
Number of nonlinear solver iterations: 149
Number of nonlinear solver convergence failures: 0
Number of fixed-point solver iterations: 0
Number of fixed-point solver convergence failures: 0
Number of rootfind condition calls: 0
Number of accepted steps: 86
Number of rejected steps: 3
```
That should merge by the end of the week.
2 Likes