- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OpenModelica - plotting of Simulation...
OpenModelica - plotting of Simulation Results - option to save as file
OpenModelica - plotting of Simulation Results - option to save as file
I am working on integrating a web application with OpenModelica. I am using the JavaOMC API from Google Code to programmatically invoke OpenModelica simulation and plot functionality. But the plot() call is throwing up the OMPLOT window. It would be great to be able to directly save the graph as an image file in a standard format such as .png, so as to be able to display the image in a webpage.
I am not sure whether OpenModelica OMPLOT lacks support for this feature or the JavaOMC API does not provide support for this feature - I rather feel the former is the case.
Can somebody guide me as to:
1. Whether OMPLOT supports the feature described?
2. If yes, what are the command-line switches to be provided?
Thanks,
Satya
Re: OpenModelica - plotting of Simulation Results - option to save as file
I suggest you stay in Java and make your own plot.
When you run simulate it will create a Model_res.mat so you can read that using for example:
http://sourceforge.net/projects/jmatio/
and plot the variables.
Alternatively you could use simulate(Model, outputFormat="csv") to get a Model_res.csv (comma separated values file)
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: OpenModelica - plotting of Simulation Results - option to save as file
Just one notice. The cvs file does not contain the parameters. The mat file has those too.
- adrpo
- 885 Posts
Re: OpenModelica - plotting of Simulation Results - option to save as file
I tried to use the OMC API methods to read simulation results like readSimulationResult but I didn't get any result.
I also tried to use JMatIO - Matlab's MAT-file I/O in JAVA but I got an error saying that the .mat file is not a valid MATLAB 5.0 MAT-file.
Should I just export the simulation results in csv? Is there another better alternative?
Thanks,
Axel
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OpenModelica - plotting of Simulation...