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

Modelica.Fluid.Examples.TraceSubstances.RoomCO2WithControls is problematic because of chattering #4312

Open
casella opened this issue Feb 13, 2024 · 5 comments · May be fixed by #4522
Open
Assignees
Labels
bug Critical/severe issue example Issue only addresses example(s) L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation)
Milestone

Comments

@casella
Copy link
Contributor

casella commented Feb 13, 2024

As reported in #4305, Modelica.Fluid.Examples.TraceSubstances.RoomCO2WithControls is problematic: Dymola 2024x fails with it and so does OpenModelica. Apparently there are some reasons to generate chattering.

This should be investigated before the 4.1.0 release.

@casella casella added bug Critical/severe issue L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation) labels Feb 13, 2024
@casella casella added this to the MSL4.1.0 milestone Feb 13, 2024
@casella casella self-assigned this Feb 13, 2024
@beutlich beutlich added the example Issue only addresses example(s) label Feb 13, 2024
@maltelenz
Copy link
Contributor

We also see chattering around the same time in System Modeler.

@casella
Copy link
Contributor Author

casella commented Oct 24, 2024

I'll have a closer look ASAP

@MatthiasBSchaefer
Copy link
Contributor

This is the commit, causing the chattering according to my tests in Dymola:
930456a

@HansOlsson
Copy link
Contributor

I tried to debug it and preliminarily it seems that the linear part makes sense, but needed to be applied in additional cases.

Specifically the code has:

      if  xi1 < x0 or xi2>x1 then
        // The limits don't make sense, just use linear interpolation
        y := (y1-y0)*(x-x0)/(x1-x0) + y0;
      else

And what happens here is that xi1 and xi2 are practically identical, but x0 and x1 are different.
Adding or abs(xi2-xi1)<100*Modelica.Constants.eps fixes this specific case, but it should be investigated a bit more.

@HansOlsson
Copy link
Contributor

I tried to apply the above and run all the Fluid-tests (without looking at the results) (on maint/4.1.x since I needed MSL-binaries).

In Dymola 2025x (updated) with Advanced.Translation.PlaceDymolaSourceFirst = 2; all fluid examples ran.
I'll make a proper PR of this.

@HansOlsson HansOlsson linked a pull request Jan 21, 2025 that will close this issue
@HansOlsson HansOlsson linked a pull request Jan 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue example Issue only addresses example(s) L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants