Skip to content

Strange behavior of save_at=false #1842

@erlebach

Description

@erlebach

I am getting strange behavior with the different versions of save_at and save_start and save_end. Here is a MWE:

using DifferentialEquations

function exponen!(du, u, param, t)
	du[1] = -u[1]
end

tspan = (0., 3.)
prob = ODEProblem(exponen!, [2.], tspan)
solve(prob, Tsit5(), saveat=[0.2, 1.3], save_start=false, save_end=false)

I expect the solution at the two times 0.2 and 1.3 to be printed. This is what happens. Next, I explicitly add the start and end times to saveat, and specify that save_start and save_end are false. I expect the solution at four times values to be printed. However, only three are printed.

sol = solve(prob, Tsit5(), saveat=[0., 0.2, 1.3, 3.], save_start=false, save_end=false)
println("sol.t: ", sol.t)

This might be a missing edge case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions