-
Notifications
You must be signed in to change notification settings - Fork 42
Description
The idea for this package is to setup differentiation functions which utilize as much of the performance overloads as possible, and make it easily available for all of the native Julia solvers. The idea is pretty much understood by these comments:
There's no reason to do this same setup in every solver in all of its variations, and instead it needs a library to be a backend for all of the *DiffEq solvers. Essentially, the idea is to make a library here that allows someone choose between autodiff or not, and provide functions that will compute the Jacobian. But also, utilize the performance overloads:
http://docs.juliadiffeq.org/latest/features/performance_overloads.html#Other-Available-Functions-1
So if f(Val{:jac},t,u,J) exists, it will use that for the Jacobian, using the traits to check for existence:
has_jac(f)
has_expjac(f)
has_invjac(f)
has_tgrad(f)
has_hes(f)
has_invhes(f)
has_invW(f)
has_invW_t(f)
has_paramjac(f)
has_paramderiv(f)Then, the methods will be bootstrapped on top of each other. For example, there will be a method for computing the explicit inverse Rosenbrock-W function (M - γJ)^(-1). This will check has_invW(f), and if not, will go down to computing the Jacobian, using the method which checks if has_jac(f) before finally autodifferentiating via ForwardDiff or using Calculus.jl (/FiniteDiff.jl) for when autodifferentiation won't work (some functions and types).
This will make it very easy to build most stiff solvers, since the set of functions covers the vast majority of cases. So the Rosenbrock solvers can say "give me the Rosenbrock-W inverse", and it will give the computed inverse in the manner that is most computationally efficient given what the user (or ParameterizedFunctions) has specified. Given that all of the has functions are compile-time known traits, this has 0-overhead, and so this design will be killer when done.
Lastly, it should be opened up to allow the user to choose the method by with \ will occur. This shouldn't be hard since you can just let people pass a factorization object, but it'll need some PRs to libraries like IterativeSolvers.jl to allow them to be used in that interface. See this discussion for more details:
https://discourse.julialang.org/t/unified-interface-for-linear-solving/699/32
Together, all of this forms a very self-contained project that would be great for beginners, but would make it a lot easier to implement more solver methods in the most efficient manner possible at a very high level. I think this is a perfect GSoC project.