Skip to content

Commit f265cda

Browse files
Copilotivan-pi
andauthored
Implement ires=-1 backtracking with idid=-4 and add phys rejection tests
Agent-Logs-Url: https://github.com/ivan-pi/stiff3/sessions/0c392331-c325-4a42-940e-98728335aca2 Co-authored-by: ivan-pi <21085643+ivan-pi@users.noreply.github.com>
1 parent 83da099 commit f265cda

5 files changed

Lines changed: 321 additions & 138 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,15 @@ The integer exit flag `idid` reports solver status:
192192

193193
- `0` — successful completion at `x1`
194194
- `-1` — LU factorization failed because the Jacobian system matrix was singular
195-
- `-2` — integration interrupted by a user callback (`ires < 0` in `fun` or `irtrn < 0` in `solout`)
195+
- `-2` — integration interrupted by a user callback (`ires < -1` in `fun` or `irtrn < 0` in `solout`)
196196
- `-3` — step-size underflow occurred during bisection (`abs(h) <= spacing(x_current)`)
197+
- `-4` — too many physical rejections signaled by `fun` (`ires = -1`, limit exceeded)
198+
199+
The `fun` callback uses a DASSL-like `ires` contract:
200+
201+
- `ires = 0` — normal return
202+
- `ires = -1` — reject the current trial step and retry with halved step size
203+
- `ires < -1` — interrupt integration and return with `idid = -2`
197204

198205
When using this explicit-workspace overload together with `solout`, accepted-step dense output is available through the generic interface `stiff3_interp`:
199206

0 commit comments

Comments
 (0)