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
4
votes
1 answer

Conditional Components in Modelica

I want with conditional expressions reduce large general models with over 300000 equations so that only a relevant part remains. To illustrate the problem I have the following minimal model: model Test parameter Boolean level1=true; parameter…
tlask
  • 43
  • 4
4
votes
1 answer

Dynamic pipe model in MSL, Finite Volume Method

I'm trying to use Modelica for modeling of a system composed of elastic pipes. For now, I'm trying to implement my own dynamic pipe model (rigid, not yet elastic) using the same approach (finite volume, staggered) like in the Modelica.Fluid library,…
T. Sergi
  • 203
  • 2
  • 9
4
votes
1 answer

Switch type based on boolean parameter (without inheriting)?

I have a model representing some chemical process, and I want the reaction model to be switchable between an absorption and a desorption class (which define the respective model), based on a boolean parameter. I tried to do it like this: model…
Christoph
  • 5,480
  • 6
  • 36
  • 61
4
votes
1 answer

Repeated components with pattern dependent parameters

Imagine there is a repeating pattern of components (e.g., dynamic pipe) which has a parameter (e.g., length) which will change depending on where in the pattern it resides. I proposed that it might be possible by omitting the "each" prefix before…
Scott G
  • 2,194
  • 1
  • 14
  • 24
4
votes
2 answers

Managing of Navier-Stokes PDEs by means of SBF in Dymola

Has anyone tried to implement the Navier Stokes Partial Differential Equations (PDE) in Modelica? I found the method of the spatial basis functions (SBF) which by means of numerical modifications gets Ordinary Differential Equations (ODE) that could…
victor.aer
  • 106
  • 5
4
votes
3 answers

modelica: compute minimum/maximum of continuous variable over time

As stated above: I wish to compute the minimum (and/or maximum) of a continuous variable over time. Here is a minimal example to demonstrate: model MinMaxTest Real u; Real u_min(start = 10); Real u_max(start = -10); equation u = sin(time /…
PeterE
  • 5,715
  • 5
  • 29
  • 51
4
votes
1 answer

export of dymola model requires the derivative of its input

I would like to export a Dymola model to Simulink. The model consists of a derivative block (der), a RealInput, a RealOutput and there connections. When I translate this model, the following error appears: "The model requires derivatives of some…
C Winkler
  • 161
  • 2
  • 15
4
votes
1 answer

OpenModelica Simulation Flags Documentation

is there any detailed documentation available on what all the options in Simulation Setp > Simulation Flags in OpenModelica do? OpenModelica documentation does give a short description for some of the flags, but not for all.
MSK
  • 448
  • 2
  • 5
  • 18
4
votes
1 answer

difference between 'when' and 'if' in OpenModelica?

I'm new to OpenModelica and I've a few questions regarding the code of 'BouncingBall.mo' which is distributed with the software as example code. 1) what's the difference between 'when' and 'if'? 2)what's the purpose of variable 'foo' in the…
Salman Azmat
  • 298
  • 6
  • 18
3
votes
1 answer

How to reverse the SweptVolume block?

I'm trying to simulate a simple case. One sweptVolume is connected to another one. Flange.b to flange.b like that: When the pressure in the OilChamber is rising, the volume expands, and the piston moves out. (So far, all good and logical). The…
3
votes
1 answer

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 and inverter.vPhasor pins/ports. Currently I am…
3
votes
2 answers

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 guidance in the Using the Profiler from OMEdit…
3
votes
2 answers

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.Machines.BaseClasses.PartialPump as a base model…
neon
  • 33
  • 4
3
votes
1 answer

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

less than or equal not equal less than or equal in modelica?

I tried a simple example with OpenModelica v1.20.0, but I find a confusing results. The code is as follows: model test Boolean state1; Boolean state2; Real f; equation f = if time<1 then 0.5 else if time<3 then 0.4 else if time<5 then 0.3…
Jack Hsueh
  • 115
  • 8
1 2
3
46 47