Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Jonas
Posts:
2
Registered:
1/9/12
|
|
Problems on Fmincon
Posted:
May 19, 2012 9:06 AM
|
|
Dear friends, I have problems on my fmincon command which shows this statement "FMINCON cannot continue because user supplied objective function failed with the following error: Index exceeds matrix dimensions."
My Program are these:
for j=c y(k,:) = C*x0 + D*u; du = fmincon(@kriteria2, du, F, G, Feq, Geq, [], [],'', options); u = du(1:in)+ du(2*Hu*in+1:2*Hu*in+in); for i=1:in if u(i) < umin, u(i) = umin; end if u(i) > umax, u(i) = umax; end end [t,x] = ode45(@mimo,[t0 t0+ts],x0); [row,col] = size(x); x0 = x(row,:)'; data_u(:,k)=u; k=k+1; du(2*Hu*in+1:2*Hu*in+in)=u; %du(9:10) -> u = u(k-1) t0 = t0+ts; end
with these additions: from @kriteria2 is: v = kriteria2 (xaug) size of all those variables are: v = 1x1 du = 10x1 F = 16x10 G = 16x1 Feq = 4x10 Geq = 4x1 c=0:5:200;
This program runs okay for MPC/Model Prediction Control. But, when I add "offline recursive" on this MPC program, it shows that problem..
Anyway could help?
Thank you
Jonas
|
|
|
|