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

CVode error doesn't stop simulation / infinite loop #1213

Closed
AnHeuermann opened this issue Apr 25, 2023 · 1 comment · Fixed by #1214
Closed

CVode error doesn't stop simulation / infinite loop #1213

AnHeuermann opened this issue Apr 25, 2023 · 1 comment · Fixed by #1214

Comments

@AnHeuermann
Copy link
Member

Description

I have a broken FMU which can't satisfy error tests, because the evaluation of the ODE system is wrong (playing around with some neural networks in there). CVODE will fail the error test, OMSimulator prints a warning and then does the exact same step again. This loop never stops.

Steps to reproduce the behavior

oms_setTempDirectory("./temp/")
oms_newModel("model")
oms_addSystem("model.root", oms_system_sc)
oms_addSubModel("modelname", "../modelname.fmu")

oms_setStopTime("model", 1)
oms_setFixedStepSize("model.root", 2e-4)

oms_instantiate("model")
oms_initialize("model")
oms_simulate("model")
oms_terminate("model")
oms_delete("model")
[CVODE ERROR]  CVode
  At t = 1.0002 and h = 0.0002, the error test failed repeatedly or with |h| = hmin.

Expected behavior

CVODE already tries multiple times (e.g. reducing the internal step size?) and fails to do the integrator step. In that case oms::SystemSC::doStep should fail after printing the error message.

Version and OS

  • Version: OMSimulator v2.1.1.post199-g2cd3a45-linux-debug
  • OS: Ubuntu 22.04.2 LTS
@AnHeuermann AnHeuermann changed the title CVode doesn't stop simulation CVode error doesn't stop simulation / infinite loop Apr 25, 2023
@lochel
Copy link
Member

lochel commented Nov 15, 2024

This has been merged into maintenance/v2.1, as the CVODE integration will undergo significant changes for OMSimulator 3. Thanks @AnHeuermann!

@lochel lochel closed this as completed Nov 15, 2024
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 a pull request may close this issue.

2 participants