I’ve already computed an optimization with NLopt using a CasADI cost function and gradient.
Now I want to compare the optimization performance of NLopt with other optimization libraries, starting with CasADI.
I already have the CasADI function for cost and gradient:
casadi::Function final_result_fun("final_result_fun",{u_sym,init_x_sym,obj_list_1_sym,obj_list_2_sym,dt_sym,cost_sym},{current_cost_sym, grad_cost_sym});
How can I re-use this function to perform the optimization with CasADI?
I don’t quite understand how nlpsol works, and the official example is no help. I have found an optimization example using casadi::Callback, but eval needs std::vector< casadi::DM>, not casadi::Function.
Any help will be welcome.