Questions tagged [modelica]

Modelling language for multi-domain physical and control systems.

The free Modelica language is developed by the non-profit Modelica Association. The Modelica Association also develops the free Modelica Standard Library.

1319 questions
5
votes
1 answer

FMU Export of Python Code or Python Interface with FMI Standard for Use in EnergyPlus Co-Simulation

My research group has developed python code for a new building component that we would like to co-simulate with EnergyPlus. For reuseability and market impact we would like this connection to be as easy as possible for inexperienced users and…
Justin Shultz
  • 199
  • 1
  • 11
5
votes
1 answer

steady state initialization in Modelica

For example, I have a multibody vehicle model with an initial height of, say 0.1 meter (all wheel vertical loads = 0), as the sim runs, the vehicle will drop onto the ground, after 10 seconds, it reaches its steady state. I wonder if it is possible…
Hang Yu
  • 476
  • 2
  • 14
5
votes
2 answers

Debug Modelica code

I wonder if there a way to "debug" a modelica code, I mean debugging the code line by line and you can see how variables change, things like that? I know that the modelica code is translated into C, I just want to know if there's a possibility to…
Hang Yu
  • 476
  • 2
  • 14
5
votes
1 answer

integration of function in modelica

I would like to perform integration of a function of a variable other than time in Modelica, but I don't know how to do it. For example, how can I evaluate the integral of x dx with upper limit 5 and lower limit 2? ∫x dx=x^2/2
Tymo
  • 259
  • 6
  • 14
5
votes
1 answer

Controlling events in a hybrid Modelica model

I am confused by the hybrid modelling paradigm in Modelica. On one hand, events are useful, on the other hand, they are to be avoided. Let me explain my case: I have a large model consisting of multiple buildings in a neighborhood that is…
saroele
  • 9,481
  • 10
  • 29
  • 39
5
votes
1 answer

Conditional type assignment possible for a parameter?

I'm trying to let a parameter be of a specific type depending on a condition to be met. But I'm not quite sure how to do this or if this is actually possible/legal in Modelica. In principle what I would like to have is something like this…
Dietmar Winkler
  • 942
  • 5
  • 11
4
votes
1 answer

Software in the Loop mode with Modelica

How to implement Software in the Loop for control systems design with Modelica (OpenModelica, jModelica) for a plant and C/C++ routine for a controller. What approaches you can suggest? I thought external C Functions would help but seems they have…
aliko
  • 319
  • 3
  • 12
4
votes
1 answer

Modelica external functions: C versus C99

In Modelica it is possible to define external functions. Chapter 12.9 of the spec says C and Fortran77 are supported, C++ and Fortran90 might be supported in the future. Now I wonder which versions of C are supported? In particular I need the…
matth
  • 2,568
  • 2
  • 21
  • 41
4
votes
4 answers

Modelica: parameter propagation with connectors not possible

I am working on a (Open)Modelica library for simulating chemical processes. With commercial tools it is a common approach that the mixture configuration (e.g. how many and which chemical components are involved like water, ethanol, ...) is defined…
JeBa
  • 53
  • 6
4
votes
0 answers

Is there an operator similar to modelica's homotopy() in ModelingToolkit(MTK)?

Is there an operator similar to modelica's homotopy() in ModelingToolkit(MTK)? Or how can I achieve this method? Anything about help would be appreciated!
Rjh
  • 41
  • 2
4
votes
0 answers

Dymola Segfault in external C function with Python API when using time and numpy

We execute Python code from Dymola via the C/Python API. Therefore we used that tutorial. The tutorial works as shown, but when we combine Dymolas built-in time variable and Pythons Numpy library, we get a segfault. Function in Dymola to call…
4
votes
1 answer

Dymola 2022 and 2021x giving different solutions

I have some test simulations that, when run, do not follow the exact same solution path when run in Dymola 2021x and Dymola 2022. Thus, my system that checks to make sure my test simulations are running properly indicates that they are in fact not…
Dmmikkel
  • 61
  • 1
4
votes
1 answer

Can Modelica translators handle for loops or matrix multiplications more easily?

Even though Modelica is an acausal modeling language, we learned e.g. here that it can make a difference how you write your equations. The code of the MutualInductor model in the Modelica.Electrical.Polyphase.Basic package puzzled me a bit and I am…
marco
  • 5,944
  • 10
  • 22
4
votes
1 answer

Combine multiple FMUs into one

I have a pandapower network and at some buses I have included batteries and photovoltaics as FMUs. Right now I have a master algorithm that creates the connections between the inputs and the outputs of the different FMUs and it runs the…
Kosmylo
  • 436
  • 1
  • 6
  • 20
4
votes
1 answer

Modelica and Event generation of Functions

I try to understand when events are generated in Modelica. In the context of functions I noticed behaviour I didn't expect: functions appear to suppress event generation. I am surprised as this is, to my knowledge, not explicitly stated in the…
user578943
  • 85
  • 5