Questions tagged [openmodelica]

OpenModelica is an open-source Modelica-based modeling and simulation environment.

OpenModelica is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage. Its long-term development is supported by a non-profit organization – the Open Source Modelica Consortium (OSMC).

The goal with the OpenModelica effort is to create a comprehensive Open Source Modelica modeling, compilation and simulation environment based on free software distributed in binary and source code form for research, teaching, and industrial usage.

698 questions
14
votes
3 answers

How can I call an OpenModelica model in Python with OMPython?

I have an OpenModelica model made with OMEdit. In order to get a concrete example I designed the following: Now I would like to run the model in Python. I can do this by using OMPython. After importing OMPython and loading the files I use the…
jonie83
  • 1,136
  • 2
  • 17
  • 28
11
votes
3 answers

Modelica vs Simscape

This question has two main aspects actually. Right at the beginning, I have to admit that I am totally new to physical modeling and would be glad to be corrected as well, not only be answered. For those who find it too long to read, I can give a…
falsterbo
  • 520
  • 1
  • 3
  • 15
8
votes
2 answers

How to find a resonance frequency of an oscillator?

I am currently trying to simulate acoustic resonators using OpenModelica, and I am wondering how to robustly/nicely calculate their resonance frequency. As a simplified example (without Media, etc), I have implemented a dual Helmholtz resonator, in…
Christoph
  • 5,480
  • 6
  • 36
  • 61
8
votes
2 answers

Numerical issues integrating a pulse signal that is delayed (fixedDelay)

I noted numerical issues integrating a pulse input that is delayed by a fixed amount of time in Modelica (using Wolfram System Modeler 4.3): model PulseTest "Test FixedDelay with Pulse Input"; Modelica.Blocks.Sources.Pulse pulse( …
gwr
  • 465
  • 6
  • 17
8
votes
1 answer

How to initialize model with previous simulation solution?

Having run out of ideas again I turn to you. I'm sure this has to have been answered before though for the life of me I can't find a clear description of it. Scenario: You work hard to get a model all set up with initial guesses, etc., and then…
Scott G
  • 2,194
  • 1
  • 14
  • 24
7
votes
3 answers

How to construct a balanced connector for liquids in Modelica?

Status of the post: 200313 Got an answer with code DEMO_v42 that I accept for the bounty! 200310 I comment on two key papers suggested yesterday. Still do not understand how to update DEMO_v41. 200309 I want to underline that the key problem is how…
janpeter
  • 681
  • 8
  • 22
7
votes
1 answer

What are the differences between diffferent Modelica Simulation Environments?

There are different Modelica Simulation Environments, including Dymola, Wolfram SystemModeler, OpenModelica, and Jmodelica. So, I try to load a thermal fluid library(ThermoSysPro https://github.com/Dwarf-Planet-Project/ThermoSysPro), but except…
Jack
  • 1,094
  • 6
  • 16
7
votes
1 answer

Modelica units of measurement with square root

In Modelica I'm trying to define a dedicated data type OrifSizingCoeff for the sizing coefficient on an hydraulic orifice. The corresponding physical quantity is a volumetric flow rate divided by the square root of a pressure, therefore: a) In SI…
angusmax
  • 111
  • 2
7
votes
4 answers

Unit testing Modelica component library?

I'm creating a library of components in Modelica, and would appreciate some input on techniques for unit testing the package. So far I have a test package, consisting of a set of models, one per component. Each test model instantiates a component,…
Jack Welch
  • 115
  • 6
6
votes
3 answers

Replacement of deprecated function cardinality(c) in Modelica

In the documentation it is indicated, that cardinality() function is deprecated and should no longer be used. However, it is still used in the libraries such as ThermoSysPro. e.g. if (cardinality(C) == 0) then some code end if; where C is…
Tomillo
  • 157
  • 7
6
votes
1 answer

Modelica events and hybrid modelling

I would like to understand the general idea behind hybrid modelling (in particular state events) from a numerical point of view (although I am not a mathematician :)). Given the following Modelica model: model BouncingBall constant Real g=9.81 …
AssMero
  • 239
  • 1
  • 5
5
votes
2 answers

Set Parameter based on start/initial value of Continuous variable

Task: I have a variable y1 whose derivative is driven by some law e.g. y1 = sin(time) and for which I set the starting value e.g. y1 = 3.0 I have a second variable y2 that is defined by y2 = y1 + offset Now, I want this offset to be a Parameter…
DarioMangoni
  • 301
  • 1
  • 10
5
votes
3 answers

Fixed attribute when instantiating a model as parameter

I want to instantiate a complex model as a parameter in another model and initialize it within the initial equation section, like I am able to do with any Real parameter. For a simple Real parameter I would just write parameter Real y(fixed =…
oliver
  • 2,771
  • 15
  • 32
5
votes
2 answers

Solving static equations (or systems thereof)

I wanted to do the following in Modelica: in a specific model I have several parameters h and I want to deduce some time independent values k from them by solving a set of implicit equations between the parameters and the other values. Since the…
oliver
  • 2,771
  • 15
  • 32
5
votes
2 answers

Exclude directories in .gitignore which contain a particular file

When a package, e.g., Examples, is deleted in OpenModelica, the underlying directory is not removed. Instead, directory Examples contains a file named package.bak-mo to indicate that the directory is not used any more. So a backup is kept. If a file…
christiankral
  • 393
  • 2
  • 7
1
2 3
46 47