adbuerger / casiopeia

Casadi Interface for Optimum experimental design and Parameter Estimation and Identification Applications
GNU Lesser General Public License v3.0
34 stars 6 forks source link

NotImplementedError when running examples due to casadi.vertcat in Python 2.7.12 #20

Closed ankur-gupta closed 7 years ago

ankur-gupta commented 7 years ago

I installed casadi (casadi-py27-np1.9.1-v3.1.0.tar.gz) manually by following instructions. I have a Kubuntu 16.04 system. I am able to run a casadi example successfully. I installed casiopeia version 0.1.2 using pip. When I try to run the 2d_vehicle_doe.py example, I get the following error. I get the same error with other examples.

Any help with running the examples would be greatly appreciated.

In [1]: %run 2d_vehicle_doe.py
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
/home/ankur/Downloads/2d_vehicle_doe.py in <module>()
     44         - p[4] * x[3]**2 \
     45         - p[5] \
---> 46         - (x[3] * u[0])**2 * p[1]* p[0]])
     47 
     48 phi = x

/home/ankur/toolbox/casadi/python/casadi/casadi.pyc in vertcat(*args)
    409 
    410 def veccat(*args): return _veccat(args)
--> 411 def vertcat(*args): return _vertcat(args)
    412 def horzcat(*args): return _horzcat(args)
    413 def diagcat(*args): return _diagcat(args)

/home/ankur/toolbox/casadi/python/casadi/casadi.pyc in _vertcat(*args)
  16836 
  16837     """
> 16838     return _casadi._vertcat(*args)
  16839 
  16840 def horzsplit(*args):

NotImplementedError: Wrong number or type of arguments for overloaded function '_vertcat'.
  Possible prototypes are:
    _vertcat([Sparsity])
    _vertcat([IM])
    _vertcat([DM])
    _vertcat([SX])
    _vertcat([MX])
  You have: '(([MX]))'

In [2]: print ca.__version__
3.1.0
jgillis commented 7 years ago

Hi there, (I'm a CasADi developer) Looks like the example code is using CasADi 2.4 syntax.. As of v3.0, vertcat takes a variable number of arguments as opposed to a list

adbuerger commented 7 years ago

Hi, and thank you for your interest in casiopeia!

As stated in the installation instructions (http://casiopeia.readthedocs.io/en/latest/install.html), currently a version of CasADi >= 2.4.2 but < 3.x has to be used with casiopeia, e. g. CasADi 2.4.3.

Support for CasADi 3.x is currently worked on, and will be available in the near future. Until then, consider downloading and using e. g. CasADi 2.4.3 from https://sourceforge.net/projects/casadi/files/CasADi/

ankur-gupta commented 7 years ago

Oh, yes. Sorry, I did not read the docs fully. I will try casiopeia with CasADi 2.4.3.

ankur-gupta commented 7 years ago

I was able to run the example successfully with CasADi 2.4.3. Thank you.

adbuerger commented 7 years ago

Good to hear! If you encounter further problems, please feel free to contact me!