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

saveat begin time #744

Open
ArnoStrouwen opened this issue Apr 16, 2022 · 2 comments
Open

saveat begin time #744

ArnoStrouwen opened this issue Apr 16, 2022 · 2 comments

Comments

@ArnoStrouwen
Copy link
Member

Should it work like this?

using OrdinaryDiffEq
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Tsit5(), saveat=[0.0,0.0,0.5,0.5,1.0,1.0])
println(sol.t)
[0.0, 0.5, 0.5, 1.0, 1.0] # why no dubbel 0.0 like the others?
@ChrisRackauckas
Copy link
Member

I wouldn't say the doubling behavior is really intentional, I just don't think we've looked at this non-unique case too closely. We can make it double, though I really wonder what the use is here.

@ArnoStrouwen
Copy link
Member Author

Measurement time optimization is the use case. Though in 99.9% of cases it is much to just save a dense solution and then interpolate it at the desired times, instead of working with saveat keyword. It came up for me once when I was doing joint initial condition and measurement time optimization and could not save the dense solution because I ran out of memory. Took me some time to figure out why my objective was discontinuous when multiple measurements got put to t0. Still, it is not difficult to check for uniqueness myself.

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

No branches or pull requests

2 participants