Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
1

OpenModelica-Matlab-Interface [closed]

asked 7 years ago

Adrian's avatar

Hi. I'm trying to use and interface between Matlab and OMEdit. I found this one (https://es.mathworks.com/matlabcentral/ … function). An example code is within the download. However I can't get the same results like the autor did with the code given. (You can see the results in the pdf file called plot). I understood that using "omcompile(hello.mo,'modelname')" I get a model compiled in Matlab. Then I can simulate it (omrun(modelname)) and see the results with "omimport(modelname)". So I could re-simulate this model many times as I want without use OMEdit again. The files need one matrix, "HelloWorld.test_res.mat" to execute some commands. The command "omrun(modelname)" deletes that matrix and it don’t create a new one, but the next command (omimport(modelname)) needs this matrix to load the results into Matlab.

I did some changes into the files but I couldn’t make the example works. I can use it to see the results I simulated in OMEdit, but if I tried to change the parameter “a” through Matlab (omparameter), the parameter doesn’t change and I always see the same.

I'd appreciatte the help that you could give me.

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by Adrian
close date 2018-04-11 03:45:08.213325

1 Answer

Sort by » oldest newest most voted
0

answered 7 years ago

Adrian's avatar

This interface is old. There is a new one (https://github.com/OpenModelica/OMMatlab) but is still in development. I'll close the question.

Preview: (hide)
link

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 7 years ago

Seen: 345 times

Last updated: Apr 11 '18