File Exchange

image thumbnail

OpenModelica-Matlab-Interface

version 1.3.0.0 (15.1 KB) by Christian Schaad
Compiles, runs, imports openmodelica models.

2 Downloads

Updated 11 Jul 2012

View License

Some Matlabfunctions to compile, run and import solutions of OpenModelica.
Example script to produce a parameter variation of a simple test model.
Requires installation of OpenModelica...

Comments and Ratings (5)

Hello I try to use your interface.
I got the follwing messege by running the on_mat_example.m script.

stdout | warning | simulation_input_xml.c: Error: failed to read the XML file HelloWorld.test_init.xml: not well-formed (invalid token) at line 91
assert | debug | see last warning

ans =

-1

Error using load
Unable to read file 'HelloWorld.test_res.mat'. No such file or directory.

Error in omimport (line 11)
load ([modelname,'_res.mat']);

Error in om_mat_example (line 30)
omimport(modelname); % Read results into Matlab Workspace

I use Matlab R2016b and OpenModelica1.13.264bit.

thank you for your help.

Luka

Useful things. Is there an option the other way around? To import data from MATLAB into OpenModelica without a Dymola (commercial) interface? May not be the right place to ask this question, just wondering...

Fernando

On windows gives the following error when compiling the model of the example (file omcompile line 90):

>> system([win_om_path,'omc.exe +s simo.mos'])
true
false
"Unknown model in instantiateModel: HelloWorld.test
"
{"",""}
ans =
0

any idea?

Stefan

The above link to newer versions is dead. Is there a version available that works with OpenModelica 1.8.1 ?

Had no time yet to test it but newer versions can be found under http://openmodelica.ida.liu.se:8080/cb/proj/doc.do?doc_id=1085

Updates

1.3.0.0

Added compatibility for Openmodelica-1.8.1 including new xml parameter file and mat-output.

1.0.0.0

0.9.6 - omcompilerun accepts now several additional libraries

Remove 'modelname' in omcompilerun to prevent execution of old model...

-Modified linuxcommands for OM_1.4.4.
-omparvar can now create several figures

fixed bug with omc.exe path

..fixed windows omc.exe path...

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux