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
3
votes
2 answers

How to use flexible array sizes within an expandable connector?

I would like to use expandable connector (e.g. a Bus-like structure) to model (mainly) input and output connections for more complex subsystems (An array will not allow having different units for its elements and flattened lists get unwieldly while…
gwr
  • 465
  • 6
  • 17
3
votes
1 answer

Can't make the pump in Modelica standard library working

I want to fill an open tank (bacinella2) by extracting water from a source (Pozzetto) by means of a pumping system (Pompa). The problem is quite simple, but I can't implemement in openmodelica. I tried to eliminate the pump, connecting directly…
Luke83
  • 87
  • 5
3
votes
1 answer

Can a parameter be used to set the unit attribute for a component?

So far, using Wolfram System Modeler 4.3 and 5.1 the following minimal example would compile without errors: model UnitErrorModel MyComponent c( hasUnit = "myUnit" ); block MyComponent parameter String hasUnit = "1"; output…
gwr
  • 465
  • 6
  • 17
3
votes
0 answers

How to perform a co-simulation with modelica models?

I would like to use a modelica model, which is based on an external library, for a co-simulation in another environment like ANSYS, Abaqus, etc. The model should be able to interact with another model. What is the easiest way to co-simulate a…
C Winkler
  • 161
  • 2
  • 15
3
votes
1 answer

How to compute eigenvectors and eigenvalues of complex matrices in Modelica?

I am trying to use Modelica to compute the eigenvalues and eigenvectors for a complex matrix. Are there any libraries or built-in standard library functionality that I could leverage to assist me with this calculation? Any help would be greatly…
3
votes
1 answer

What is the purpose of the StateSet variables seen in OpenModelica's result variable browser

When I simulate the model below, I get additional variables labelled $STATESET1, which are obviously auto-generated. What is the purpose of these variables from the perspective of the user? Generally I am only interested in the solution, not in the…
oliver
  • 2,771
  • 15
  • 32
3
votes
1 answer

Heating fluid in lumped volumes modelica

I am having some difficulty in finding exactly the best way to write the energy balance of a simple lumped volume, say a pipe, with fluid flow and a heat flow output. I basically just want to add a Q_loss term in the energy balance to reduce the…
3
votes
0 answers

Modelica output file during simulation

I am making simulations for long times and I need to check the output when the simulation is continuing. Another reason is that I am doing real-time simulation so I want to see the output in real-time as well. That would be perfect if OpenModelica…
falsterbo
  • 520
  • 1
  • 3
  • 15
3
votes
1 answer

Wait or pause during Modelica simulation

I have been working on a real-time simulation case using OpenModelica and that would be great if I could pause the simulation for a while, especially when I am waiting for the new set of real-time data to arrive. In other words, it is problem of…
falsterbo
  • 520
  • 1
  • 3
  • 15
3
votes
1 answer

Why I can not use a global parameter in for loop?

I tried use global parameter in code like this: model testModel outer parameter Integer par; outer Integer var; equation for i in 1:par loop var[i] = 5 * i; end for; end testModel; model test inner parameter Integer par = 3; inner…
Tyomich
  • 137
  • 9
3
votes
1 answer

OMShell returns String but doesn't recognize it

For one of my models, it is required to read the final value of all variables and set them as initial value for the next simulation. My real problem is due to types defined in OMShell. As can be seen in the scripting commands of OpenModelica, there…
falsterbo
  • 520
  • 1
  • 3
  • 15
3
votes
0 answers

User defined unit conversion and displayUnit in Modelica

I have been working with several non-SI medical units on OpenModelica and created a package to contain them. What I wanted to do is to select another user defined unit for display purposes. This is done pretty easily for the types in Modelica…
falsterbo
  • 520
  • 1
  • 3
  • 15
3
votes
1 answer

Function to Return a Replaceable Record in Modelica

I would like to define a function that returns a replaceable record (either MyRecord0, MyRecord1, or MyRecord2) given an input Integer index (0, 1, or 2). Note that this is only a simple demonstration example case and in practice there may be many…
Justin Kauffman
  • 423
  • 3
  • 10
3
votes
2 answers

Solving (nonlinear) equations in simulation tools

I am intersted, how a modelling tool (in my case OpenModelica and Dymola - modelling language Modelica) solves systems of equations (linear and/or nonlinear). These tools are designed for solving differential algebraic equations. I know a little bit…
Kenni
  • 437
  • 1
  • 4
  • 12
3
votes
2 answers

How to hide simulation variables in Dymola

Is it possible to hide objects or outputs after I have simulated a model? I have a ton of objects and I feel like I am wasting time sifting through them trying to find my correct response. If not, is there a way to organize the way my outputs are…