|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
funf='f=0.0061*[(x(1)^2-x(5)^2)*x(4)+(x(2)^2-x(5)^2)*x(3)];';
fung='g=[x(1)-60;40-x(1);x(2)-51;28-x(2);x(3)-214.4;107.2-x(3);x(4)-140;90-x(4);0.9*x(2)-x(5)-2.5;2-0.9*x(2)+x(5);x(5)/x(2)-0.7;x(5)/x(1)-6.5];';
fun=[funf fung];
x0=[-1 1];
options=[];
[x, options]=constr(fun, x0, options);
Warning: The function CONSTR is obsolete and has been replaced by
FMINCON. CONSTR will be removed in a future release of the
Optimization Toolbox. Update your code to call FMINCON to
suppress this warning message. See "Converting your code to
Version 2 Syntax" in the Optimization Toolbox User's Guide
for more information.
> In F:\Matlab\toolbox\optim\constr.m at line 55
??? Error using ==> inlineeval
Error in inline expression ==> 0.0061*[(x(1)^2-x(5)^2)*x(4)+(x(2)^2-x(5)^2)*x(3)]
??? Index exceeds matrix dimensions.
Error in ==> F:\Matlab\toolbox\matlab\funfun\@inline\feval.m
On line 34 ==> INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ==> F:\Matlab\toolbox\optim\private\opteval.m
On line 27 ==> f = feval(FUNfcns{1},x,varargin{:});
Error in ==> F:\Matlab\toolbox\optim\private\nlconstold.m
On line 59 ==> [f,g,msg] = opteval(x,FUNfcn,varargin{:});
Error in ==> F:\Matlab\toolbox\optim\constr.m
On line 86 ==> [x,OPTIONS,lambda,HESS]=nlconstold(funfcn,x,OPTIONS,VLB,VUB,gradfcn,varargin{:});
惩罚函数法计算最优解,怎么调,高手指教!
[ 本帖最后由 xinyuxf 于 2007-7-22 12:15 编辑 ] |
|