三维图解不会,解析计算是这样的:
A=[1 1 1;3 1 1.5;0.8 0.2 0.3];
b=[625;1000;300];
x0=[200 250 250];
lb=[0 0 0];
ub=[];
myfun=@(x) -(400*x(1)+200*x(2)+250*x(3));
[x,fval,exitflag,output]=fmincon(myfun,x0,A,b,[],[],lb,ub)
Smax=-fval
结果:
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1
2
x =
127.8846 258.6538 238.4615
fval =
-162500
exitflag =
1
output =
iterations: 2
funcCount: 12
lssteplength: 1
stepsize: 4.9964e-007
algorithm: 'medium-scale: SQP, Quasi-Newton, line-search'
firstorderopt: 1.9668e-007
message: [1x144 char]
Smax =
162500
答案不唯一,多解,但目标函数唯一。
温馨提示:答案为网友推荐,仅供参考