非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的
来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/29 16:00:17
非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的
function f=myfun(x)
f=0.192457*le-4*(x(2)+2)*x(1)^2*x(3);
function [c,cep]=mycon(x)
c(1)=350-163*x(1)^(-2.86)*x(3)^0.86;
c(2)=10-0.14*0.01*x(1)^-4*x(2)*x(3)^3;
c(3)=(x(2)+1.5)*x(1)+0.44*0.01*x(1)^(-4)*x(2)*x(3)^3-3.7*x(3);
c(4)=375-0.356*le6*x(1)*x(2)^(-1)*x(3)^(-2);
c(5)=4-x(3)/x(1);
A=[-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1];
b=[-1;4;-4.5;50;-10;30];
x0=[2.0;5.0;25.0];
lb=zeros(3,1);
[x,fval,exitflag,output,lambda]=fmincon(@opt17_70,xo,A,b,[],[],lb,[],@opt17_7c)
在matlab中调试了好久还不行 求大神
function f=myfun(x)
f=0.192457*le-4*(x(2)+2)*x(1)^2*x(3);
function [c,cep]=mycon(x)
c(1)=350-163*x(1)^(-2.86)*x(3)^0.86;
c(2)=10-0.14*0.01*x(1)^-4*x(2)*x(3)^3;
c(3)=(x(2)+1.5)*x(1)+0.44*0.01*x(1)^(-4)*x(2)*x(3)^3-3.7*x(3);
c(4)=375-0.356*le6*x(1)*x(2)^(-1)*x(3)^(-2);
c(5)=4-x(3)/x(1);
A=[-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1];
b=[-1;4;-4.5;50;-10;30];
x0=[2.0;5.0;25.0];
lb=zeros(3,1);
[x,fval,exitflag,output,lambda]=fmincon(@opt17_70,xo,A,b,[],[],lb,[],@opt17_7c)
在matlab中调试了好久还不行 求大神
function f=myfun(x)
f=0.192457*10^(-4)*(x(2)+2)*x(1)^2*x(3);
function [c,cep]=mycon(x)
c(1)=350-163*x(1)^(-2.86)*x(3)^0.86;
c(2)=10-0.14*0.01*x(1)^-4*x(2)*x(3)^3;
c(3)=(x(2)+1.5)*x(1)+0.44*0.01*x(1)^(-4)*x(2)*x(3)^3-3.7*x(3);
c(4)=375-0.356*10^6*x(1)*x(2)^(-1)*x(3)^(-2);
c(5)=4-x(3)/x(1);
cep=[];
-----------------------------------
A=[-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1];
b=[-1;4;-4.5;50;-10;30];
x0=[2.0;5.0;25.0];
lb=zeros(3,1);
[x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,A,b,[],[],lb,[],@mycon)
Warning:Trust-region-reflective method does not currently solve this type
of problem,
using active-set (line search) instead.
> In fmincon at 439
Local minimum possible.Constraints satisfied.
fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints were
satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1
3
x =
1.0000
4.5000
11.7155
fval =
0.0015
exitflag =
4
output =
iterations:5
funcCount:20
lssteplength:1
stepsize:6.1230e-007
algorithm:'medium-scale:SQP,Quasi-Newton,line-search'
firstorderopt:1.2510e-004
constrviolation:0
message:[1x817 char]
lambda =
lower:[3x1 double]
upper:[3x1 double]
eqlin:[0x1 double]
eqnonlin:[0x1 double]
ineqlin:[6x1 double]
ineqnonlin:[5x1 double]
f=0.192457*10^(-4)*(x(2)+2)*x(1)^2*x(3);
function [c,cep]=mycon(x)
c(1)=350-163*x(1)^(-2.86)*x(3)^0.86;
c(2)=10-0.14*0.01*x(1)^-4*x(2)*x(3)^3;
c(3)=(x(2)+1.5)*x(1)+0.44*0.01*x(1)^(-4)*x(2)*x(3)^3-3.7*x(3);
c(4)=375-0.356*10^6*x(1)*x(2)^(-1)*x(3)^(-2);
c(5)=4-x(3)/x(1);
cep=[];
-----------------------------------
A=[-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1];
b=[-1;4;-4.5;50;-10;30];
x0=[2.0;5.0;25.0];
lb=zeros(3,1);
[x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,A,b,[],[],lb,[],@mycon)
Warning:Trust-region-reflective method does not currently solve this type
of problem,
using active-set (line search) instead.
> In fmincon at 439
Local minimum possible.Constraints satisfied.
fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints were
satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1
3
x =
1.0000
4.5000
11.7155
fval =
0.0015
exitflag =
4
output =
iterations:5
funcCount:20
lssteplength:1
stepsize:6.1230e-007
algorithm:'medium-scale:SQP,Quasi-Newton,line-search'
firstorderopt:1.2510e-004
constrviolation:0
message:[1x817 char]
lambda =
lower:[3x1 double]
upper:[3x1 double]
eqlin:[0x1 double]
eqnonlin:[0x1 double]
ineqlin:[6x1 double]
ineqnonlin:[5x1 double]
非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的
非线性约束优化 目标函数和约束函数 在matlab中出错
LINGO算非线性整数规划时,目标函数求最小值,少个约束条件怎么比有约束求的目标值还大,让我情何以堪
如何用Matlab求有限制条件的目标函数的最小值求解一个优化问题(目标函数非线性,约束函数线性)?
用matlab求解一个优化问题(目标函数非线性,约束函数线性)
matlab一道有约束的非线性规划问题
求解约束非线性规划中使用MATLAB时为什么要设定初始值X0?
matlab解决约束非线性规划问题
MATLAB基础问题麻烦高手帮个忙,请问解有约束非线性规划问题,用MATLAB中的哪个函数?再麻烦各位把函数的调用格式也
matlab 带约束的 求目标函数的最大值怎么做?
matlab高手有好几个约束,求目标函数的最小值.
matlab大神,我求解非线性规划出现了问题.怎么画出f函数呢