I'm solving a system of stiff ODEs describing atmospheric chemistry and transport. I am using CVODE BDF from Sundials Computing. I have two ways to approximate the jacobian:
- Allow CVODE to approximate the jacobian with finite differences.
- I have a function for the jacobian, which uses a mixture of finite differences and analytical derivatives, but also takes some short-cuts, omitting some jacobian terms to gain some speed.
For some reason jacobian (2) works - the integration proceeds smoothly until the end - but jacobian (1) does not work. When using jacobian (1), the integration proceeds smoothly for some time, but then gets stuck at some time, and fails to make progress.
This is the opposite of what I expected. I'm guessing jacobian (1) is a better approximation to the jacobian.
Why is the worse jacobian working better than the better approximation to the jacobian?
Hope this isn't too vague! Thanks for any ideas.