From 4ef02474c5e1a2507dff1bff0dfb96faf33d5ff1 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 8 Jan 2026 11:29:20 -0500 Subject: [PATCH] Update documentation of `save_start` and `save_end` Clarify the complicated current behaviour of `save_start` and `save_end` in the documentation, addressing the issue mentioned in OrdinaryDiffEq.jl#1842. This is a rebased version of PR #977 by @ArneBouillon, which was significantly behind master. Co-Authored-By: ArneBouillon <45404227+ArneBouillon@users.noreply.github.com> Co-Authored-By: Claude Opus 4.5 --- src/solve.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index 0d7897284..28b984167 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -360,10 +360,14 @@ section at the end of this page for some example usage. settings of `dense`, `saveat` and `save_everystep` and is used by some applications to manually turn off saving temporarily. Everyday use of the solvers should leave this unchanged. Defaults to `true`. -* `save_start`: Denotes whether the initial condition should be included in - the solution type as the first timepoint. Defaults to `true`. -* `save_end`: Denotes whether the final timepoint is forced to be saved, - regardless of the other saving settings. Defaults to `true`. +* `save_start`: Denotes whether the initial condition should be included in the solution + type as the first timepoint. This setting overrides `saveat` when set to `false`. + Defaults to + `save_everystep || isempty(saveat) || saveat isa Number || prob.tspan[1] in saveat`. +* `save_end`: Denotes whether the final condition should be included in the solution type + as the final timepoint. This setting is overridden by other saving settings when set to + `false`. Defaults to + `save_everystep || isempty(saveat) || saveat isa Number || prob.tspan[2] in saveat`. * `initialize_save`: Denotes whether to save after the callback initialization phase (when `u_modified=true`). Defaults to `true`.