Nonlinear conjugate gradient(非线性共轭梯度)

非线性共轭梯度法-DY法 算法可用于求解形如$min(f(x))$的非线性最优化问题,解的迭代形式为$x_{k+1}=x_k+a_kd_k$。其中$a_k$为迭代步长,$d_k$为迭代方向。(不同的$d_k$计算方法即为不同的非线性共轭梯度算法,它们对于$a_k$计算的要求也各有区别。) 要求目标函数$f(x)$连续可微且梯度$g(x)$已知。 DY法具有全局收敛性,但有一定几率陷入局部极小值。 DY法具有二次终止性,迭代终止于零梯度值位置或者$f(x) \leq threshold$处。 算法描述 step 1 -> 给出解的初值$f(x_0)$并计算其梯度$g(x_0)$,如果$\left\lVert g(x_0) \right\rVert = 0$则算法终止,说明$x_0$是$f(x)$的全局或局部极小解。否则设置$d_0 = -g_0$作为初始迭代方向(即解的最速下降方向)。 step 2 -> 执行满足如下所示的标准Wolfe条件的非精确线性搜索,计算得到$a_k$。 $f(x_k+a_k d_k)-f(x_k) \leq c_1 a_k {g_k}^T d_k$, ${g(x_k+a_k d_k)}^T d_K > c_2 {g_k}^T d_k$ 其中$0< c_1 < c_2 < 1$,一般取$c_1=0.1$,$c_2 \in (0.6,0.8)$。对于重磁非线形反演一般取$c_1=1e-4$,$c_2=0.9$。 step 3 -> 更新$x_{k+1}=x_k+a_kd_k $,若$\left\lVert g(x_{k+1}) \right\rVert = 0 $则算法终止,说明$x_{k+1}$是$f(x)$的全局或局部极小解。否则继续step 4。 step 4 -> 更新$d_{k+1}=-g_{k+1}+\beta_k d_k$,其中$\beta_k = \left\lVert g_{k+1} \right\rVert / {d_k}^T (g_{k+1}-g_k)$。$k:=k+1$返回step 2。 C++代码 func.h ...

April 10, 2019 · 3 分钟 · 509 字 · 张壹

Meshing the sphere——球面三角剖分(STT)网格生成器

View in toolbox 下载 stt 源码包 Program Propose The spherical triangular tessellation is a kind of partition of the spherical surface composed by only triangular cells. This program could generate the STT based on an icosahedron. The STT generated by the program could be refined around given points, lines, polygons and circles on the spherical surface. The exterior and interior outlines of the STT could also be customized. Installation You need to compile the executable file stt using the makefile. Please change the variable CC in the makefile to the compiler you use. ...

December 29, 2018 · 4 分钟 · 661 字 · 张壹