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

WP3 Network: Results vary with different solvers #29

Open
MichaMans opened this issue Jan 11, 2019 · 3 comments
Open

WP3 Network: Results vary with different solvers #29

MichaMans opened this issue Jan 11, 2019 · 3 comments

Comments

@MichaMans
Copy link
Contributor

@FelixBue @bramvdh91 and me did some simulations for the network of the DESTEST with Modelica. As a reference we simulated the system with the euler solver and 1s timestep. Afterwards we changed to cvode and dassl because the system simulation time is not feasible with the euler solver (2h (euler) --> 2 min (cvode) Simulation time). Now we are running into huge deviations in the results. An example for the injected heat into the system is shown below.

Do you have any hints what this error could base on? We are using CombiTimeTables to load the heat demand for the substations, could this maybe throw the error? Are there some known workarounds? In addition i can say, that this case is not 100% reproducible but on the other hand we cannot simulate every system with the euler as a reference to check if the results are correct or not. So we are trying to track the error down to a small example, but at the moment we don't have one.

Does anybody, maybe @Mathadon @mwetter has any hints were we should look to find the error? Could it be the CombiTimeTable? Is this the right place for discussion?

Thank you all very much in advance for helping us 😃

image

@mwetter
Copy link
Contributor

mwetter commented Jan 12, 2019

I don't know what the cause is, but are you using a high accuracy for Cvode and dassl, and do you use

Advanced.EfficientMinorEvents = false "More efficient handling of events";

@Mathadon
Copy link
Member

@MichaMans Is this a very simple example? I.e. just a pipe and a data reader? In such cases there is so little dynamics (state variables) that the error control on these state variables allows implicit solvers to take large time steps, which may explain your results. So somehow you'd want the implicit solver to take smaller steps. This can be by increasing the tolerance, or by adding more dynamics the model (making the model larger). You can also force the solver to take smaller time steps by configuring the CombiTimeTable such that it throws time events every time that its output changes. By default the CombiTimeTable uses linear interpolation, which results in a smooth output, and therefore the MSL does not throw time events in this case. You can configure it using smoothness=ConstantSegments to reduce the smoothness and then it will throw a time event every time its output change. This will of course slow down the simulation a bit if you have many changes in your data.

@MichaMans
Copy link
Contributor Author

Thank you both very much! I think your suggestions are very good and I'm going to test it in the near future. I optimistic because currently both your suggestions are not used.

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