Commit 2b711f3
`ODENLStepData` lets a symbolic front end hand an implicit stage solve a
pre-built `NonlinearProblem` instead of a stage-equation closure.
`ODEFunction` and `SplitFunction` carry it as `nlstep_data`; `DAEFunction`
did not, so the fully implicit `0 = F(du, u, p, t)` form — which is what
modified nodal analysis produces for circuit models — had no way to reach
that path.
`ODENLStepData` is reused unchanged rather than adding a DAE-specific type.
For a fully implicit DAE both arguments of `F` are affine in the stage
unknown, so the same six hooks parametrize the stage system:
g(z, p') = F(gamma1 * z + outer_tmp, gamma2 * z + inner_tmp, p, t_c)
`gamma2`/`inner_tmp` build the state argument exactly as in the mass-matrix
form and `gamma1`/`outer_tmp` build the derivative argument, so with
`gamma2 = 1`, `inner_tmp = 0` and a BDF-type `du ≈ (u - tmp) / (γ * dt)`,
`gamma1` is the `gamma` of `jac(J, du, u, p, gamma, t)`. The `ODENLStepData`
docstring now states this form alongside the mass-matrix one.
`NLP <: Union{Nothing, ODENLStepData}` is bounded as it is on `ODEFunction`,
so `widen_bounded_type_params` erases it for `AutoSpecialize` and `remake`
does not narrow it back.
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
1 parent a8ce2b7 commit 2b711f3
3 files changed
Lines changed: 95 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
21 | 36 | | |
22 | 37 | | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1586 | 1586 | | |
1587 | 1587 | | |
1588 | 1588 | | |
1589 | | - | |
| 1589 | + | |
| 1590 | + | |
1590 | 1591 | | |
1591 | 1592 | | |
1592 | 1593 | | |
| |||
1622 | 1623 | | |
1623 | 1624 | | |
1624 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
1625 | 1631 | | |
1626 | 1632 | | |
1627 | 1633 | | |
| |||
1685 | 1691 | | |
1686 | 1692 | | |
1687 | 1693 | | |
1688 | | - | |
| 1694 | + | |
1689 | 1695 | | |
1690 | 1696 | | |
1691 | 1697 | | |
| |||
1705 | 1711 | | |
1706 | 1712 | | |
1707 | 1713 | | |
| 1714 | + | |
1708 | 1715 | | |
1709 | 1716 | | |
1710 | 1717 | | |
| |||
4143 | 4150 | | |
4144 | 4151 | | |
4145 | 4152 | | |
4146 | | - | |
| 4153 | + | |
| 4154 | + | |
4147 | 4155 | | |
4148 | 4156 | | |
4149 | 4157 | | |
| |||
4188 | 4196 | | |
4189 | 4197 | | |
4190 | 4198 | | |
4191 | | - | |
| 4199 | + | |
4192 | 4200 | | |
4193 | 4201 | | |
4194 | 4202 | | |
4195 | 4203 | | |
4196 | | - | |
| 4204 | + | |
4197 | 4205 | | |
4198 | 4206 | | |
4199 | 4207 | | |
| |||
4203 | 4211 | | |
4204 | 4212 | | |
4205 | 4213 | | |
4206 | | - | |
| 4214 | + | |
4207 | 4215 | | |
4208 | 4216 | | |
4209 | 4217 | | |
4210 | 4218 | | |
4211 | | - | |
| 4219 | + | |
4212 | 4220 | | |
4213 | 4221 | | |
4214 | 4222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
390 | 444 | | |
391 | 445 | | |
392 | 446 | | |
| |||
0 commit comments