声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1673|回复: 2

[工具箱] 关于约束非线性优化函数"fmincon"

[复制链接]
发表于 2008-6-11 16:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
[x,f,exitflag,output,lambda,grad,hessian]=fmincon('fun',x0,[],[],[],[],lb,ub,'confun',options)

运行程序后,各步迭代结果和输出信息如下,请各位高手诊断一下,为什么输出结果的firstorderopt 和 hessian矩阵的值看上去很奇怪?

Warning: Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).

Optimization terminated: magnitude of search direction less than 2*options.TolX and maximum constraint violation is less than options.TolCon.
No active inequalities

x =

Columns 1 through 9

0.9959 0.9838 0.9631 0.9331 0.8926 0.8390 0.7666 0.6672 0.5234

Column 10

0.6607

f =

0.3315

exitflag =

4

output =

iterations: 32
funcCount: 628
stepsize: 0.5000
algorithm: 'medium-scale: SQP, Quasi-Newton, line-search'
firstorderopt: 707.1440
cgiterations: []
message: [1x142 char]

lambda =

lower: [10x1 double]
upper: [10x1 double]
eqlin: [0x1 double]
eqnonlin: [0x1 double]
ineqlin: [0x1 double]
ineqnonlin: [10x1 double]

grad =

-0.0654
705.2744
-0.0434
-0.0890
0.0762
-0.5614
707.1440
11.7971
11.5717
-0.8764

hessian =

1.0e+013 *

Columns 1 through 9

0.2866 0.1472 -0.0305 0.0639 0.1033 0.7275 0.6362 -0.0483 -0.2287
0.1472 0.1936 -0.0007 0.1433 -0.0459 -0.0338 0.1564 0.1402 0.1371
-0.0305 -0.0007 0.0084 0.0121 -0.0411 -0.1747 -0.1436 0.0499 0.0802
0.0639 0.1433 0.0121 0.1249 -0.0958 -0.2876 -0.0987 0.1792 0.2227
0.1033 -0.0459 -0.0411 -0.0958 0.2149 0.8495 0.6647 -0.2839 -0.4223
0.7275 -0.0338 -0.1747 -0.2876 0.8495 3.9221 2.9639 -1.0251 -1.8359
0.6362 0.1564 -0.1436 -0.0987 0.6647 2.9639 2.5616 -0.7417 -1.2689
-0.0483 0.1402 0.0499 0.1792 -0.2839 -1.0251 -0.7417 0.4328 0.5823
-0.2287 0.1371 0.0802 0.2227 -0.4223 -1.8359 -1.2689 0.5823 0.9890
-0.3590 0.3887 0.1251 0.4779 -0.6865 -3.1089 -1.8629 0.9809 1.6688

Column 10

-0.3590
0.3887
0.1251
0.4779
-0.6865
-3.1089
-1.8629
0.9809
1.6688
3.3615

请教各位高手: 这个程序结果不对吧?

1. firstorderopt=707.1440 很奇怪,一般这一项都是等于0的吧?

2. Hessian矩阵值好象也不对,太大了.

但exitflag = 4又提示成功收敛. 所以我不太清楚问题出在哪里,想请知道的高人出来指点一下,能否看出这个优化过程可能在哪里有问题?

[ 本帖最后由 woshiwobu 于 2008-6-11 16:26 编辑 ]
回复
分享到:

使用道具 举报

发表于 2008-6-11 19:42 | 显示全部楼层

回复 楼主 的帖子

提示的意思应该是叫你换为线搜索的方法做这个问题
 楼主| 发表于 2008-6-12 17:06 | 显示全部楼层
谢谢LS的. 这个提示matlab已经自动处理了,就是按照线性搜索来做的. 只是最后的Hessian矩阵值好象不对,不是单位阵.
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-27 17:16 , Processed in 0.052738 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表