Skip to content

Cvode regression - #1567

Merged
arun3688 merged 9 commits into
OpenModelica:maintenance/v2.1from
arun3688:cvode_regression
Mar 2, 2026
Merged

Cvode regression#1567
arun3688 merged 9 commits into
OpenModelica:maintenance/v2.1from
arun3688:cvode_regression

Conversation

@arun3688

@arun3688 arun3688 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Related Issues

https://test.openmodelica.org/jenkins/blue/organizations/jenkins/OpenModelica/detail/PR-15120/4/tests/

Purpose

Fix regression caused by commits

95ff321 (#1521)

Causes

After the above two commits, Regression happened if CVode has larger stepSize defined in modelDescription.xml, see the below lua script

oms_setCommandLineOption("--suppressPath=true")
oms_setTempDirectory("./Pendulum-lua/")
oms_newModel("model")
oms_addSystem("model.root", oms_system_sc)
oms_addSubModel("model.root.A", "../resources/Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu")
initialStepSize = 0.01
minimumStepSize = 0.01
maximumStepSize = 0.01
oms_setVariableStepSize("model", initialStepSize, minimumStepSize, maximumStepSize);
oms_setResultFile("model", "pendulum_res.mat")
oms_instantiate("model")
oms_initialize("model")
oms_simulate("model")
oms_terminate("model")
oms_delete("model")

output

# ../../install/bin/OMSimulator Pendulum.lua
info:    maximum step size for 'model.root': 0.010000
info:    Result file: pendulum_res.mat (bufferSize=1)
info:    Parameter model.root.A.world.label1 will not be stored in the result file, because the signal type is not supported
info:    Parameter model.root.A.world.label2 will not be stored in the result file, because the signal type is not supported

[CVODE ERROR]  CVode
  At t = 0 and h = 0.01, the error test failed repeatedly or with |h| = hmin.

error:   [doStepCVODE] SUNDIALS_ERROR: CVode() failed with flag = -3
warning: Bad return code at time 0.000000
info:    Final Statistics for 'model.root':
         NumSteps = 0 NumRhsEvals  = 3 NumLinSolvSetups = 1
         NumNonlinSolvIters = 2 NumNonlinSolvConvFails = 0 NumErrTestFails = 1
info:    1 warnings
info:    1 errors

However if you reduce to a smaller StepSize for example (0.0001) then it works fine. But this should not happen and the fmu should run with larger stepSize as well.

Loading
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.

2 participants