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.