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
26
votes
0 answers

Non-discrete assignments to integer variables

Is the non-discrete assignment of expressions to integers only possible within the algorithm of a function? If many model parameters are needed within the algorithm it would be much simpler to calculate the output value directly in the algorithm…
Tobias
  • 5,038
  • 1
  • 18
  • 39
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
0 answers

debug the structurally singular and minimize nonlinearity of Modelica models

I build a Modelica model, but when checking the model (Here is the model download link), it shows a local singularity like in the following screenshot. so I delete the code showed in the error message. h[3]=(hout+hl)/2 but although the model…
Jack
  • 1,094
  • 6
  • 16
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
10
votes
1 answer

Difference between equation and algorithm section

Equation section : declarative Algorithm section : imperative Can anyone help me with examples that show the difference between these two sections in Modelica Language? When to use what section?
shilu
  • 135
  • 1
  • 6
9
votes
1 answer

Modelica style guide

For many programming languages there are style guides available, e.g. PEP8 for Python, this Matlab style guide or the style guides by Google. For Modelica I found the conventions described in the Users Guide, but is there something more…
matth
  • 2,568
  • 2
  • 21
  • 41
8
votes
1 answer

How can I access the time variable in modelica

I would like to model an explictly time dependent differential equation in Modelica. Say I would like to model Real x(start=1); der(x) = t; in Modelica. What is the correct way to access the time variable t?
Hans
  • 1,741
  • 3
  • 25
  • 38
8
votes
1 answer

Effective simulation of large scale Modelica models by automatic translation to Modia

this is more of an hypothetical question, but might have great consequences. Lot of us in Modelica community are dealing with large scale systems with expensive simulation times. This is usually not an obstacle for bugfixing and development, but…
filip-jezek
  • 103
  • 2
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
3 answers

Consistent terminology: Modeling, DAE, ODE

I am new to the subject "modeling of physical systems". I read some basic literature and did some tutorials in Modelica and Simulink/Simscape. I wanted to ask you, if I understand the following content correctly: Symbolic manipulation is the…
AssMero
  • 239
  • 1
  • 5
1
2 3
87 88