1

I believe that there has been a change in the JModelica transfer_optimization_problem method that is not documented. If there is a new way of doing this, I'd like to know as I am new to JModelica. I am following the manual for JModelica 2.2 and I noticed that

from pyjmi import transfer_optimization_problem

does not exist, but this does:

from pyjmi.casadi_interface import transfer_optimization_problem

But this line returns an error:

op = transfer_optimization_problem("VDP_Opt", "VDP_Opt.mop")

The error:

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-27-e1ed8260993b> in <module>()
----> 1 op = transfer_optimization_problem("VDP_Opt", "VDP_Opt.mop")

/home/paperspace/JModelica/Python/pyjmi/casadi_interface.py in transfer_optimization_problem(class_name, file_name, compiler_options, compiler_log_level, accept_model)
    147 
    148     """
--> 149     op = OptimizationProblem()
    150     _transfer_optimization_problem(op, class_name=class_name, file_name=file_name,
    151                                    compiler_options=compiler_options,

/home/paperspace/JModelica/Python/pyjmi/common/core.py in __init__(self)
     44 
     45     def __init__(self):
---> 46         raise Exception("This is an abstract class it can not be instantiated.")
     47 
     48     def optimize(self):

Exception: This is an abstract class it can not be instantiated.
scottlittle
  • 18,866
  • 8
  • 51
  • 70
  • I tried to `import modelicacasadi_transfer` but received the error: `ImportError: No module named modelicacasadi_wrapper` so maybe something went wrong in the compilation and installation? – scottlittle Jun 02 '19 at 19:02
  • So, it is a compile error. I looked in the Makefile and there was a routine for making the interface ( `make build_casadi_interface` ), but I got this error: `-- Numpy libs: NUMPY_LIBS_1-NOTFOUND -- Configuring incomplete, errors occurred! See also "/home/paperspace/JModelica.org/build/ModelicaCasADiInterfaceBuild/modelicacasadi_wrapper/CMakeFiles/CMakeOutput.log". Makefile:951: recipe for target 'modelicacasadi_wrapper' failed make: *** [modelicacasadi_wrapper] Error 1 ` – scottlittle Jun 02 '19 at 21:01
  • pip installed numpy, then I had a cython error... thinking about giving up for now. – scottlittle Jun 04 '19 at 02:17

0 Answers0