opti.to_function output

568 views
Skip to first unread message

Antonio Ferramosca

unread,
Oct 9, 2019, 6:57:23 PM10/9/19
to CasADi
Dear all

I've a quastion about the new option .to_function of the Opti stack in Matlab.

If I define my controller function such as:

MPC=opti.to_function('MPC',{xk,xs},{uf,xf},{'xk','xs'},{'uf_opt','xf_opt'});


where

xf = opti.variable(nx,N+1);

uf = opti.variable(nu,N);


when I call the function using full(MPC(xk,xs)), it just only return the first defined output (uf). 


Any idea on what should I do to access also the other output xf?


Thanks

Antonio

Joris Gillis

unread,
Oct 10, 2019, 2:18:20 AM10/10/19
to CasADi
Multi-output CasADi Functions behave like variable output Matlab functions:

ufsol, xfsol = MPC(..)
full(ufsol)

Best,
Joris

Reply all
Reply to author
Forward
0 new messages