matlab解一道题求最小值C=737x1+62.5x2+550x3+14y1+5y2+18y3求上述C的最小值?约束:0
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 20:47:28
matlab解一道题求最小值C=737x1+62.5x2+550x3+14y1+5y2+18y3求上述C的最小值?约束:0
matlab解一道题求最小值
C=737x1+62.5x2+550x3+14y1+5y2+18y3
求上述C的最小值?
约束:
0
matlab解一道题求最小值C=737x1+62.5x2+550x3+14y1+5y2+18y3求上述C的最小值?约束:0
程序:
x0 = [1000,2000,5000,1000,400,650,920,842];
A = [467,20,47,90,0,0,0,0;...
-1,0,0,0,0,0,0,-1;...
0,-1,0,0,0,-1,0,0;...
0,0,-1,0,0,0,-1,0;...
0,0,0,-1,0,0,0,-1;...
-1,0,0,0,0,1,0,0;...
0,-1,0,0,0,1,0,0;...
0,0,-1,0,0,0,1,0;...
0,0,0,-1,0,0,0,1];
b = [1289500;-1276;-3076;-6093;-1427;0;0;0;0];
lb = [0,0,0,0,400,650,920,842];
ub = [1500,4000,7000,2000,inf,inf,inf,inf];
[x,C] = fmincon(@(x) 473*x(1)+27.5*x(2)+50*x(3)+94*x(4)+12*x(5)+5*x(6)+6*x(7)+8*x(8)-31333,x0,A,b,[],[],lb,ub);
x,C
结果:
Optimization terminated:first-order optimality measure less
than options.TolFun and maximum constraint violation is less
than options.TolCon.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
5 3
6 4
8 6
8
9
x =
1.0e+003 *
0.6500 2.4260 3.0465 0.8420 0.4000 0.6500 3.0465 0.8420
C =
607370
是啊,没分怎么回答~
使用函数fmincon()求解
改天再告诉你方法
没分呐…