Skip to content

Fix events within tolerance of end - #1390

Merged
luciansmith merged 5 commits into
developfrom
fix-events-within-tolerance-of-end
Oct 24, 2026
Merged

luciansmith merged 5 commits into
developfrom
fix-events-within-tolerance-of-end

Conversation

@luciansmith

@luciansmith luciansmith commented Oct 24, 2026 •

Copy link
Copy Markdown

For variable-step simulations, it was possible for an event to fire at the end of an internal step, but after the requested end of the simulation. When the integrator interpolates back to the requested end, it needs to not interpolate back from the event-modified state, but as if the event didn't fire.

Fix for #1384.

If a model is cached, the number of piecewise triggers wasn't being saved.
Events were persisting past the end of a simulation for variable time step integrations.
I had unzipped the llvm binaries using cygwin, and the resulting permissions meant I couldn't actually run llvm-config.  This should give me (and others like me) better error messages.
For variable-step simulations, it was possible for an event to fire at the end of an internal step, but after the requested end of the simulation.  When the integrator interpolates back to the requested end, it needs to not interpolate back from the event-modified state, but as if the event didn't fire.
When the step sizes are variable, delayed events were firing at the end of a step, regardless of when they should have fired.

Need this fix for one of the previous tests, which assumed both fixes were in.
@luciansmith
luciansmith merged commit ec889c0 into develop Oct 24, 2026
9 checks passed
@luciansmith
luciansmith deleted the fix-events-within-tolerance-of-end branch October 24, 2026 03:19
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

Successfully merging this pull request may close these issues.

1 participant