用matlab解非线性的最优解。(求高手看看,怎么解)
目标函数:functionz=fun3(x);z=-0.201*x(1)^4*x(2)*x(3)^2/10^7约束条件:function[g,ceq]=ym(x)g=[x...
目标函数:function z=fun3(x);
z=-0.201*x(1)^4*x(2)*x(3)^2/10^7
约束条件:function [g,ceq]=ym(x)
g=[x(1)^2*x(2)-675;x(1)^2*x(2)^2/10^7-0.419];
命令窗口文件:x0=[10;2;54];
VLB=[0 0 0];VUB=[36 5 125];
[x,fval,exitflag,output]=fmincon('fun3',x0,[],[],[],[],VLB,VUB,'ym')
运行结果:
Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In fmincon at 260
z =
-1.1722
??? Error using ==> fmincon
FMINCON cannot continue because user supplied nonlinear constraint function
failed with the following error:
One or more output arguments not assigned during call to 'C:\MATLAB7\work\ym.m (ym)'. 展开
z=-0.201*x(1)^4*x(2)*x(3)^2/10^7
约束条件:function [g,ceq]=ym(x)
g=[x(1)^2*x(2)-675;x(1)^2*x(2)^2/10^7-0.419];
命令窗口文件:x0=[10;2;54];
VLB=[0 0 0];VUB=[36 5 125];
[x,fval,exitflag,output]=fmincon('fun3',x0,[],[],[],[],VLB,VUB,'ym')
运行结果:
Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In fmincon at 260
z =
-1.1722
??? Error using ==> fmincon
FMINCON cannot continue because user supplied nonlinear constraint function
failed with the following error:
One or more output arguments not assigned during call to 'C:\MATLAB7\work\ym.m (ym)'. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询