无约束优化算法:单纯形法_无约束优化方法

2020-02-27 其他范文 下载本文

无约束优化算法:单纯形法由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“无约束优化方法”。

单纯形法

1.算法原理

单纯形法的基本思想是:

设x,x,...,x(0)(1)(n)是Rn中的n1个点,构成一个当前的单纯形,xmax,xmin定义如下:

f(xmax)maxf(x(0)),f(x(1)),...,f(x(n)) f(xmin)minf(x(0)),f(x(1)),...,f(x(n))

记x为这个单纯形除去xmax外的所有顶点的形心,1n(i)xxxmax

ni0取xmax关于x的反射点x(n1),x(n1)x(xxmax)构成新的单纯形,反复上述过程,直到达到停止条件。

2.函数fminsearch

1)函数语法

xfminsearch(fun,x0)

xfminsearch(fun,x0,options)[x,fval]fminsearch(...)[x,fval,exitflag]fminsearch(...)[x,fval,exitflag,output]fminsearch(...)函数输入:

fun:目标函数

x0:迭代初始点

options:函数参数设置

函数输出: x:最优点

fval:最优点对应的函数值 exitflag:函数停止信息

1:函数收敛正常停止

0:迭代次数,目标函数计算次数达到最大数-1:算法被输出函数停止 output:函数运算信息 2)函数使用

(1)目标函数程序BanaFun.m

functionfBanaFun(x)(不含导数解析式)

f100*(x(2)x(1)^2)^2(1x(1))^2

NelderMeadSimplex函数不需要导数信息。

(2)算法参数设置:SimplexUnc.m

optionsoptimset('LargeScale','off','gradobj','off','MaxFunEvals',250,'display','iter')

(3)函数调用运算:SimplexUnc.m

optionsoptimset('LargeScale','off','gradobj','on','MaxFunEvals',250,'display','iter')x[1.9,2]

[x,fval,exitflag,output]fminsearch(@BanaFun,x,options)

3)计算结果

Iteration

Func-count

min f(x)

Procedure

0

267.62

236.42

initial simplex

67.2672

expand

12.2776

expand

12.2776

reflect

12.2776

contract inside

6.76772

contract inside

6.76772

reflect

6.76772

contract inside

6.76772

contract outside

6.62983

contract inside

6.55249

contract inside

6.46084

contract inside

6.46084

reflect

6.46084

contract inside

6.45544

contract outside

6.42801

expand

6.40994

expand

6.32449

expand

6.28548

expand

6.00458

expand

6.00458

reflect

5.43287

expand

5.43287

reflect

4.63434

expand

4.63434

reflect

4.63434

contract inside

4.63434

contract outside

4.31027

expand

4.31027

contract inside

4.00991

expand

4.00991

reflect

112

114

115

117

119

120

3.55664

3.55664

3.23438

3.23438

2.9515

2.82878

2.56426

2.54453

2.43615

2.34358

2.28129

2.21473

2.08627

2.08627

1.86677

1.86677

1.80424

1.58432

1.58432

1.27128

1.27128

1.05673

1.05673

0.816708

0.816708

0.816708

0.760575

0.601009

0.601009

0.516477

0.516477

0.516477

0.416316

0.416316

0.416316

expand reflect reflect

contract inside expand reflect reflect

contract outside reflect reflect reflect reflect reflect reflect reflect

contract inside reflect expand reflect expand reflect reflect

contract inside expand

contract inside contract inside reflect expand

contract inside reflect

contract inside reflect expand

contract inside reflect

122

0.345716

reflect

124

0.345716

contract inside

126

0.285909

expand

128

0.281068

reflect

130

0.22878

reflect

132

0.22878

contract inside

134

0.203104

expand

136

0.148

expand

138

0.0999997

expand

140

141

143

145

147

148

150

152

154

156

158

160

161

163

165

166

168

170

172

174

176

178

180

182

184

185

187

189

191

193

195

197

199

201

203

0.0999997

0.0999997

0.0217142

0.0217142

0.0217142

0.0217142

0.0217142

0.0217142

0.0191193

0.00610404

0.00610404

0.00261955

0.00261955

0.000256151

0.000256151

0.000256151

0.000256151

0.00020711

0.00010357

2.09236e-005

2.09236e-005

1.80497e-006

1.80497e-006

1.80497e-006

1.80497e-006

1.80497e-006

3.74217e-007

3.74217e-007

3.26526e-007

8.07652e-008

1.66554e-008

1.66554e-008

1.66554e-008

5.57089e-009

1.86825e-009

contract inside reflect expand

contract inside contract inside reflect

contract inside contract inside reflect expand

contract outside reflect reflect reflect

contract inside reflect

contract inside contract inside contract inside contract inside contract inside reflect

contract inside contract inside contract inside reflect

contract inside contract inside contract inside contract inside contract inside contract inside contract inside contract outside contract inside

205

1.86825e-009

contract outside

112

207

5.53435e-010

contract inside

113

208

5.53435e-010

reflect

114

210

4.06855e-010

contract inside

Optimization terminated: the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-004

and F(X)satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-004

x =

1.0000

1.0000

fval =

4.0686e-010

exitflag =

output =

iterations: 114

funcCount: 210

algorithm: 'Nelder-Mead simplex direct search'

meage: [1x196 char]

《无约束优化算法:单纯形法.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
无约束优化算法:单纯形法
点击下载文档
相关专题 无约束优化方法 算法 无约束 无约束优化方法 算法 无约束
[其他范文]相关推荐
    [其他范文]热门文章
      下载全文