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

Is OpenModelica a Simulink alternative?

Is OpenModelica a Simulink alternative?

Hi to all,
I'm an advanced Simulink user. In particular I use it to create dynamical models of air-crafts for flight dynamics studies and to automatically generate C code from the above models.
Now I'm searching for an open source alternative to Matlab/Simulink and I wonder if I can use OpenModelica as an alternative.
Consider that actually I can use a joystick to popultae some imports of the simulink model and I can send data from simulink to other programs via UDP.
Thank you,
Xwang

Re: Is OpenModelica a Simulink alternative?

Hi,

Uh, rather hard question current/smile
The short answer is yes, OpenModelica can be used as an alternative.

The long answer is that things are not that easy.
OpenModelica is not yet at the Simulink/Matlab level of robustness, scalability and ease-of-use.
Now about features:
- Using a joystick to populate model inputs should be possible, but you'll need to write the code for this yourself.
- You can send simulation data to other programs via TCP/IP, we have an interactive mode  for simulation.

Well, in short you can do whatever you want with OpenModelica because you can change/adapt/enhance the
available features because the code is available (of course, you would need to understand and implement
some of these things yourself). However, is not that easy as point-and-click and things are not yet that integrated
as in commercial software.
If you want to give it at try, you could play with it and see if it works for you.

Let us know if you want more information on more specific things.

Cheers,
Adrian Pop/

Re: Is OpenModelica a Simulink alternative?

Is it possible to integrate python code in modelica (I've written some functions which get joystick inputs and send udp packets)?
What kind of ide are available (open source)?
I've seen some screenshots that shows modelica models in a graphical form (like simulink ones).
Moreover what is the difference between openmodelica and jmodelica?
Both are open source, can I use both of them with the same model or the model is somewhat "linked" with the program used to create it?
Is there any arch linux package available?
What about C code generation from a model?
Thank you,
Xwang

Re: Is OpenModelica a Simulink alternative?

More over since I'm starting to develop a vehicle dynamic simulator, I would like to know if openmodelica supports multibody systems.
Thank you again,
Xwang

Re: Is OpenModelica a Simulink alternative?

Xwang wrote:

Is it possible to integrate python code in modelica (I've written some functions which get joystick inputs and send udp packets)?

Yes, but you will need to write an external C wrapper that calls the python code from C (or tcp communication with the python code). I believe it is a lot easier to write the code in C to begin with.

What kind of ide are available (open source)? I've seen some screenshots that shows modelica models in a graphical form (like simulink ones).

I guess OMEdit. jmodelica might have something similar hidden somewhere, but I am not familiar with all their tools.

Moreover what is the difference between openmodelica and jmodelica?

In short, from what I have heard the OpenModelica front-end supports more language features, and the back-end (symbolic manipulations) scales better. I do not know if simulations run faster in jmodelica or not.

Both are open source, can I use both of them with the same model or the model is somewhat "linked" with the program used to create it?

As long as you do not rely on any tool-specific features.

Is there any arch linux package available?

Sort of current/smile You can find a PKGBUILD on these forums, but I believe it is not complete.

What about C code generation from a model?

Yes, by default.

Re: Is OpenModelica a Simulink alternative?

Another question:
is it possible to run a model in soft real time? In Simulink is not possible, but using the tic and toc function I'm able to run the model in real time using a while loop. Is ther in case something similar in modelica?
Thank you again,
Xwang

PS next weekend I will try to install it on my arch x86_64 system

Re: Is OpenModelica a Simulink alternative?

You have the possibility to write any function you like using `external "C"`. This means you can make the simulation wait at certain times. For example by sampling every 0.01 seconds and sleeping until the correct time. This should work in any tool.

OpenModelica itself does not have built-in support for soft real-time simulations, although it might in the future.

Re: Is OpenModelica a Simulink alternative?

sjoelund.se wrote:

You have the possibility to write any function you like using `external "C"`. This means you can make the simulation wait at certain times. For example by sampling every 0.01 seconds and sleeping until the correct time. This should work in any tool.

OpenModelica itself does not have built-in support for soft real-time simulations, although it might in the future.

Ok.
Thank you.
Xwang

PS what about multi body simulation?

Re: Is OpenModelica a Simulink alternative?

The standard library (MSL) contains the basic components for multibody simulation (see the documentation).

And OpenModelica can simulate the example models in there, so you should not have any major issues to get it running.

Re: Is OpenModelica a Simulink alternative?

The standard library (MSL) contains the basic components for multibody simulation (see the documentation).

And OpenModelica can simulate the example models in there, so you should not have any major issues to get it running.

Re: Is OpenModelica a Simulink alternative?

Xwang wrote:


Moreover what is the difference between openmodelica and jmodelica?

It is a matter of personal preference but IMHO JModelica has easier Python bindings. I have written a very short introduction here. Feel free to leave comments over there, on Twitter or on Modelica Language Discord group.

There are 0 guests and 0 other users also viewing this topic
You are here: