-
Notifications
You must be signed in to change notification settings - Fork 58
Improved stability of algebraic loop solutions #1525
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
Open
rruusu
wants to merge
13
commits into
OpenModelica:maintenance/v2.1
Choose a base branch
from
rruusu:stable-loops
base: maintenance/v2.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
refs OpenModelica#1330 It seems that simply calling CVode with mode CV_NORMAL does not work correctly to return at the given stopping time, if the previous call stopped due to a root.
- Some errors made in commit 4c3fe79. - All discrete inputs should be updated before going back to continous time mode in any FMU. refs OpenModelica#1326
Even though the inputs values shouldn't change in continuous time mode, calling setters for such inputs is against the FMI standard and may result in error responses from FMUs. refs OpenModelica#1326
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Related Issues
Purpose
This request introduces a mechanism that prevents solutions to algebraic loops from intermediate model evaluations by CVODE to lead into the results. It starts the solution of each algebraic loop from values that the input variables had at the start of the solver time step and/or event iteration.
This prevents noise from difference quotient evaluations leaking as a strange form of noise through the inexact algebraic loop solutions. This happens, when the algebraic loop solution for a step change inside CVODE during a difference quotient-based Jacobian matrix estimation ends up being accepted as the solution for an algebraic loop at the end of the step. This results in non-zero, seemingly random changes in system states, even if the inputs variable values for the entire system would indicate a stationary state with zero derivatives.
Approach
At the beginning of each solver step, the values of algebraic loop inputs are stored into a member named
initial_guess. They are restored from there before each call toupdateInputs().