格里旺克函数(Griewank function)是数学上常用于测试优化程序效率的函数,定义如下: G ( x 1 , x 2 , ⋯ , x n ) = 1 + 1 4000 ∑ 1 n x i 2 − ∏ i = 1 n c o s ( x i ) ( i ) {\displaystyle G(x_{1},x_{2},\cdots ,x_{n})=1+{\frac {1}{4000}}\sum _{1}^{n}x_{i}^{2}-\prod _{i=1}^{n}cos({\frac {x_{i})}{{\sqrt {(}}i)}}}
g := 1 + ( 1 / 4000 ) ∗ x 2 − c o s ( x ) {\displaystyle g:=1+(1/4000)*x^{2}-cos(x)}
如图所示,一阶格里旺函数有许多极点。取上述函数的一阶导数,令其为0:
1 2000 ∗ x + s i n ( x ) = 0 {\displaystyle {\frac {1}{2000}}*x+sin(x)=0}
用数值解法,求其中在实数域之间的解,共得62个,列出如下:
在区间,极点个数=6365
g 2 := 1 + ( 1 / 4000 ) ∗ x 2 + ( 1 / 4000 ) ∗ x 2 − c o s ( x ) ∗ c o s ( ( 1 / 2 ) ∗ x ∗ ( 2 ) ) {\displaystyle g2:=1+(1/4000)*x^{2}+(1/4000)*x^{2}-cos(x)*cos((1/2)*x*{\sqrt {(}}2))}
1 + ( 1 / 4000 ) ∗ x 2 + ( 1 / 4000 ) ∗ x 2 + ( 1 / 4000 ) ∗ x 2 − c o s ( x ) ∗ c o s ( ( 1 / 2 ) ∗ x ∗ ( 2 ) ) ∗ c o s ( ( 1 / 3 ) ∗ x ∗ s q r t ( 3 ) ) {\displaystyle {1+(1/4000)*x^{2}+(1/4000)*x^{2}+(1/4000)*x^{2}-cos(x)*cos((1/2)*x*{\sqrt {(}}2))*cos((1/3)*x*sqrt(3))}}