Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue: Algebraic loop solution with KINSol #1334

Open
rruusu opened this issue Oct 30, 2024 · 2 comments
Open

Performance issue: Algebraic loop solution with KINSol #1334

rruusu opened this issue Oct 30, 2024 · 2 comments

Comments

@rruusu
Copy link

rruusu commented Oct 30, 2024

Description

There are some performance issues when using KINSol for algebraic loops (i.e. the default).

  1. The state of the KINSol solver is not mainteined between successive solutions

    • This means that the solver has to start estimating the Jacobian from zero each time
  2. The last residual is always evaluated twice in succession

    • Once by KINSol and once by OMSimulator, only for checking the residual value
    • The residual value can be retrieved from KINSol instead.

Expected behavior

Repeated evaluation of the last residual (via calls to fmi2SetReal / fmi2GetReal) is entirely unnecessary.

Solution iterations can be greatly reduced by keeping information from previous solutions.

Version and OS

  • Version: OMSimulator v2.1.2.post5-gce342b6-mingw-notlm-debug
  • OS: Windows 11, 64-bit
@rruusu
Copy link
Author

rruusu commented Oct 30, 2024

I will push a solution for this to my fork shortly.

@lochel
Copy link
Member

lochel commented Nov 12, 2024

@rruusu Thank you for the feedback! Please feel free to open a pull request with your changes.

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

No branches or pull requests

2 participants