openmodelica

N-dimensional (linear) interpolation on external table in Modelica

泪湿孤枕 提交于 2019-12-24 00:14:47
问题 I would like to extend the functionality provided by Modelica Standard Library's types ExternalCombiTable1D and ExternalCombiTable2D , to implement an N-dimensional (linear) interpolation (with "N" up to at least 4, possibly getting up to 8) on external data tables (saved on txt data files). What would be the best way to do that? 回答1: You might wanna have a look at the current list of ideas for future extensions: https://github.com/modelica/Modelica/issues/1153 回答2: Dassault Systems has

OpenModelica: “Warning: maximal number of iteration reached but no root found” with conditional equation

天大地大妈咪最大 提交于 2019-12-20 05:32:58
问题 I am an OpenModelica beginner trying to model a DC/DC converter with constant voltage and current limiting. Basically the output is supposed to give a constant voltage until the maximum current is reached and then hold that current by reducing voltage. This is the equation part of my code so far: model DC_DC "Voltage source with current limiting" import SI = Modelica.SIunits; parameter SI.Voltage Vnom(start=1) "Value of nominal output voltage"; parameter SI.Current Inom(start=1) "Value for

OpenModelica: “Warning: maximal number of iteration reached but no root found” with conditional equation

只谈情不闲聊 提交于 2019-12-20 05:31:13
问题 I am an OpenModelica beginner trying to model a DC/DC converter with constant voltage and current limiting. Basically the output is supposed to give a constant voltage until the maximum current is reached and then hold that current by reducing voltage. This is the equation part of my code so far: model DC_DC "Voltage source with current limiting" import SI = Modelica.SIunits; parameter SI.Voltage Vnom(start=1) "Value of nominal output voltage"; parameter SI.Current Inom(start=1) "Value for

Failed to solve linear system of equations

醉酒当歌 提交于 2019-12-14 01:49:42
问题 I'm trying to solve the code model modelTest // types type Mass = Real (unit = "Kg", min = 0); type Length = Real (unit = "m"); type Area = Real (unit = "m2", min = 0); type Force = Real (unit = "Kg.m/s2"); type Pressure = Real (unit = "Kg/m/s2"); type Torque = Real (unit = "Kg.m2/s2"); type Velocity = Real (unit = "m/s"); type Time = Real (unit = "s"); // constants constant Real pi = 2 * Modelica.Math.asin(1.0); parameter Mass Mp = 0.01; parameter Length r1 = 0.010; parameter Integer n = 3;

Pause JModelica and Pass Incremental Inputs During Simulation

六眼飞鱼酱① 提交于 2019-12-14 01:20:36
问题 Hi Modelica Community, I would like to run two models in parallel in JModelica but I'm not sure how to pass variables between the models. One model is a python model and the other is an EnergyPlusToFMU model. The examples in the JModelica documentation has the full simulation period inputs defined prior to the simulation of the model. I don't understand how one would configure a model that pauses for inputs, which is a key feature of FMUs and co-simulation. Can someone provide me with an

Discretizing PDE in space for use with modelica

戏子无情 提交于 2019-12-13 01:17:23
问题 I am currently doing a course called "Modeling of dynamic systems" and have been given the task of modeling a warm water tank in modelica with a distributed temperature description. Most of the tasks have gone well, and my group is left with the task of introducing the heat flux due to buoyancy effects into the model. Here is where we get stuck. the equation given is this: Given PDE But how do we discretize this into something we can use in modelica? The discretized version we ended up with

FMU FMI simulation, no modification of results when setting certain type of parameter

╄→гoц情女王★ 提交于 2019-12-12 21:25:39
问题 I developed for the example a simple Modelica model based on the fluid library of the MSL. I connected a MassFlowSource with a pipe and a Boundary_PT as sink function as in the picture below: http://www.casimages.com/img.php?i=14061806120359130.png I generate a FMU package with OpenModelica (in mode model-exchange). I manage this FMU package with python with the code below: import pyfmi, os from pyfmi import load_fmu myModel = load_fmu('PathToFolder\\test3.fmu') res1 = myModel.simulate() #

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

让人想犯罪 __ 提交于 2019-12-12 16:36:01
问题 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 code? 3)in line(15) - "when {h <= 0.0 and v <= 0.0,impact}" ,, shouldn't the expression for 'when' be enough as "{h <= 0.0 and v <= 0.0}" because this becomes TRUE when impact occurs, what's the purpose of impact (to me its redundant here) and what does

Abstract switch in Modelica

青春壹個敷衍的年華 提交于 2019-12-12 16:07:29
问题 I would like to motivate a question I asked before about a Modelica array of partial model. Consider the following model of a switch between 2 controllers. model Switch input Real u; input Integer sel; output Real y; protected Real x; equation if sel == 1 then y = 0.1 * (0 - u); der(x) = 0; else y = 0.1 * (0 - u) + 0.2 * x; der(x) = 0 - u; end if; end Switch; Let's ignore the fact that the PI controller may break when it is not selected for some time due to divergence of x . This can be fixed

Modelica Flow Simulation says divide by zero

故事扮演 提交于 2019-12-12 06:55:44
问题 I am trying to simulate the flow in a pipe that starts out partially full, and gradually fills up. Once it is full, the flow equation needs to change. I have tried the following code, but I get a divide by zero error once the pipe is full. TestTrap1 is a demo that shows the problem. It seems that some equation is not correct once the pipe is full. I am using openmodelica to run this. package FlowPackage package Interfaces extends Modelica.Icons.InterfacesPackage; //Use this for a inlet outlet