opts = {'tf':T/N}NotImplementedError: Wrong number or type of arguments for overloaded function 'integrator'.
Possible prototypes are:
integrator(str,str,dict:SX,dict)
integrator(str,str,dict:MX,dict)
You have: '(str,str,str:MX,str:MX)'dt = T/N # length of a control interval
for k in range(N): # loop over control intervals
# Runge-Kutta 4 integration
k1 = xdot(X[:,k], U[:,k])
k2 = xdot(X[:,k]+dt/2*k1, U[:,k])
k3 = xdot(X[:,k]+dt/2*k2, U[:,k])
k4 = xdot(X[:,k]+dt*k3, U[:,k])
x_next = X[:,k] + dt/6*(k1+2*k2+2*k3+k4)
opti.subject_to(X[:,k+1]==x_next) # close the gaps# CVODES from the SUNDIALS suite
dae = {'x':x, 'p':u, 'ode':xdot, 'quad':L}
opts = {'tf':T/N}
F = integrator('F', 'cvodes', dae, opts)# Integrate till the end of the interval Fk = F(x0=Xk, p=Uk) Xk_end = Fk['xf']