openmodelica

Follow up question: Modelica total time calculation of simulation and equation initialization

强颜欢笑 提交于 2020-05-15 19:26:06
问题 I am writing this question related to this. In his reply, Marco gave me an excellent answer but, unfortunately, I am new with OpenModelica so I would need some further help. I am actually using OpenModelica and not Dymola so unfortunately I have to build the function that does it for me and I am very new with OpenModelica language. So far, I have a model that simulates the physical behavior based on a DAEs. Now, I am trying to build what you suggest here: With get time() you can build a

Replacement of deprecated function cardinality(c) in Modelica

ⅰ亾dé卋堺 提交于 2020-05-14 20:42:34
问题 In the documentation it is indicated, that cardinality() function is deprecated and should no longer be used. However, it is still used in the libraries such as ThermoSysPro. e.g. if (cardinality(C) == 0) then some code end if; where C is FluidInlet or FluidOutlet Could anyone give a simple example of how it could be replaced? 回答1: The usual solution is to make the connector conditional, and if enabled you require that it is connected. For physical connectors you can see how heatports and

What are the differences between diffferent Modelica Simulation Environments?

为君一笑 提交于 2020-04-10 03:42:25
问题 There are different Modelica Simulation Environments, including Dymola, Wolfram SystemModeler, OpenModelica, and Jmodelica. So, I try to load a thermal fluid library(ThermoSysPro https://github.com/Dwarf-Planet-Project/ThermoSysPro), but except Dymola, the results on the other software all end with errors. If the library and the simulation environment are all based on the Modelica Specification Standard, why there is a compatibility issue? I think that maybe the library includes some features

What are the differences between diffferent Modelica Simulation Environments?

微笑、不失礼 提交于 2020-04-10 03:41:23
问题 There are different Modelica Simulation Environments, including Dymola, Wolfram SystemModeler, OpenModelica, and Jmodelica. So, I try to load a thermal fluid library(ThermoSysPro https://github.com/Dwarf-Planet-Project/ThermoSysPro), but except Dymola, the results on the other software all end with errors. If the library and the simulation environment are all based on the Modelica Specification Standard, why there is a compatibility issue? I think that maybe the library includes some features

PyFMI in Python 3 environment in Ubuntu 18.04

非 Y 不嫁゛ 提交于 2020-02-26 02:37:28
问题 My goal is to be able to run FMUs produced by OpenModelica in Ubuntu 18.04 and then run these with PyFMI in Python 3 environment. I follow the outline for PyFMI installation here https://jmodelica.org/pyfmi/installation.html. So far I have using Conda managed to install Python3, Numpy, Scipy, lxml and some other packages and made it work with some of my Python examples. But I would appreciate some detailed advice how to Install FMI Library - and I do not get how to setup the flag fmil-home

How to use the value of the variable in the previous interval as an input to the equation…?

别说谁变了你拦得住时间么 提交于 2020-01-03 21:03:19
问题 Is it possible to use the previous value of the time varying variable for eg: Suppose I have pipe whose inlet temperature is 298K with a specified uniform mass flow(m_flow), now suppose i am heating the pipe using a heater of 100 watts. The outlet temperature will be attain a higher temperature of suppose 302K, now if i have to use this outlet temperature as my inlet temperature (in the sense i am recircuilating the water), how would i be doing it? is it possible to update the value of the

Including a causal relation in a Modelica simulation leads to translation Error while flattening model

我们两清 提交于 2019-12-31 05:23:07
问题 I want to simulate a controller for a mass-spring model which works based on energy: model model //constants parameter Real m = 1; parameter Real k = 1; parameter Real Fmax = 3; parameter Real x0 = 1; parameter Real x1 = 2; parameter Real t1 = 1; //variables Real x, v, a, xy, vm; initial equation x = x0; v = 2; equation v = der(x); a = der(v); m * a + k * x = F; algorithm vm := sign(xy - x)*sqrt(2 * (Fmax * abs(xy - x) + k * (xy^2 - x^2) / 2) / m); // step signal if time < t1 then xy := x0;

Two-Phase Modelica Media example

こ雲淡風輕ζ 提交于 2019-12-30 07:18:06
问题 I am trying to develop a simulation in OpenModelica of a flow that has a single substance that will be liquid or vapor. The Modelica.Media.Water models do have two phases, but are extremely complicated, and would be very hard to reproduce for a completely different substance. I would like to find a simple example of a two phase medium that I can work from. There is a partial package TemplateMedium and a partial package PartialTwoPhaseMedium, but I don't see any examples of how to write a

Limit number of cores used by OMPython

一个人想着一个人 提交于 2019-12-25 02:24:42
问题 Background I need to run a blocks simulation. I've used OMEdit to create the system and I call omc to run the simulation using OMPython with zmq for messaging. The simulation works fine but now I need to move it to a server to simulate the system for long times. Since the server is shared among a team of people, it uses slurm to queue the jobs. The server has 32 cores but they asked me to use only 8 while I tune my script and then 24 when I want to run my final simulation. I've configured

Switch between two flanges

拥有回忆 提交于 2019-12-24 08:56:07
问题 I am currently working with multibody mechanical systems using the MultiBody library included in the standard Modelica distribution. I need to implement a switch between flanges, in order to select position or force control for a given joint. model FlangeSwitch "Switch between flanges" Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a_1; Modelica.Mechanics.Translational.Interfaces.Flange_b flange_b_1; Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a_2; Modelica