- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OM scripts and OMEdit
OM scripts and OMEdit
OM scripts and OMEdit
Is there a way to run a modelica script (mos file) from OMEdit?
I mean a script in which I use scripting functions from the following link?
https://build.openmodelica.org/Document … pting.html
Thanks.
- ceraolo
- 147 Posts
Re: OM scripts and OMEdit
Start OMEdit using the command "OMEdit --OMCLogger=true". Then Tools->OMC CLI will allow you to send commands instead of just reading them.
runScript("file.mos") will run the given mos-script.
- sjoelund.se
- 1700 Posts
Re: OM scripts and OMEdit
Thank you.
that usage is useful for me and straightforward.
I will use this to make a Fourier analysis of some of the output waveforms.
All I have to do is to translate into OM mos the mos I wrote some years ago for Dymola.
The language is modelica, but the functions to call are different.
My first obstacle is how to use readSimulationResult().
I got some info about it in:
https://build.openmodelica.org/Document … esult.html
I have to pass to it as one of the inputs "variables" that is of VariableNames type.
Where can I find the description of this type? I suppose it is something like a string list, butI cannot envisage how exactly it is to be used.
Maybe there is an example of readSimulationResult() usage somewhere to look at.
MC
- ceraolo
- 147 Posts
Re: OM scripts and OMEdit
Just in case anyone had read my previous message and is curious about the solution.
I found the explanation of the type "VariableNames" in section 2.3 of OpenModelicaSystem.pdf. I read as follows:
VariableName – variable name, e.g. v1, v2, vars1[2].x, etc.
I tried... it works!
- ceraolo
- 147 Posts
Re: OM scripts and OMEdit
Hi Everyone,
I have another question regarding compiling a model from cmd using OMC command. It seems like it takes more time to compile and simulate the model using OMC. I just wanted to ask if anyone knows the parameters affecting the time that it takes to compile the model. I increased the number of the elements in my model and it takes approximately the same time to be compiled. So, I was wondering what parameters of the model affect the time consumption for simulation.
Thanks for your attention,
Pouya
Re: OM scripts and OMEdit
Try reading http://www.ep.liu.se/ecp_article/index. … rticle=049 and you will see how some parameters affect compilation and simulation times.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OM scripts and OMEdit