modelica

Change annotation(Evaluate=true/false ) for parameters in models from Modelica Standard Library

ぃ、小莉子 提交于 2019-12-18 07:08:46
问题 I am using some components from the Modelica Standard Library (MSL) in my simulations. These components each have some parameters. For example, Modelica.Fluid.Sources.MassFlowSource_T has a parameter m_flow . Usually, parameters can be changed between simulation runs without re-compilation. This is not the case for m_flow , because it has an annotation(Evaluate=true) , so it is used for symbolic processing. Is it possible to change the annotations of parameters at instantiation? I tried the

Change annotation(Evaluate=true/false ) for parameters in models from Modelica Standard Library

不打扰是莪最后的温柔 提交于 2019-12-18 07:08:10
问题 I am using some components from the Modelica Standard Library (MSL) in my simulations. These components each have some parameters. For example, Modelica.Fluid.Sources.MassFlowSource_T has a parameter m_flow . Usually, parameters can be changed between simulation runs without re-compilation. This is not the case for m_flow , because it has an annotation(Evaluate=true) , so it is used for symbolic processing. Is it possible to change the annotations of parameters at instantiation? I tried the

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

Using units/components in Modelica based on a Boolean condition

对着背影说爱祢 提交于 2019-12-13 02:35:29
问题 Let's say I maybe want to import a component based on some condition, let's say a boolean variable. I've tried this, but it gives me an error message. For instance, consider the following code: model myNewModel parameter Boolean use_Something; myLibrary.myComponent component[if use_Something then 1 else 0]; // In other words (pseudo): // if use_Something then 'Import The Component' else 'Do Nothing At All'; end myNewModel; This is, intuitively, a safe statement, and as long as the boolean

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

Define Model Parameter as Variable

十年热恋 提交于 2019-12-13 01:08:22
问题 I am attempting to define the parameter of a model (block) as a variable. For example: Real WallThickness = 0.5; Real WallConductance = 10*WallThickness; Modelica.Thermal.HeatTransfer.Components.ThermalConductor TopPanelConductor(G=WallConductance); I would like to define "G" so that it remains constant throughout the simulation but the coefficient is updated prior to the simulation based on the other variable "WallThickness". When defining the ThermalConductor parameter "G" as a variable in

Backflow Orifice (Zeta)

心不动则不痛 提交于 2019-12-13 00:35:56
问题 I would like to simulate 3 pumps and a pressure sink. The problem now is if I want the pump to pump the medium in the opposite direction(backflow), the orifice does not work anymore... Can anyone please help me? Picture of the model Picture of the signal This is the error message: Log-file of program ./dymosim (generated: Thu Mar 08 09:21:33 2018) dymosim started ... "dsin.txt" loading (dymosim input file) Residual component 1 of system 1 is 1.255542e+002 Residual component 2 of system 1 is 1

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