求助啊 一道matlab优化问题 请发送到cheney362@163.com 多谢啊
Minz=520+1.6(x1-2.5)^1.9+2.5(X2-3.5)^2+0.7(x3-12)^2.1s.t.x1+x2+x3=25;y1+y2+y3<=1200;0...
Min z=520+1.6(x1-2.5)^1.9+2.5(X2-3.5)^2+0.7(x3-12)^2.1
s.t.
x1+x2+x3=25;y1+y2+y3<=1200;
0<=x1<=13;0<=x2<=9;0<=x3<=14;
y1=25+1300*x1-464*x1^2;
y2=915+500*x1-475*x2^2;
y3=2600-363*x1-64*x3^2; 展开
s.t.
x1+x2+x3=25;y1+y2+y3<=1200;
0<=x1<=13;0<=x2<=9;0<=x3<=14;
y1=25+1300*x1-464*x1^2;
y2=915+500*x1-475*x2^2;
y3=2600-363*x1-64*x3^2; 展开
1个回答
展开全部
function f=fun(x)
f=520+1.6*(x(1)-2.5)^1.9+2.5*(x(2)-3.5)^2+0.7*(x(3)-12)^2.1;%%目标函数
function [c,ceq] = mycon2(x)
c =[25+1300*x(1)-464*x(1)^2+915+500*x(1)-475*x(2)^2+2600-363*x(1)-64*x(3)^2-1200];
ceq =[]; %%非线性约束条件
Aeq=[1 1 1];beq=[25];
lb=zeros(3,1);
ub=[13;9;14];
x0=[10;10;10];
options=optimset('LargeScale','off','MaxFunEvals',10000,'MaxIter',10000);
[x,fval] = fmincon(@fun,x0,[],[],Aeq,beq,lb,ub,'mycon2',options)
Maximum number of function evaluations exceeded;
increase OPTIONS.MaxFunEvals.
x =
5.8492 - 6.7371i
7.1041 - 3.7960i
12.0466 +10.5320i
fval =
3.8139e+002 -1.4647e+002i
f=520+1.6*(x(1)-2.5)^1.9+2.5*(x(2)-3.5)^2+0.7*(x(3)-12)^2.1;%%目标函数
function [c,ceq] = mycon2(x)
c =[25+1300*x(1)-464*x(1)^2+915+500*x(1)-475*x(2)^2+2600-363*x(1)-64*x(3)^2-1200];
ceq =[]; %%非线性约束条件
Aeq=[1 1 1];beq=[25];
lb=zeros(3,1);
ub=[13;9;14];
x0=[10;10;10];
options=optimset('LargeScale','off','MaxFunEvals',10000,'MaxIter',10000);
[x,fval] = fmincon(@fun,x0,[],[],Aeq,beq,lb,ub,'mycon2',options)
Maximum number of function evaluations exceeded;
increase OPTIONS.MaxFunEvals.
x =
5.8492 - 6.7371i
7.1041 - 3.7960i
12.0466 +10.5320i
fval =
3.8139e+002 -1.4647e+002i
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询