Repository navigation
SimpleImplicitTauLeaping solver - #500
Closed
sivasathyaseeelan wants to merge 1 commit into
Closed
sivasathyaseeelan wants to merge 1 commit into
sivasathyaseeelan wants to merge 1 commit into
Conversation
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
from
August 9, 2025 22:09
69664d8 to
a76c015
Compare
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
from
August 19, 2025 01:42
2c9bb29 to
d302a47
Compare
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
from
September 5, 2025 17:58
d5f5181 to
afbe6dd
Compare
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
4 times, most recently
from
February 14, 2026 19:36
6d16ed3 to
5459dd9
Compare
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
from
April 14, 2026 12:31
7ae0a78 to
08e4688
Compare
Explicit tau-leaping is restricted by the fastest reaction in the system, so a stiff model forces a step size far below the timescale of interest. This adds an implicit method that instead solves a nonlinear equation for the state at the end of each step, following Rathinam et al. (2003) and Cao et al. (2004), and then samples the leap from the propensities at that predicted state. Two formulations are available, selected with the `solver` keyword: `NewtonImplicitSolver` takes the step in its fully implicit form, while `TrapezoidalImplicitSolver` averages the propensities at the current and new states, which damps the excessive stiffness of the fully implicit step. The step-size selection, mass action rate construction and `saveat` handling are shared with `SimpleExplicitTauLeaping` rather than duplicated, and the existing `validate_pure_leaping_inputs` method is widened to cover both algorithms. A step is rejected and `tau` halved when the nonlinear solve fails to converge. The bound is carried across loop iterations: unlike the explicit loop, whose retries redraw the Poisson counts, the implicit solve is deterministic in `(u_current, tau)`, so retrying at an unchanged `tau` would fail identically and spin forever. Once `tau` reaches `dtmin` a non-convergent step is reported as an error instead of being silently accepted. Tests extend the existing SIR and SEIR mean-trajectory comparisons to both implicit formulations, checking them against the exact SSA solution.
sivasathyaseeelan
force-pushed
the
kernel-implicit-tau
branch
from
August 24, 2026 18:41
08e4688 to
afa0703
Compare
5 tasks done
|
|
||
| """ | ||
| $(TYPEDEF) | ||
|
|
Member
There was a problem hiding this comment.
This is weird, just make it SimpleImplicitTauLeaping and SimpleTrapezoidalLeaping
Member
|
Pretty much done, I've got it from here. |
Member
|
I took the commit from here and finished it in #643 |
Member
|
Thanks! Your commit is credited with your authorship for doing like 99% of the work. |
Contributor
Author
|
Thanks Chris, and thanks for finishing it in #643. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
SimpleImplicitTauLeaping, an implicit tau-leaping method for stiff pure-jump problems.Explicit tau-leaping is limited by the fastest reaction in the system, so a stiff model forces a step size far below the timescale of interest. Each step here instead solves a nonlinear equation for the state at the end of the step, following Rathinam et al. (2003) and Cao et al. (2004), and the leap is then sampled from the propensities at that predicted state.
Two formulations are selected with the
solverkeyword.NewtonImplicitSolvertakes the step in its fully implicit form, whileTrapezoidalImplicitSolveraverages the propensities at the current and new states, which damps the excessive stiffness of the fully implicit step.Notes on this revision
This has been rebased onto current
master, which in the meantime mergedSimpleExplicitTauLeaping. The step-size selection (compute_hor,compute_gi,compute_tau), the mass action rate construction and thesaveathandling are now shared with it rather than redefined, andvalidate_pure_leaping_inputsis widened to cover both algorithms instead of gaining a second identical method.Two problems from the earlier revision are fixed:
tauand thencontinued, buttauis recomputed fromcompute_tauat the top of each iteration, so the halved value was discarded. The explicit loop survives the same shape because its retries redraw the Poisson counts, but the implicit solve is deterministic in(u_current, tau)and would fail identically on every pass. The bound is now carried across iterations, and oncetaureachesdtmina non-convergent step is reported as an error rather than silently accepted.Setfieldwas declared as a dependency but never used, which Aqua's stale-dependency check flags.The algorithm type is also now fully parameterized (
SimpleImplicitTauLeaping{T, S}) rather than holding an abstractly-typedsolverfield, and the residual evaluation reuses preallocated propensity caches instead of allocating on each call.Testing
The existing SIR and SEIR mean-trajectory comparisons in
test/regular_jumps.jlare extended to both implicit formulations, checked against the exact SSA solution at every saved timepoint.Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.