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

Allow to set CVODE parameters for ME FMUs #1277

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

gabibbo97
Copy link
Contributor

Purpose

While simulating particularly stiff problems, the default settings for ME FMUs might fail with errors like

[CVODE ERROR]  CVode
  At t = 3e-12 and h = 1e-12, the error test failed repeatedly or with |h| = hmin.

or

[CVODE ERROR]  CVode
  At t = 1423.64, mxstep steps taken before reaching tout.

error:   [doStep] SUNDIALS_ERROR: CVode() failed with flag = -1

This is due to the CVODE maximum steps / NLS iterations being hardcoded into OMSimulator with fixed values.

Approach

By adding more CLI flags, we can now customize the behavior of CVODE (I left out Adams vs BDF formula choice because if someone is trying to fiddle with these knobs he's already trying to handle a stiff problem).
Without these flags, OMSimulator should use exactly the same values as before, so the behavior should be unchanged.

@CLAassistant
Copy link

CLAassistant commented Dec 5, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@lochel lochel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 👍 LGTM

@arun3688 arun3688 merged commit c66d712 into OpenModelica:master Dec 6, 2023
2 checks passed
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.

4 participants