Skip to content

Conversation

@psv4
Copy link
Contributor

@psv4 psv4 commented Jul 1, 2025

Closes #267 and Closes #214 .

Replaces the costly Jacobian inverse calculation for implicit solvers with the good Sherman-Morrison method.

Additionally, reorders the tableau for GL4 to be closer to its definition and switches the implicit trapezoid method to use the DIRK solver.

psv4 added 3 commits May 29, 2025 16:09
Move GL4 tableau closer to definition

Change Implicit Trapezoid to DIRK solver
@psv4
Copy link
Contributor Author

psv4 commented Jul 1, 2025

Tests

python tests/run_all.py
........\torchdiffeq\torchdiffeq\torchdiffeq\_impl\rk_common.py:554: UserWarning: Functional iteration did not converge. Solution may be incorrect.
  warnings.warn('Functional iteration did not converge. Solution may be incorrect.')
\torchdiffeq\torchdiffeq\torchdiffeq\_impl\rk_common.py:464: UserWarning: Functional iteration did not converge. Solution may be incorrect.
  warnings.warn('Functional iteration did not converge. Solution may be incorrect.')
...........\scipy\integrate\_ivp\ivp.py:621: UserWarning: The following arguments have no effect for a chosen solver: `min_step`.
  solver = method(fun, t0, y0, tf, vectorized=vectorized, **options)
\scipy\integrate\_ivp\rk.py:505: UserWarning: The following arguments have no effect for a chosen solver: `min_step`.
  super().__init__(fun, t0, y0, t_bound, max_step, rtol, atol,
...
----------------------------------------------------------------------
Ran 22 tests in 343.978s

OK

commit 0d38c2f
Author: psv4 <[email protected]>
Date:   Wed Dec 3 11:23:08 2025 -0500

    Cleaned up with super

commit 4cd4c6a
Author: psv4 <[email protected]>
Date:   Fri Nov 21 17:48:08 2025 -0500

    Variable tolerance

commit 66255de
Author: psv4 <[email protected]>
Date:   Tue Nov 18 18:51:41 2025 -0500

    Sparse update
@psv4
Copy link
Contributor Author

psv4 commented Dec 3, 2025

@rtqichen this was a bigger update. For my work, the Jacobian inverse would take too much memory if it were dense. Following this paper, I switched it to sparse and it can actually run faster now. Additionally, cleaned up the __init__ with the super().

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.

Use Sherman-Morrison formula with implicit solvers Can torchdiffeq provide support for stiff ordinary differential equations?

1 participant