会matlab的来帮个忙!minz=1600x1+1600x2+1600x3+1600x4+300x1*x1+300x2*x2+300x3*x3+300x4 *x4-300x1*x2-300x2*x3-300x3*x4-300x4*x1-1433600 st x1>=220 x2>=256 x3>=240 x4>=180 x1.x2.x3.x4都为整数这是最优解minz 183500 x1 248 x2 256 x3 248 x4 24
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 01:12:01
会matlab的来帮个忙!minz=1600x1+1600x2+1600x3+1600x4+300x1*x1+300x2*x2+300x3*x3+300x4 *x4-300x1*x2-300x2*x3-300x3*x4-300x4*x1-1433600 st x1>=220 x2>=256 x3>=240 x4>=180 x1.x2.x3.x4都为整数这是最优解minz 183500 x1 248 x2 256 x3 248 x4 24
会matlab的来帮个忙!
minz=1600x1+1600x2+1600x3+1600x4+300x1*x1+300x2*x2+300x3*x3+300x4 *x4-300x1*x2-300x2*x3-300x3*x4-300x4*x1-1433600
st x1>=220
x2>=256
x3>=240
x4>=180
x1.x2.x3.x4都为整数
这是最优解
minz 183500
x1 248
x2 256
x3 248
x4 245,我不知道是怎么算出来的
会matlab的来帮个忙!minz=1600x1+1600x2+1600x3+1600x4+300x1*x1+300x2*x2+300x3*x3+300x4 *x4-300x1*x2-300x2*x3-300x3*x4-300x4*x1-1433600 st x1>=220 x2>=256 x3>=240 x4>=180 x1.x2.x3.x4都为整数这是最优解minz 183500 x1 248 x2 256 x3 248 x4 24
matlab的整数规划不太好,是这样的.
function hh
LB=[220,256,240,180]
[X,FVAL,EXITFLAG]=fmincon(@f,[100 100 100 100],[],[],[],[],LB,[])
function yhat=f(x)
yhat=1600*(x(1)+x(2)+x(3)+x(4))+300*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3)+x(4)*x(4))-300*(x(1)*x(2)+x(2)*x(3)+x(3)*x(4)+x(4)*x(1))-1433600;
结果:
X =
248.0000 256.0000 248.0000 245.3333
FVAL =
1.8347e+005
EXITFLAG =
5
用excel作,很简单的.
程序算出来不就好了吗
不然你就用单纯型法手工计算一边就好了