I need to optimize (two optimization variables) as follow
f(x) min (X+Y) s.t (n,m)
y1 = sum(a1+n+c1-d1+(n1/S)); y2 = sum(a1+n+c1-d2+(n2/S)); y3 = sum(a1+n+c1-d3+(n3/S)); y4 = sum(a1+n+c1-d4+(n4/S)); y5 = sum(a1+n+c1-d5+(n5/S));
X = 0.125 * (y1 + y2+ y3+ y4+ y5);
y6 = sum(a2+m+c2-d6+(n6/S));
y7 = sum(a2+m+c2-d7+(n7/S)); y8 = sum(a2+m+c2-d8+(n8/S)); y9 = sum(a2+m+c2-d9+(n9/S));
Y= 0.25 * (y6 + y7+ y8+ y9);
fun = @(n,m)extension(n,m,a1,a2,c1,c2,d1,d2,d3,d4,d5,d6,d7,d8,d9,n1,n2,n3,n4,n5,n6,n7,n8,n9,S); A = ; B = ; %linear inequality constrains Aeq = ; beq = ; %linear equality constraints lb = [0 0]; ub = [10 10];
Yes. I agree with Torsten. And just think! You saved the time of trying to figure that out with an optimizer.
Were you to try to use one, you need to create a VECTOR of length 2, containing the values of n and m. The optimizer will vary those values. But don't bother, since it is [0,0].