Skip to content

Conversation

@rruusu
Copy link

@rruusu rruusu commented Oct 21, 2025

These changes are cherry picked from the branch "work", which includes changes originally made to the master branch in October 2024. I hadn't had the time earlier to rebase my code on the major refactoring done to SystemSC.cpp on 19.11.2024 (6d7a397).

Note:

  • This request is based on the maintenance/v2.1 branch, on which I have been working on.
  • This request includes the changes introduced by Output all CVODE steps #1522 and can be directly merged after it.

Related Issues

Purpose

This set of changes improves the behavior of CVODE in strongly coupled systems that include algebraic loops.

It also includes a change that allows the KINSol solver to maintain its own Jacobian estimate between successive solutions, which reduces the number of necessary iterations for algebraic loop solutions. This can result in a significant drop in simulation time.

Approach

It calculates a dynamic tolerance value that attempts to take into account the size of the difference quotient steps taken by CVODE, which can be extremely small. If the algebraic loops are not solved to sufficient accuracy, the Jacobian estimates achieved by CVODE will be bad, which directly affects both the simulation time and the accuracy of the achieved results.

This approach is still somewhat heuristic. It is difficult to estimate what level of algebraic loop tolerance would be sufficient for a stable Jacobian estimate by CVODE, even if the difference quotient step sizes were known exactly.

It might be better to just always use a near zero tolerance for the algebraic loops. The performance hit from this is not as great, when KINSol is allowed to keep its earlier Jacobian estimates.

The usefulness of these changes are improved by changes included in:

@CLAassistant
Copy link

CLAassistant commented Oct 21, 2025

CLA assistant check
All committers have signed the CLA.

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.

3 participants