Possibility of using external jacobian/hessian function for model and constraint?


I am trying to use acados to solve ocp, while I need some external functions from other libraries to calculate jacobian/hessian (i.e. derivatives) for constraints and model. The external function may not be casadi function. I need this because some algorithms cannot be easily differentiated but I can get their analytical derivatives(numerical). Is this possible?


Looking at C interface: is only disc_dyn_fun_jac needed for discrete model?
I think you are already on the right path!
Note that this is not equally easy for all kinds of external funcitons through the interfaces. (There are the examples in acados/examples/acados_matlab_octave/generic_*
On the C level it is possible for all kinds of functions though.

Thanks for the reply.
I plan to modify the python interface and makefile template to link to my custom functions wirtten in cpp. I want to export my custom function which interacts with acados with the generic function argument list. Could you give me some more hints on possible problems during my modification?