- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » model.exe
model.exe
Re: model.exe
You can use buildModel(Model) to just build Model.exe.
With simulation(Model, stopTime=XX) it will simulate the model from 0 to XX seconds.
You can use val(variable, time) after simulate command in OMShell.
From command line you can use Model.exe directly or from OMShell via system("Model.exe");
Code:
> Model.exe -override var1=value1,var2=value2 -output outvariable1,outvariable2
- output variable1 will show variable1 value at the end of the simulation
You could also use simulate(Model, outputFormat="csv") and will get you a Model_res.csv with the values of variables at all time steps.
- adrpo
- 885 Posts
Re: model.exe
First of all, Thanks for your answer,
My simulation timing: startTime=0, stopTime=1
model.exe -output R1.v then i get,
time=1, R1.v=.0.234567..
How can i value of R1.v at 0.2 second?
With override R1.R value we do not need simulation again for new result value right?
How can plot (R1.v) ?
Thanks
Oki
Re: model.exe
You can do this in OMShell (or script.mos and run it via omc script.mos)
Code:
simulate(Model);
val(R1.v, 0.2); // get the value at 0.2
val(R1.v, 0.4); // get the value at 0.4
plot(R1.v); // plot the variable
simulate command will always recompile the model.
Yes, with override you can reuse the same model model.
From command line you could do:
Code:
# override stopTime
> Model.exe -override stopTime=0.2 -output R1.v
# plot R1.v
> path\to\openmodelica\bin\OMPlot --filename=Model_res.mat R1.v
- adrpo
- 885 Posts
Re: model.exe
If you use:
Model.exe -override stopTime=0.2 -output R1.v
Model_res.mat will be affected.
To not generate any .mat (so is not affected) add -noemit:
Model.exe -override stopTime=0.2 -output R1.v -noemit
- adrpo
- 885 Posts
Re: model.exe
Where in the user's guide? If you are referring to the interactive simulation that was discontinued a while back I think 1.8.1 was the last release to have it.
You can communicate via tcp/ip with Model.exe but you need to do that using external functions in which you write the communication.
What exactly do you want to achieve?
- adrpo
- 885 Posts
Re: model.exe
Hi adpro,
ModelicaUserGuide 1.9.1 Chapter 5(page 83)
I tried model.exe -interactive -port 10500 (this call server machine)
Then try to communicate with client machine via socket connection.
My goal is getting simulation result from server machine using socket connection
oki
Re: model.exe
As I said, the old interactive simulation is not available anymore.
There is a new one if you simulate with outputFormat="ia" but I don't know exactly how it works.
I'll ask somebody else to give you some hints.
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » model.exe