Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

OpenModelica API?

OpenModelica API?

I know OpenModelica has omc, which essentially serves as a batch mode for a variety of tasks.

I'm wondering if OpenModelica also has an API?  Any documentation on this would be greatly appreciated.

Thank you!

Re: OpenModelica API?

For scripting with omc: https://build.openmodelica.org/Document … pting.html

There is no other API as of yet (assuming you consider the CORBA interface the same as mos-scripting)

Re: OpenModelica API?

Is FMI relevant here?  OpenModelica exports FMU's, and I'm also wondering if an FMU can be used to simulate a model outside of the context of any tools by using the .dll's or source code?

I'm looking at the FMI documentation, but any heads-up would be appreciated in terms of whether or not FMI can do what I hope it does.  current/smile

Thanks again!

Re: OpenModelica API?

"Scripting" is basically putting omc commands into an .mos file and running it with omc right?

Re: OpenModelica API?

Yes. Scripting is like a mos-script. You can also use popen and read/write using stdin and stdout though. Or named pipes, etc.

FMI is different from the OMC API. You can use it to control a simulation, but that's about it.

Re: OpenModelica API?

Can you use the contents of an FMU to modify a simulation configuration (start time, stop time, increment, initial values of variables, parameters, etc.),  run that simulation, and then get the output (i.e. a csv)?  And all of this outside of the context of ANY tool?  (FMU's include the solvers used for a simulation, right?  Even if they're hidden in .dll's?)

Thanks for your help sjoelund!

Re: OpenModelica API?

You can do this without using FMU and without recompling the executable (parameter sweeps).
Simply use the buildModel command to create the executable, and then modify the command-line switches sent to the executable or modify the xml-file.

There are 0 guests and 0 other users also viewing this topic