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

How to pass the options? #19

Closed
JianghuiDu opened this issue Apr 23, 2019 · 11 comments · Fixed by #22
Closed

How to pass the options? #19

JianghuiDu opened this issue Apr 23, 2019 · 11 comments · Fixed by #22

Comments

@JianghuiDu
Copy link

I can't figure out how the solver specific options in ODEInterface are passed to solve. Can you give an example?

@ChrisRackauckas
Copy link
Member

what options?

@JianghuiDu
Copy link
Author

opt_radau=OptionsODE(
  OPT_RTOL             => rtol,
  OPT_ATOL             => atol,
  OPT_INITIALSS        => 1e-3,
  OPT_JACRECOMPFACTOR  => 0.1,
  OPT_FREEZESSLEFT     => 1.0,
  OPT_FREEZESSRIGHT    => 1.2,
  OPT_SSMINSEL         => 0.1,
  OPT_SSMAXSEL         => 10.0,
  OPT_JACOBIMATRIX     => reactran_steady_jac_int,
  OPT_JACOBIBANDSTRUCT => (bandwth,bandwth), 
  OPT_RHS_CALLMODE     => RHS_CALL_INSITU,
  OPT_LOGLEVEL         => LOG_NOTHING,
  OPT_OUTPUTMODE       => OUTPUTFCN_NEVER
  )

I see that options like RTOL and the output are inherited by solve, what about the other ones?

@ChrisRackauckas
Copy link
Member

Most of it is handled automatically to match the common solve interface. Tolerances, inital step size, qmin/qmax, declaring Jacobians, log functions, call mode, and output mode are all handled. I guess we miss a few that can be added as solver specific.

@JianghuiDu
Copy link
Author

Are the jacobian bandwidths inferred if specifying jac_prototype?

@ChrisRackauckas
Copy link
Member

ahh, we missed banded Jacobians here. That would be worth adding for sure.

@JianghuiDu
Copy link
Author

That would be great. I think ODEInterface has its own BandedMatrix type, not sure how it compares to BandedMatrices. I find out that ddebdf is a contender of CVODE_BDF. It's surprisingly fast. Also it is interesting that using the DifferentialEquations interface reduces allocations a lot when compared to the original ODEInterface interface.

@ChrisRackauckas
Copy link
Member

Interesting. Can you share that problem where it's fast? All of the cases in DiffEqBenchmarks.jl shows it's slow, so I'm curious what properties of the ODE allowed it to work well.

@JianghuiDu
Copy link
Author

One small glitch should be resolved quite easily. ODEInterface requires the rtol and atol be the same length. So I can't use a scalar for one and a vector for the other like I do in DifferentialEquations .

@JianghuiDu
Copy link
Author

It's in my private repo and I've added you as collaborator. The relevant file is https://github.com/JianghuiDu/diagenetic-model/blob/master/testing.ode.jl. It's large system (3000) reaction transport model.

@ChrisRackauckas
Copy link
Member

Try #22 . dde_bdf(jac_lower=bandwidth,jac_upper=bandwidth). It's interesting that's doing well since every test that we have shows CVODE_BDF as faster than it, so by now I've almost given up on it.

That model looks pretty nice. Would you mind submitting it to DiffEqBenchmarks after it's done and published? It would be a good one to keep testing and improving against.

@JianghuiDu
Copy link
Author

Yes. I'll submit it for benchmark after I'm done. It'd be good to have a large system among the examples.

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

Successfully merging a pull request may close this issue.

2 participants