Thank you for the reply Joris. I have generated the needed interpolated expressions and as a result the dae from my problem. I have also passed any other constants using a cell structure PAR to the problem- it seems to accept it when constructing the functions and calling the opti function. However, when using solve, I run into the following error :
CasADi - WARNING("solver:nlp_jac_fg failed: NaN detected for output g, at (row 1, col 1).") [.../casadi/core/oracle_function.cpp:265]
MESSAGE(sqpmethod): No regularity of sensitivities at current point.
solver : t_proc (avg) t_wall (avg) n_eval
nlp_jac_fg | 2.03 s ( 2.03 s) 2.03 s ( 2.03 s) 1
total | 2.03 s ( 2.03 s) 2.03 s ( 2.03 s) 1
Error using casadi.Opti/solve (line 253)
Error in Opti::solve [OptiNode] at .../casadi/core/optistack.cpp:159:
.../casadi/core/function_internal.hpp:1229: Evaluation failed
Error in fun_cas_mpc (line 224)
sol=opti.solve();
Error in scrip_mpc_test (line 2)
[intg,dae]=fun_cas_mpc(PAR);
fun_cas_mpc is the function file that builds the casadi MPC controller, script_mpc_test is the script file, and PAR_val.mat contains all the constants.