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

Clarify nlprob docs for ODEFunction #844

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

termi-official
Copy link

I think I get the idea about what needs to be done next. To make sure we are all on the same page, let me try to clarify the docs here.

multi-level structure). The rationale here is essentially that implicit ODE integration algorithms
need do solve the a nonlinear problems, usually of the form `dt⋅f(γ⋅z+inner_tmp,p,t) + outer_tmp = z`,
during time integration, where users want to use extra structure of f during the nonlinear solve.
Here `z` is the stage solution vector, `p` is the parameter vector of the ODE problem, `t` is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are dt, inner_tmp, outer_tmp, and z defined? in p? Where in p is it assumed? Or does it match some interface?

Aren't you missing a function that updates the prob based on those values?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Tried to resolve this in the latest commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how that addresses it. So okay, how do I update inner_tmp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see how that logic changes in OrdinaryDiffEqNonlinearSolve.jl. From my current understanding the specific ode integrator at hand passes some struct with e.g. inner_tmp into the nlprob (e.g. via remake?) to update these during setup and remake.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should have a better interface (a NamedTuple at least would be a step up)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a functional interface buys us much here since the only things the user is expected to do is get the elements out...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MTK cannot easily generate a NamedTuple. An interface via a function would make it easy to generate via SII

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] functional interface [...]

Functional interface as in non-defective interface or as in function programming?

Regarding the tuples, I think we are on the same page then. I see two main advantage of having structs to control the dispatches for the initialization of different nonlinear solver classes (over having tuples and hard-coded if-else blocks on types):

  1. Being extensible for custom solvers for specific problem classes
  2. Being less error prone to changes, e.g. when there might be some decision in the future to add another possibility to the values of method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does SymbolicIndexingInterface have to do with this?

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 this pull request may close these issues.

3 participants