《2022年无约束优化算法:单纯形法汇编 .pdf》由会员分享,可在线阅读,更多相关《2022年无约束优化算法:单纯形法汇编 .pdf(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单纯形法1. 算法原理单纯形法的基本思想是:设(0)(1)( ),.,nxxx是nR中的1n个点,构成一个当前的单纯形,maxmin,xx定义如下:(0)(1)( )max()max(),(),.,()nf xf xf xf x(0)(1)( )min()min(),(),.,()nf xfxfxf x记x为这个单纯形除去maxx外的所有顶点的形心,( )max01niixxxn取maxx关于x的反射点(1)nx,(1)max()nxxxx构成新的单纯形,反复上述过程,直到达到停止条件。2. 函数minfsearch1) 函数语法min(, 0)xfsearch fun xmin(, 0,)
2、,min(.) ,min(.) ,min(.)xfsearch fun xoptionsx fvalfsearchx fval exitflagfsearchx fval exitflag outputfsearch函数输入:fun:目标函数0 x:迭代初始点options:函数参数设置函数输出:x:最优点fval:最优点对应的函数值exitflag:函数停止信息1:函数收敛正常停止0:迭代次数,目标函数计算次数达到最大数-1:算法被输出函数停止output:函数运算信息名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整
3、理 - - - - - - - 第 1 页,共 5 页 - - - - - - - - - 2) 函数使用(1)目标函数程序.BanaFunm( )()functionfBanaFun x 不含导数解析式100*(2)(1) 2) 2(1(1) 2fxxxNelderMeadSimplex函数不需要导数信息。(2)算法参数设置:.SimplexUnc m(arg,250,)optionsoptimsetLeScaleoffgradobjoffMaxFunEvalsdisplayiter(3)函数调用运算:.SimplexUnc m(arg,250,)optionsoptimsetLeScale
4、offgradobjonMaxFunEvalsdisplayiter 1.9,2x ,min(, ,)x fval exitflag outputfsearchBanaFun x options3) 计算结果Iteration Func-count min f(x) Procedure 0 1 267.62 1 3 236.42 initial simplex 2 5 67.2672 expand 3 7 12.2776 expand 4 8 12.2776 reflect 5 10 12.2776 contract inside 6 12 6.76772 contract inside 7
5、13 6.76772 reflect 8 15 6.76772 contract inside 9 17 6.76772 contract outside 10 19 6.62983 contract inside 11 21 6.55249 contract inside 12 23 6.46084 contract inside 13 24 6.46084 reflect 14 26 6.46084 contract inside 15 28 6.45544 contract outside 16 30 6.42801 expand 17 32 6.40994 expand 18 34 6
6、.32449 expand 19 36 6.28548 expand 20 38 6.00458 expand 21 39 6.00458 reflect 22 41 5.43287 expand 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 5 页 - - - - - - - - - 23 42 5.43287 reflect 24 44 4.63434 expand 25 45 4.63434 reflect 26 47 4.63434 contract insid
7、e 27 49 4.63434 contract outside 28 51 4.31027 expand 29 53 4.31027 contract inside 30 55 4.00991 expand 31 56 4.00991 reflect 32 58 3.55664 expand 33 59 3.55664 reflect 34 61 3.23438 reflect 35 63 3.23438 contract inside 36 65 2.9515 expand 37 67 2.82878 reflect 38 69 2.56426 reflect 39 71 2.54453
8、contract outside 40 73 2.43615 reflect 41 75 2.34358 reflect 42 77 2.28129 reflect 43 79 2.21473 reflect 44 81 2.08627 reflect 45 82 2.08627 reflect 46 84 1.86677 reflect 47 86 1.86677 contract inside 48 88 1.80424 reflect 49 90 1.58432 expand 50 91 1.58432 reflect 51 93 1.27128 expand 52 94 1.27128
9、 reflect 53 96 1.05673 reflect 54 98 1.05673 contract inside 55 100 0.816708 expand 56 102 0.816708 contract inside 57 104 0.816708 contract inside 58 106 0.760575 reflect 59 108 0.601009 expand 60 110 0.601009 contract inside 61 112 0.516477 reflect 62 114 0.516477 contract inside 63 115 0.516477 r
10、eflect 64 117 0.416316 expand 65 119 0.416316 contract inside 66 120 0.416316 reflect 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 5 页 - - - - - - - - - 67 122 0.345716 reflect 68 124 0.345716 contract inside 69 126 0.285909 expand 70 128 0.281068 reflect 71
11、130 0.22878 reflect 72 132 0.22878 contract inside 73 134 0.203104 expand 74 136 0.148 expand 75 138 0.0999997 expand 76 140 0.0999997 contract inside 77 141 0.0999997 reflect 78 143 0.0217142 expand 79 145 0.0217142 contract inside 80 147 0.0217142 contract inside 81 148 0.0217142 reflect 82 150 0.
12、0217142 contract inside 83 152 0.0217142 contract inside 84 154 0.0191193 reflect 85 156 0.00610404 expand 86 158 0.00610404 contract outside 87 160 0.00261955 reflect 88 161 0.00261955 reflect 89 163 0.000256151 reflect 90 165 0.000256151 contract inside 91 166 0.000256151 reflect 92 168 0.00025615
13、1 contract inside 93 170 0.00020711 contract inside 94 172 0.00010357 contract inside 95 174 2.09236e-005 contract inside 96 176 2.09236e-005 contract inside 97 178 1.80497e-006 reflect 98 180 1.80497e-006 contract inside 99 182 1.80497e-006 contract inside 100 184 1.80497e-006 contract inside 101 1
14、85 1.80497e-006 reflect 102 187 3.74217e-007 contract inside 103 189 3.74217e-007 contract inside 104 191 3.26526e-007 contract inside 105 193 8.07652e-008 contract inside 106 195 1.66554e-008 contract inside 107 197 1.66554e-008 contract inside 108 199 1.66554e-008 contract inside 109 201 5.57089e-
15、009 contract outside 110 203 1.86825e-009 contract inside 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 5 页 - - - - - - - - - 111 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
16、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 = 1 output = iterations: 114 funcCount: 210 algorithm: Nelder-Mead simplex direct search message: 1x196 char 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 5 页 - - - - - - - - -