06.08.2013 Views

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.7 函数极值点<br />

4.7.1 一元函数的极小值点<br />

4.7.2 多元函数的极小值点<br />

2 2<br />

2<br />

【例 4.7.2-1】求 f ( x,<br />

y)<br />

= 100(<br />

y − x ) + ( 1−<br />

x)<br />

的极小值点。它即是著名的 Rosenbrock's<br />

"Banana" 测试函数。该测试函数有一片浅谷,许多算法难以越过此谷。(演示本例搜索过程<br />

的文件名为 exm04072_1_1.m 。)<br />

(1)<br />

ff=inline('100*(x(2)-x(1)^2)^2+(1-x(1))^2','x');<br />

(2)<br />

x0=[-1.2,1];[sx,sfval,sexit,soutput]=fminsearch(ff,x0)<br />

sx =<br />

1.0000 1.0000<br />

sfval =<br />

8.1777e-010<br />

sexit =<br />

1<br />

soutput =<br />

iterations: 85<br />

funcCount: 159<br />

algorithm: 'Nelder-Mead simplex direct search'<br />

(3)<br />

[ux,sfval,uexit,uoutput,grid,hess]=fminunc(ff,x0)<br />

Warning: Gradient must be provided for trust-region method;<br />

using line-search method instead.<br />

> In D:\MATLAB6P1\toolbox\optim\fminunc.m at line 211<br />

Optimization terminated successfully:<br />

Current search direction is a descent direction, and magnitude of<br />

directional derivative in search direction less than 2*options.TolFun<br />

ux =<br />

1.0000 1.0000<br />

sfval =<br />

1.9116e-011<br />

uexit =<br />

1<br />

uoutput =<br />

iterations: 26<br />

funcCount: 162<br />

stepsize: 1.2992<br />

firstorderopt: 5.0020e-004<br />

algorithm: 'medium-scale: Quasi-Newton line search'<br />

grid =<br />

1.0e-003 *<br />

-0.5002<br />

-0.1888<br />

hess =<br />

820.4028 -409.5496<br />

-409.5496 204.7720<br />

4.8 数值积分<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!