注册 登录
编程论坛 Matlab

非线性约束多元函数最小值问题

hxgcom 发布于 2008-09-24 09:52, 1260 次点击
m文件:
function f=fun3(x)
F = 1300;
E = 2.06e+5;
u=2;
f=x(1)*x(2)^3/x(3)^3;
约束:
function [c,ceq]=confun(x)
F = 1300;
E = 2.06e+5;
u=2;
c=[46-u*x(3)/x(2)*sqrt(12);F-pi^2*E*x(1)*x(2)^3/12/(u*x(3))^2];
ceq=[];
命令:
clear
x0=[150,1.5,240];
A=[];
b=[];
Aeq=[];Beq=[];
lb=[100,1,10];ub=[390,2,500];
options=optimset('largescale','off');
[x,fval]=fmincon('fun3',x0,A,b,Aeq,Beq,lb,ub,'confun',options)
请教各位大侠,我的程序问题出在哪里?如何修改?
结果:
Optimization terminated successfully:
 Search direction less than 2*options.TolX and
  maximum constraint violation is less than options.TolCon
Active Constraints:
     5


x =

  237.3371    2.0000  130.8289


fval =

  8.4790e-004
[qq]16492507[/qq]

[[it] 本帖最后由 hxgcom 于 2008-9-24 10:36 编辑 [/it]]
0 回复
1