SciML / SciMLBase.jl

The Base interface of the SciML ecosystem
https://docs.sciml.ai/SciMLBase/stable
MIT License
121 stars 91 forks source link

Add a nlls trait to BVProblem #567

Closed avik-pal closed 3 months ago

avik-pal commented 6 months ago

Checklist

Additional context

The main compilation cost for BVDiffEq is coming from solving NLLS problems. Having this allows us to have a type stable path for NLLS BVPs.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 61.29032% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 30.03%. Comparing base (3746cda) to head (7ff95fc). Report is 9 commits behind head on master.

Files Patch % Lines
src/problems/bvp_problems.jl 68.42% 6 Missing :warning:
src/remake.jl 50.00% 3 Missing :warning:
src/solutions/ode_solutions.jl 33.33% 2 Missing :warning:
src/scimlfunctions.jl 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #567 +/- ## ========================================== - Coverage 38.43% 30.03% -8.41% ========================================== Files 55 55 Lines 4298 4309 +11 ========================================== - Hits 1652 1294 -358 - Misses 2646 3015 +369 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

avik-pal commented 3 months ago

I am happy with the current state of this. To summarize

  1. Adds an nlls trait to BVProblem -- we try to infer it but err on the side of caution and set it to Nothing if we can reliably figure it out. It is the job of the upstream library to figure out how to deal with this case
  2. Adds original to the ODESolution. I agree with @ChrisRackauckas that we probably don't want to unnecessarily copy the code into a BVPSolution since original might be useful for ODEs as well. resid not for IVPs but that is probably not a good enough reason to copy so much code.
  3. Special cases the initial condition for the BVP to be a function