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
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
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

ERROR: division leads to inf or nan at time XX, (a=x) / (b=y), where divisor b is: firstOrder.T

I have a model designed in OpenModelica contains integrators and transfer functions and first orders. When I run this model in OMEdit, it works fine. But when I run the FMU, I have an error for division by zero for the firstorder block. assert |…
amro
  • 51
  • 2
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
0 answers

Modelica evaporation of water into air within a closed vessel (pressure cooker)

Goal Modelica model of a pressure cooker: I want to model how the liquid water is first heated up to the saturation point. Then water evaporates and mixes with the air. At start the liquid water has a volume of one liter and the air a volume of 100…
T. Sergi
  • 203
  • 2
  • 9
4
votes
1 answer

Apply 1D Torque to 3D Revolute Joint without back reaction

the model is as simple as this: I'd like to apply a torque to the Rotational Flange of a Revolute Joint. However, the torque reaction should not be applied to the Support Flange of the Revolute Joint. The torque reaction is indeed counterbalanced…
DarioMangoni
  • 301
  • 1
  • 10
4
votes
1 answer

All branches in if equation with non-parameter tests must have the same number of equations - Modelica

I get an error on Modelica saying: All branches in if equation with non-parameter tests must have the same number of equations The source of the error is following section of the code: equation if der(Posit2.s)<=0 then …
alimuradpasa
  • 135
  • 1
  • 10
4
votes
1 answer

use ClaRaLib with OMEdit

I came across the feature rich modelica library ClaRa. It seems to need Dymola to run properly. Is there a way to make it run with OMEdit or any other free editor? I keep getting errors "with no error message".
knobber
  • 63
  • 3
4
votes
2 answers

How do I define relations between parameters and retain flexible use?

How do I define relations between multiple parameters in such a way that I can choose which parameters from the set to define, some equations defining the rest? For example, I have a model with 3 parameters for the radius, height and volume of a…
Christoph
  • 5,480
  • 6
  • 36
  • 61
4
votes
1 answer

Modelica set multiple parameters with record

To override multiple parameters of a permanent magnet DC machine with the content of a DcPermanentMagnetData record I use this construct: Modelica.Electrical.Machines.Utilities.ParameterRecords.DcPermanentMagnetData dcpmData( IaNominal = 1, …
id -un
  • 188
  • 1
  • 8
4
votes
1 answer

How to implement Cycle counting in Modelica?

I have a battery model in Modelica. PNet is the value of power flowing through battery (PNet is positive for charging and negative for discharging). This oscillates based on a load. I want to calculate the number of cycles that the battery is put…
4
votes
2 answers

Multidimensional Tables in Modelica Block

I started to use openmodelica few days ago. I created a lot of tables where Data is defrost efficiency, first row is Air temperature which is my first input and first column is Leaving water temperature from the condenser which is my second input.…
dav
  • 41
  • 3
4
votes
1 answer

Modelica annotation inverse of function is ignored

Problem: the inverse annotation of a function is ignored and the inverse is computed numerically. According to Modelica Specifications it is possible to specify an inverse of a given function. In order to test this functionallity I tried with a very…
DarioMangoni
  • 301
  • 1
  • 10
4
votes
1 answer

How to use boolean switches in Modelica to prevent draining a stock below zero?

Problem description I am building a library to support System Dynamics (SD) like modeling in Modelica. Unlike the freely available library by Cellier et al. I am convinced that one may well make use of acausal connectors: Transmitting the stock…
gwr
  • 465
  • 6
  • 17
4
votes
1 answer

How to set a start value for a modelica parameter that is returned as part of an array from a function

I am receiving the following warning message from Dymola when simulating a fairly complex steady-state model for simulating a multi-circuit refrigerant system. The following variables are iteration variables of the initialization problem: …
Justin Kauffman
  • 423
  • 3
  • 10
1
2
3
46 47