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

DAE Interactive Adaptive Step-Size Solver #261

Open
lmriccardo opened this issue May 29, 2023 · 2 comments
Open

DAE Interactive Adaptive Step-Size Solver #261

lmriccardo opened this issue May 29, 2023 · 2 comments
Labels
question User queries

Comments

@lmriccardo
Copy link

Hi, I have a DAE model with explicit algebraic equations (I would like to highlight this since I've already see the issue about DAE with implicit algebraic equations). I just implemented a simple step-by-step solver instead of using the diffeqsolve to handle algebraic equations. However, I found a paricular DAE that is not solvable using classical Dopri5 or Tsit5, unless using very small step size, hence I decided to use an adaptive stepsize controller (the PIDController) and the solver Kvaerno5.

To be more clear this is a system I would like to deal with, like any biological systems.

dx/dt = f(x(t),args,t)
args_1 = g_1(...)
args_2 = g_2(...)
...
args_N = g_N(...)

Having said that, I'm actually having trouble implementing the same step-by-step using the PIDController and the SaveAt. Are there any suggestions?

Thank you for the answer.

I'm in particular interest for this project and Equinox too, they are awesome!!

@lmriccardo lmriccardo changed the title DAE DAE Interactive Adaptive Step-Size Solver May 29, 2023
@patrick-kidger
Copy link
Owner

Thank you, I'm glad you like them!

I would recommend using diffeqsolve over the step-by-step interface if possible. This should handle the details of PID control and SaveAt for you.

It should be possible to use the approach discussed here: simply replace the z1 = nonlinear_sol.root line with z1 = g(...) and evaluate your constraints directly.

Does that make sense?

(Incidentally DAEs are on the roadmap for Diffrax, and something I hope to have working in a few months.)

@patrick-kidger patrick-kidger added the question User queries label May 30, 2023
@lmriccardo
Copy link
Author

Yes! Thanks you very much. The fact is that, from what I read in the Documentation, the approach of calling step-by-step diffeqsolve (If this is what you meant) might be a bit unsophisticated, but maybe I just misunderstood the point.

I will try to go in this direction then, because the idea to modify the altready implemented loop function and creating a new Adjoint was getting me mad (I'm not yet into all the details of Diffrax).

Thanks again!

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

No branches or pull requests

2 participants