-
Notifications
You must be signed in to change notification settings - Fork 58
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
Using "fixed-step" solver with ModelicaSystem library #87
Comments
@PatronusCoder You can use getSimulationOptions() to see the options you can set and use For more information look into docs (https://www.openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html#enhanced-ompython-features) |
@PatronusCoder it might be better (more accurate or faster depending on the data) to use a variable step solver and then interpolated on the solution for the known points to calculate your error function. |
@arun3688 I would have expected that setting the stepSize will use the same solver as before, and not a fixed-step solver. Like @alchemyst says a variable step solver (dassl) is the default and by default OpenModelica interpolates the output points (and adds discrete event points on top). To choose a fixed-step solver, you need to change the solver to Euler or Runge-Kutta... There is also an API-function to re-interpolate a result-file (but there are still extra points for discrete events, I think): https://www.openmodelica.org/doc/OpenModelicaUsersGuide/latest/scripting_api.html#filtersimulationresults |
@arun3688 Setting the stepSize does not give the time steps only at the expected time instances. As @sjoelund said, OpenModelica interpolates the outputs and adds discrete event points on top. Some of these points are either on same time instances i.e. duplicates and some are between the time steps. Moreover, the number of output points are not consistent. They change with changing parameters. Although I made my Python script to remove the duplicates and all the in-between points, sometimes the final dataset is smaller than my measured dataset. So is it possible that the solver skips some time steps in between? Also, I am focussing on using ModelicaSystem class because OMC commands are very slow and not very practical when you want to run these commands in a loop. |
Hello
I was wondering if there is any method to set fixed-step solver through ModelicaSystem library. I am trying to use this library along with Scipy.optimize to perform parameter fitting for my model. But everytime the model simulates with a different parameter value, it gives different number of outputs for a model. Is there any way to regularize this?
The text was updated successfully, but these errors were encountered: