jmodelica

FMU Variable Values Do Not Match Input

情到浓时终转凉″ 提交于 2019-12-11 06:42:34
问题 I'm getting some strange behavior in a simple co-simulation that I'm trying to configure. I setup a building energy model in EnergyPlus to test out an FMU generated from JModelica. However, the building energy model would get hung up at the co-simulation step. I then ran the FMU in JModelica and got some very strange results. The Modelica code is: model CallAdd input Real FirstInput(start=0); input Real SecondInput(start=0); output Real FMUOutput(start=0); function CAdd input Real x(start=0);

FMU-module method get_states_list()

谁说胖子不能爱 提交于 2019-12-11 06:18:34
问题 I found a limitation of the FMU-module method get_states_list(). This method seems to bring a list only of continuous time states and not of discrete time states. I do usually make models that contain both continuous and discrete time sub-models describing process and control system and I am very interested to be able to get a list of ALL states in the system. One possibility could have been get_fmu_state() but I get the exception text “This FMU does not support get and set FMU-state”.

Why do q_nom & head_nom always give issues for models built from ThermoPower Library?

微笑、不失礼 提交于 2019-12-11 04:13:57
问题 I've been working within the ThermoPower Library of OpenModelica for a while now trying to build a Combined Power Cycle by first modeling the Brayton and Rankine Power Cycles first. Every time I attempt to use a pump, I always receive errors like: [1] 10:31:00 Translation Error [ThermoPower.Examples: 2523:70-2523:81]: Variable q_nom not found in scope ThermoPower.Examples.RankineCycle.Models. [2] 10:31:00 Translation Error [ThermoPower.Examples: 2531:21-2531:69]: Cyclically dependent

matrix singular under determined linear system not solvable

我的未来我决定 提交于 2019-12-11 00:59:07
问题 Following this question, I modified my code to: model test // 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 Length r3

What is the format of JModelica result_file_name output?

℡╲_俬逩灬. 提交于 2019-12-10 12:07:16
问题 I am using the following code to print out results from JModelica: #!/usr/local/jmodelica/bin/jm_python.sh import pyjmi op = pyjmi.transfer_optimization_problem("BatchReactor", "model.mop") opt_opts = op.optimize_options() opt_opts['n_e'] = 40 # Number of elements opt_opts['result_file_name'] = '/z/out' opt_opts['IPOPT_options']['tol'] = 1e-10 opt_opts['IPOPT_options']['print_level'] = 0 res = op.optimize(options=opt_opts) Inspecting the file /z/out , it has the following structure: #1 char

Sensitivity Analysis using PyFMI - FMU in for-loop

本小妞迷上赌 提交于 2019-12-09 06:53:09
问题 Main goal Sensitivity analysis of a district heating network. Approach Modelica model of the system (in Dymola) using the AixLib and BuildingSystem libraries Export model as FMU co-simulation Use SALib (sensitivity analysis python library) to define the samples (parameter sweep) Use PyFMI to run the model in a for-loop in Python for all the individual samples (and parallelize the for loop maybe using JobLib to perfome the simulation on multiple processors) SALib to perform a variance-based

Setting up Jupyter Notebook for JModelica

妖精的绣舞 提交于 2019-12-05 13:13:59
I would like to use Jupyter Notebook for editing JModelica python scripts; however after installing, the Jupyter notebook cannot locate key libraries, such as pymodelica. Here is the process I followed to install Jupyter Notebook for JModelica Version 2.1: In the IPython terminal: !pip install jupyter In windows CMD I navigate using cd C:\JModelica.org-2.1\Python27\Scripts I then open using jupyter notebook Within the notebook I create a Python 2 file and attempt to import the pymodelica library, which is followed by: ImportError Traceback (most recent call last) in () ----> 1 import

Sensitivity Analysis using PyFMI - FMU in for-loop

只谈情不闲聊 提交于 2019-12-03 08:51:24
Main goal Sensitivity analysis of a district heating network. Approach Modelica model of the system (in Dymola) using the AixLib and BuildingSystem libraries Export model as FMU co-simulation Use SALib (sensitivity analysis python library) to define the samples (parameter sweep) Use PyFMI to run the model in a for-loop in Python for all the individual samples (and parallelize the for loop maybe using JobLib to perfome the simulation on multiple processors) SALib to perform a variance-based sensitivity analyses ( http://salib.readthedocs.io/en/latest/basics.html#an-example ) First step Simple

Generating two random time depedant veariables with different sample periods

跟風遠走 提交于 2019-12-03 00:12:52
问题 Following this question, I'm trying to generate two time-dependent random functions omega1 and tau using this example. The difference is that I need to have two different sample periods of 0.05 and 0.17 for omega1 and tau respectively. I just duplicated the parts I thought would do the job: model testData extends Modelica.Icons.Example; import Modelica.Math.Random.Generators; import Modelica.Math.Random.Utilities; parameter Real k = 50.0; parameter Real J = 0.001; Real theta1; Real theta2;