Questions tagged [modelica]
Modelling language for multi-domain physical and control systems.
1,255
questions
0
votes
1
answer
44
views
why package does not open in modelica after rename it
I had a package of models that worked perfectly until I duplicated it and gave it a new name. The new package now won't open and displays an error message.
[C:/Users/moi/Desktop/VCR_model_29_12_2022/...
0
votes
0
answers
29
views
How do I use OMPython or OMShell to get connectors/ports for a component in a model
I currently work on building a parser from Modelica to a custom JSON structure.
As part of this, I want to use OMPython to extract all connectors/ports for each component in a model. Are there any ...
0
votes
0
answers
19
views
Modelica - How to initialize model with previous simulation solution?
I know this issue has been raised in the past but I could not find an answer on previous conversations.
I am working with Modelica (OpenModelica v1.20.0 (64-bit)). I am simulating a dynamic system and ...
0
votes
0
answers
14
views
Execute function: [...] opening and closing continuously in Dymola
I am running a Dymola model simulation, and I have noticed that a command line window constantly opens and closes rapidly, with a message 'execute function: TILMedia [...]'. Although this does not ...
0
votes
1
answer
33
views
Modelica buildings outputs error when connecting the terminal
I am trying to connect the grid to a line in the modelica building.electrical library.
I get this error:
[2] 18:20:02 Translation Error
[Buildings.Electrical.AC.ThreePhasesBalanced.Lines.Line: 4:5-4:...
-1
votes
1
answer
67
views
C-interface with two output variables [closed]
I've successfully used the External Function Interface (sect. 12.9 of MS) in Modelica with the usage of a C function returning a single Real (i.e. a double in C).
Now I need to use a function ...
2
votes
0
answers
85
views
Dymola simulateMultiResultsModel function kills seemingly random instances
I am trying to run a series of parametric simulations by varying a parameter lesThrTOut.threshold in my model (a Modelica.Blocks.Logical.LessThreshold block). I have been trying to get the function ...
1
vote
2
answers
79
views
Calling FMU's generated by Dymola in visual studio
If you create an FMU using Dymola and extract what is within the FMU, you would get something like this:
enter image description here
enter image description here
I used the following settings in ...
2
votes
1
answer
54
views
Python-Dymola interface: How is it possible to check in real time the progress of a Dymola model?
I am starting to use Python to run my Dymola models since I think that it has more potential than the Dymola scripts “.mos”. I’ve already set a similar code than the “DymolaExample.py”.
from dymola....
3
votes
1
answer
68
views
How to using FMPy extract the list of (continuous time) states?
In some interactive simulation work it is convenient to simulate up to a time point,
change some parameters, and then continue simulation.
Using FMU for simulation then you need to reload or reset the ...
0
votes
0
answers
44
views
Is the openmodelica power systems inverter bidirectional?
I am curious if anyone here knows if the 3 phase inverter from the powersystems library is bi-directional (converts DC to AC and AC to DC, preferably by controlled by user input). I read the ...
3
votes
1
answer
65
views
How to use two pins/ports in modelica and Powersytems library
I am new to modelica and I am having difficulty dealing with two pins/ports. For example I am using the class PowerSystems.AC3ph.Inverters.Inverter, and I am not sure how to connect the inverter.DC ...
0
votes
1
answer
63
views
How to get access to how results are stored using FMPy to simulate FMU-CS?
I develop a simulation script for optimization where each function evaluation is a simulation. Usually the speed can be improved considerably by only allow the simulation to store results in the RAM ...
1
vote
1
answer
57
views
Parameter without default value in a Modelica model
Context: Modelica 3.6 "Undefined modification" feature
In the release announcement of the Modelica language version 3.6 (see Modelica Association Newsletter 2023-01), there is a new syntax ...
0
votes
1
answer
70
views
Closed loop with water
I want to simulate the circulation of water in a closed circular pipe in Modelica, but all models, that i`ve seen require Boundaries.
Can i make something like that?enter image description here
UPD:
i ...
0
votes
1
answer
42
views
Modelica HNx mixing simulation, initial Mass_fraction as input or parameter
this question refer to the model example given as answer in this previous question
Modelica fluid mixing simulation
In the example, the initial mass fraction are defined in the Medium definition:
...
0
votes
1
answer
66
views
Dynamic pipe in Modelica
I can't understand the benefit of the nNodes parameter in the .Modelica.Fluid.Pipes.DynamicPipe component.
How can we choose this parameter and from the point of view of physics, what does it mean?
...
2
votes
1
answer
41
views
interactive simulation with OpenModelica using OPC UA interface
I made my second model simulating a gas pipe where we want to simulate the pipe filling by gas to validate our tightness test sequence.
The idea was to connect this model to our PLC program using OPC ...
1
vote
0
answers
72
views
Electrolysis in OpenModelica
I am very new to OpenModelica.
I have a few queries to solve my modelling of the electrolysis cell. I have a package of Electrolysis cell, then a media file and a model file. The media file contains ...
0
votes
1
answer
36
views
Failed to expand block containing connect
I´m trying to set a connection with a conditional on the temperature, to represent a temperature-sensible charging pipe that works inside a stratified heat storage tank, with the following for loop ...
1
vote
1
answer
46
views
Modelica - Choosing variable as parameter based on value being filled or null
I come from a world of thermodynamic cycle design using EcoSimPro's Proosis, so bear with me if I'm trying to mimick too much another software using Modelica.
I have a thermodynamic model for a ...
0
votes
0
answers
29
views
Trouble encountered during simulation
I want to simulate a DCDC converter for 300s with 10000 intervals, but during simualtion, I recieve the following error:
The code has encountered trouble from which it cannot recover.
can't continue. ...
2
votes
2
answers
78
views
How to diagnose what causes OpenModelica transient simulations to run slowly?
I have a transient model with Modelia.Fluid Valves and Dynamic Pipes that is running slowly. I am trying to find strategies and tools for identifying what is causing the slowness. By following the ...
0
votes
1
answer
29
views
value of rD (Modelica) [duplicate]
I'm new to modelica.
What is the evaluated value of rD in the following modelica Code ?
model A
Real rA = 1 + rB;
Real rB = 4;
model B
Real rB = 10;
Real rC = rA;
end ...
1
vote
1
answer
58
views
How to extract an MSL model, modify the code, and use locally?
I am interested to replace my own PID-regulator models with MSL/Blocks/Continuous/LimPID. The problem is that this model restricts limitations of output signals to be parameters and thus do not allow ...
0
votes
2
answers
50
views
Reducing sampling in simulation
Is there any way in Modelica, to reduce the sampeling during simulations? I have a DCDC converter with high frequency, consequently generating huge dataset. I am wondering, if there is any way to ...
0
votes
2
answers
39
views
Modelica evaluation of an expression
I'm new to Modelica, and I'm wondering, what would be the evaluation of rA within model B.
Is the value 5 or 11 ?
model A
Real rA = 1 + rB;
Real rB = 4;
model B
Real rB = 10;
...
1
vote
1
answer
79
views
Modelica fluid mixing simulation
I am newbie to modelica.
I am searching for people having experience with (open)modelica regarding fluid and media library.
My goal is to simulate pressure of a volume related to injection flows of ...
0
votes
1
answer
61
views
java.lang.NoClassDefFoundError with JModelica2.14
I am new to the Modelica world and installed JModelica2.14 on win10 via the binary file provided from the offical webpage. From the console I call setenv.bat, start the 64bit python envrionment and ...
2
votes
0
answers
65
views
Dymola giving different solution compared to OpenModelica
Below is the code snippet I have tried running in Dymola and OpenModelica to get varying results.
model Test
Real a[2,2](each start=0);
Real b[2,2];
algorithm
b := a;
a := [1,2; 2,4];
if ...
2
votes
2
answers
55
views
Can't add selector for all matching choices in Dymola
I was following the tutorial from Claytex at https://www.claytex.com/blog/dymola-basics-8-dymola-model-inheritance/ on partial and extended models. I'm able to create an inherited (extended) model ...
0
votes
0
answers
34
views
DASSL solver in OpenModelica
I use Modelica to solve a system of algebraic differential equations. The equations are discretized by hand in space. I use the DASSL integrator to integrate the equations in time. Would it be ...
0
votes
0
answers
45
views
DASSL solver in OpenModelica for an exchange between exterior and phase change material
I want to model heat transfer between the exterior and a phase change material on OpenModelica. The system of equations obtained is a system of algebraic differential equations. I have already ...
3
votes
2
answers
79
views
How to inherit a standard Fluid component and override and replace some equations of the base model?
I want to customize a standard Fluid Library component in Modelica using OpenModelica.
I want to create a customized version of a new Pump where several equations will be changed.
I inherited Fluid....
0
votes
1
answer
49
views
Same results after sweeping globalSeed parameter
I rewrited an example found in the Forum (which by the way works fine) in order to suit my case - swepping globaSeed parameter.
I expected that each simulation run will give a different result, but it ...
0
votes
2
answers
63
views
How to define a Combitimetable through a script in Dymola?
I am trying to perform several simulations in a sequence using a for loop in a script. From simulation to simulation, the only variable to change is the file path of a Combitimetable.
I propagated the ...
1
vote
1
answer
70
views
Proper use of inStream() and and actualStream() in Modelica when no volume present
I have used the Modelica "stream" concept for connectors for some time. What I understand the functions inStream() and actualStream() are designed for use
when the model has a volume. But ...
1
vote
1
answer
78
views
Conditionally enabling one of two connectors in modelica
I am trying to build a component which can be connected through one of two connectors based on a parameter. In the following example, depending on the boolean value, only one connector will be used at ...
0
votes
1
answer
64
views
Using modelica function as input to external "C" function
I am trying to call an external C function in modelica with a function as an argument.
So the C function needs to take a modelica "function" as input. Is it possible to do that in modelica ?...
1
vote
1
answer
77
views
How to get access to a parameter from another model in Modelica?
I have two models (A&B) in Modelica and I want to call a parameter from the model A in the model B. In fact, model A calculates the value of a parameter and I need to get access to that value in ...
2
votes
1
answer
68
views
TIL-library EffCompressor: getInputRotary is structurally singular when Inertia
I am fairly new at working with the TIL-library (v. 3.12.0) in Dymola2022. I am trying to include some inertia in the current compressor models of the TIL-library. To start simple, I choose the ...
1
vote
0
answers
44
views
Searchalgorithm in Modelica/Dymola
I'm currently trying to create a Modelica-Code, that searchs through an Array full of strings, compares them to strings in a different Array and safes the location where it found it and the location ...
1
vote
1
answer
69
views
How to hide result of an interface in modelica?
I have running a model with a block composed of several interfaces (thermal ports).
The dimension of the port is variable and sometime can be up to 20x20...
When I run the simulation, the calculation ...
0
votes
0
answers
70
views
AixLib 1.3.0 & 1.3.1 library is not loading in OpenModelica v1.19 & v1.20
I wanted to use AixLib in OpenModelica, but it does not load.
I tried loading both AixLib 1.3.0 & 1.3.1, but neither worked. It was tested on both OpenModelica v1.19 & v1.20.
I wonder whether ...
0
votes
1
answer
117
views
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed! - OpenModelica
I want to model a storage using phase change materials. Basically, a hot heat transfer medium flows into one plate of the exchanger and a cold heat transfer medium flows in counterflow into another ...
0
votes
2
answers
98
views
Usage for ExternalMedia in Dymola
I am a student who is researching about HVAC.
I'm modelling a heat pump system and I got some problem.
As I was going to get the fluid property by ExternalMedia, I got some error.
The source code is ...
0
votes
0
answers
67
views
Modelica : Use interval as a parameter : how to do?
So, i'm a beginner with modelica and I am using some clocked blocks for my model (i know that's not very good to have discrete behavior, but i am not enough good to avoid this...).
Now I have a ...
1
vote
1
answer
92
views
Modelica : Simulation of temperature rise in a cable - How to do?
I am a beginner on modelica. I wanted to transpose a model found on a paper (on internet) to a modelica model.
Here is the paper :
Insulated Cable Temperature Calculation and Numerical Simulation
I am ...
3
votes
1
answer
61
views
How to export .csv files using a script in Dymola?
I am running a big set of simulations in Dymola using a script, so far, it works well.
However, it remains incomplete because all the results are still in .mat and I have not find a way to ...
3
votes
1
answer
74
views
ModelicaRes import fails in python
I want to use ModelicaRes to open my Dymola results in python but the import fails.
from modelicares.simres import SimRes
Gives the following error:
----------------------------------------------------...