Damn! That is decent! Thank you @Pap !
I see, in this example you mentioned, I know that with ITASK = 1 and I set the initial x = 0, final x = 20000. So LSODA solve the whole range and automatically switch between non-stiff and stiff during the process.
Now, just one question.
If I use the interpolation function DINTDY in LSODA to solve for the whole x range you mentioned in your above example. Can LSODA still automatically switch between non-stiff and stiff during the process?
I mean like, I set the initial x = 0, final x = 20000. I set ITASK = 2 in LSODA, so it solve one-step at a time, and I can use DINTDY to do interpolation at the points I want from 0 to 20000. Say I interpolate at x = 0, 100, 200, 300, 400, …, 19900, 20000. So you know what I mean. I am just saying with interpolation enabled, can LSODA automatically switch between non-stiff and stiff during the process? Thanks you very much!
PS.
By the way, about interpolation function, @ivanpribec has a nice example about dvode and perhaps RKC solver too,
The mechanism of interpolation for different solvers are more less the same.