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

Different results from the integrator when using different solvers (such as CVODE, DASSL, and Euler) in Dymola #4115

Open
GuowenLi-PhD opened this issue Feb 13, 2025 · 2 comments

Comments

@GuowenLi-PhD
Copy link

GuowenLi-PhD commented Feb 13, 2025

Describe the bug
When using the integrator block to calculate the total electricity produced by PV panels in a Modelica model, different solvers (CVODE, DASSL, and Euler) produce significantly different results for the same model. The integrator computes the cumulative sum of real-time power generation, but the results vary depending on the solver used. In the test, CVODE even returns an output of zero when the PV power generation is nonzero.

To Reproduce
Steps to reproduce the behavior:

  1. Open model 'Buildings.Electrical.DC.Sources.Examples.PVSimple'
  2. Add an integrator block to be connected with the power output of pv

Image

  1. Run a 10-day simulation with different solvers (CVODE, DASSL, and Euler)
    CVODE setting:

Image
CVODE result:

Image
DASSL setting:

Image
DASSL result:

Image
Euler setting:

Image
Euler result:

Image

Expected behavior
The integral of power over time should be consistent across solvers (within numerical precision limits). The choice of solver should not drastically affect the accumulated energy calculation.

Screenshots
Comparison results of cumulative PV power generation with different solvers:

Image

Version

  • Modelica Buildings Library: 10.0.0., 2023-09-05
  • Modelica simulation environment: Dymola 2022X
  • Operating system: Windows 10
@mwetter
Copy link
Member

mwetter commented Feb 14, 2025

Thanks for reporting. Did you report this to the Dassault support? As it works with one solver, I suspect it is an issue with Dymola, and there is nothing sensible we can do on the library side. However, please note that Dymola 2025x is the latest version, and I remember in the last years there was an update in the Modelica Standard Library regarding the data reader, which is used in this model. Perhaps updating Dymola and/or the Buildings library corrects this issue.

@mingzhe37
Copy link
Contributor

@GuowenLi-PhD @mwetter This problem is solved, at least no significant difference in Dymola 2025x, the results with reported solvers dassl, euler, cvode are as follows.

Image

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

No branches or pull requests

3 participants