Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScipyOdeSimulator ignores use_analytic_jacobian (regression) #519

Open
jmuhlich opened this issue Sep 30, 2020 · 1 comment
Open

ScipyOdeSimulator ignores use_analytic_jacobian (regression) #519

jmuhlich opened this issue Sep 30, 2020 · 1 comment

Comments

@jmuhlich
Copy link
Member

I think #395 broke use_analytic_jacobian through a minor typo. In _integrator_process, the block

jac_fn = None
if jac_eqs:
    jac_eqs = _get_rhs(...

Should be assigning to jac_fn inside the block, not jac_eqs. The code as it stands always leaves jac_fn set to None.

I'm in the middle of preparing the final PR for Energy BNG support which requires some changes to this code anyway, so I will try to fix this as I go.

@jmuhlich
Copy link
Member Author

I realize we don't have any tests that verify whether the analytic jacobian is actually used. How could we do that? I thought about checking the number of jacobian evaluations by accessing the internals of the scipy integrator, but that counter is increased even when the internally computed jacobian is used. Even adding a call-counting function wrapper to the jacobian function would be difficult given the _get_rhs / _integrator_process architecture (can't get at jac_fn or even the integrator object). The last resort would be adding extra args to _integrator_process just for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant