- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Strange Simulation Options sending...
Strange Simulation Options sending wrong values
Strange Simulation Options sending wrong values
Hello,
I was lately trying to run test mo files through script. I downloaded the very recent version of omo 1.9.0. However, I just notice that the simulation result is streaming wrong 'numberOfIntervals' value as you can see below:
This the default. The first line is from my mos, the second line is from simulation result. This is ok.
Code:
startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500
startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500
Here, I change the stopTime from 1.0 (above) to 10.0. The simulation result changes numberOfItervals to 5000 (by a factor of 10)
Code:
startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500
startTime = 0.0, stopTime = 10.0, numberOfIntervals = 5000
Here the stop time is 5, the numberofIntervals is changed to 2500.
Code:
startTime = 0.0, stopTime = 5.0, numberOfIntervals = 500
startTime = 0.0, stopTime = 5.0, numberOfIntervals = 2500
Below is the format of the simulation options of my mos using default settings except trying to change stop time:
Code:
loadFile("my.mo");
simulate(my, startTime = 0, stopTime = 5, numberOfIntervals = 500);
Can anyone advise me what went wrong or if the latest version uses a different scripting syntax?
Re: Strange Simulation Options sending wrong values
Hi,
This should not happen. default numberOfIntervals is 500 and it should
not change if you don't change it via the simulation/buildModel command.
Do you have, by any chance, and Experiment annotation in your Model?
That would change how things are handled but not if you specify both
stopTime = X and numberOfIntervals = Y
What do you mean by very recent version? Any revision number?
Did you got the latest nightly build from here?
https://build.openmodelica.org/omc/buil … ly-builds/
Chees,
Adrian Pop/
- adrpo
- 885 Posts
Re: Strange Simulation Options sending wrong values
Thank you Adrian. I mean from the download link, I had this version OpenModelica-1.9.0-BETA4-revision-15030
I don't have annotation that could modify the simulation parameters
Code:
if you don't change it via the simulation/buildModel command
Is this different from the mos script? Was not the mos supposed to stream the same value and omc result in the same simulation options information. The same way, changing stepSize value is also modifying numberOfIntervales.
I am working on windows 7 and couldn't figure out why it is such a serious issue
Re: Strange Simulation Options sending wrong values
Hi,
What i mean is that in the script file you have a simulation or a buildModel command. I.e.
Code:
simulate(Model, stopTime= X, numberOfIntervals = Y); getErrorString();
so is it for the .mos scripts.
Yes, it should just pass the parameters you send via simulate or buildModel commands.
We do some calculation: stepSize = (stopTime - startTime) / numberOfIntervals;
So if you play with stepSize and not with the others we will calculate numberOfIntervals
from it as far as I know.
I suggest you install the latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
as a lot of fixes and improvements are in there and see if this still happens.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Strange Simulation Options sending wrong values
Hi,
Well, besides the OpenModelica user's guide and system guide (you have them as .pdf in OpenModelica installation) you can have a look here:
https://build.openmodelica.org/Documentation/
https://build.openmodelica.org/Document … pting.html
Some things are not very well documented, we're trying to solve that, but it will take some time.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Strange Simulation Options sending...