Questions tagged [jmodelica]

An extensible Modelica-based open source platform for optimization, simulation, and analysis of complex dynamic systems.

From the docs:

JModelica.org is an extensible Modelica-based open source platform for optimization, simulation and analysis of complex dynamic systems. The main objective of the project is to create an industrially viable open source platform for optimization of Modelica models, while offering a flexible platform serving as a virtual lab for algorithm development and research.

JModelica.org is distributed under the GPL v.3 license approved by the Open Source Initiative.

JModelica.org at a glance:

  • Model your systems using the object-oriented and equation-based language Modelica
  • Solve your complex simulation and optimization problems using state of the art numerical algorithms
  • Automate your work in the Python scripting environment
  • Visualize your results
111 questions
1
vote
1 answer

JModelica: Changing a loop-iteration variable without re-compiling

I got the following, quiet fundamental, problem with JModelica. Consider a rather simple model: model TEST Real Dum(start = 0); parameter Integer It = 5; algorithm Dum := 0; for i in 1:It loop Dum := Dum + 1; end for; end TEST; I…
1
vote
1 answer

JModelica: Python Shell and IPython trouble importing package

So I just installed JModelica and with this Python 2.7 is included. When I use the IPython-console and try to import the following (it works): from pymodelica import compile_fmu However when I write this in the Python Shell program it says:…
jazy
  • 75
  • 4
  • 14
1
vote
2 answers

Modelica Class Method

I would like to use a class function/method in my Modelica model as follows: optimization Moo(objective=-x(finalTime), startTime = 0, finalTime = 12) parameter Real e = 0.05; Real x(start=2, fixed=true, min=0, max=100); input Real v (min=0,…
Richard
  • 56,349
  • 34
  • 180
  • 251
1
vote
1 answer

JModelica refuses to load libhsl.so

JModelica is refusing to load the file libhsl.so as a shared library, even though I have set the LD_LIBRARY_PATH variable: Exception of type: OPTION_INVALID in file "../../../../Ipopt/src/Algorithm/IpAlgBuilder.cpp" at line 321: Exception…
Richard
  • 56,349
  • 34
  • 180
  • 251
1
vote
1 answer

Set Modelica Derivative Units

I know I can define parameter units like so: parameter Modelica.SIunits.Mass m0 = 2 "Mass"; And the units of state variables like so: Real m(start=m0, fixed=true, min=0, max=100, unit="kg"); But how can I define the units of a derivative? (Or are…
Richard
  • 56,349
  • 34
  • 180
  • 251
1
vote
1 answer

How do I make JModelica be quiet?

I am running the following JModelica script: #!/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']…
Richard
  • 56,349
  • 34
  • 180
  • 251
1
vote
2 answers

Can JModelica print results directly to file?

I am running the following JModelica script: #!/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']…
Richard
  • 56,349
  • 34
  • 180
  • 251
1
vote
2 answers

JModelica and Concurrent Futures

I am using JModelica to optimize a model using IPOPT in the background. I would like to run many optimizations in parallel. At the moment I am doing this using the multiprocessing module. Right now, the code is as follows. It performs a parameter…
Richard
  • 56,349
  • 34
  • 180
  • 251
0
votes
2 answers

Example MSL Fluid and Media and annotations removed gives initialisation problems?

I try to understand MSL Fluid and Media better and study the very basic example Modelica.Fluid.Examples.Tanks.EmptyTanks. Water flows simply from the upper tank to the lower tank. See the code below. encapsulated package MSL_FLUID_MEDIA_TEST …
janpeter
  • 681
  • 8
  • 22
0
votes
1 answer

java.lang.NoClassDefFoundError with JModelica2.14

I am new to the Modelica world and installed JModelica2.14 on win10 via the binary file provided from the offical webpage. From the console I call setenv.bat, start the 64bit python envrionment and import '.\install\Python_64'. However, running the…
S14p
  • 51
  • 1
  • 7
0
votes
1 answer

How to introduce scaling of parameters to MSL CombiTimeTable?

I want to use MSL CombiTimeTable and be able to scale the parameters here from a scaling factor provided by another block or model. (The idea is to give flexibility for the user to express switching time points in sort of different units, eg. …
janpeter
  • 681
  • 8
  • 22
0
votes
1 answer

Python: How to solve DAE with Jacobian efficiently?

I am trying to use the Assimulo package to solve a set of differential algebraic equations (DAEs). I am trying to use an algorithm similar to that shown here. However, there does not seem to be an option to pass in a sparse matrix. My Jacobian…
0
votes
1 answer

Cannot run fmu.get_fmu_state() in pyfmi library

I am trying to understand how the method get_fmu_state works on a simple fmu in cosimulation mode example like the bouncing ball using PyFMIs(2.7.3) pre-supplied fmu. I have installed it via miniconda on a ubuntu-docker and try to execute the…
CS101
  • 444
  • 1
  • 6
  • 21
0
votes
1 answer

How to combine Python 3 with standard JModelica dependent on Python 2?

I would like to install Python 3 with PyFMI at my Windows computer where I already have JModelica 2.10 with Python 2. My idea is thus to compile Modelica models to FMUs in Python 2 as necessary but then develop scripts in Python 3 to run the FMUs…
janpeter
  • 681
  • 8
  • 22
0
votes
1 answer

compiling FMU with Jmodelica

I have a problem compiling FMU's in Jmodelica. for a medium size model I get the following error. I already chanded the runtime parameter of JAVA in control panel and also tired setting the JVM allocated memory as high as possible using Xmx…