-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
dense_idxs #335
Comments
Saveat happens during the stepping time, so it doesn't require the |
I guess I did not explain the problem I see well enough, or maybe it's not a problem actually. So I try to illustrate what I mean. I added the changes you suggested (or at least the changes I assumed you suggested) to a "dense_idxs" branch in my fork. However, as I expected, these changes yield incorrectly interpolated values even for using OrdinaryDiffEq, DiffEqProblemLibrary
sol_dense = solve(prob_ode_2Dlinear, Tsit5())
sol_nodense = solve(prob_ode_2Dlinear, Tsit5(); dense = false)
sol_denseidxs = solve(prob_ode_2Dlinear, Tsit5(); dense_idxs = [2, 4]) The following plots visualize the resulting interpolation: using Plots
plotly()
plot(sol_dense) plot(sol_nodense) plot(sol_denseidxs) This can also checked numerically: sol_dense(0.6, idxs = [2,4]) # [0.348859, 0.123171]
sol_nodense(0.6, idxs = [2,4]) # [0.352189, 0.124346]
sol_denseidxs(0.6, idxs = [2,4]) # [0.297762, 0.0952841]
sol_dense(0.6, idxs=1) # 0.4768310628469411
sol_nodense(0.6, idxs=1) # 0.4813824589230935
sol_denseidxs(0.6, idxs=1) #0.4478574621174054 I assume, the main problem is that the current interpolation implementation cannot handle different indices for |
Yes, it would need to index |
As discussed in SciML/DelayDiffEq.jl#68 (comment), it would be nice to be able to specify a subset of indices for which a dense solution is required which can be different from
save_idxs
(in particular thinking about higher-dimensional DDEs, for which a solution of all components is required at certain time points without dense interpolation but integration requires a dense interpolation of a small subset of indices). The proposed idea was basically, as far as I understood, to introduce an option which could be nameddense_idxs
or similar and be set tosave_idxs
by default that would be used for copying ofk
in https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/blob/master/src/integrators/integrator_utils.jl#L81-L85.However, this would break the interpolation of the resulting solution in interesting cases mentioned above in which
save_idxs != dense_idxs
. Hence I thought about creating a newCompositeInterpolation
(the name can be discussed, of course) that would use a suitable interpolation fordense_idxs
and the default linear or Hermite interpolation forsave_idxs
that are not indense_idxs
. Does this seem like a good idea? Is there a better approach? In particular, I was wondering how one could efficiently compute interpolations if the providedidxs
are spread over different indices indense_idxs
and othersave_idxs
- but maybe there is no better way than just computing the interpolations for both subsets and then combining them?The text was updated successfully, but these errors were encountered: