1、优化设计 实验报告一维搜索方法程序(1) x,xfval=fminbnd(x2-10*x+36,3,7)x = 5xfval = 11(2) x,xfval=fminbnd(x4-5*x3+4*x2-6*x+60,2,5)x = 3.2796xfval = 22.6590(3) x,xfval=fminbnd(x+1)*(x-2)2,1,4)x = 2.0000xfval = 4.1884e-011无约束优化方法程序(1) x,fval=fminsearch(x)4*(x(1)-5)2+(x(2)-6)2,8;9)x = 5.0000 6.0000fval = 1.5825e-009 (2)x
2、,fval=fminsearch(x)(x(1)2+x(2)-11)2+(x(1)+x(2)2-7)2,1;1)x = 3.0000 2.0000fval = 2.2339e-008 (3)x,fval=fminsearch(x)(1.5-x(1)*(1-x(2)2)2+(2.25-x(1)*(1-x(2)2)2+(2.625-x(1)*(1-x(2)3)2,2;0.2)x = 0.9567 -0.4000fval = 0.2813 (4)x,fval=fminsearch(x)(x(1)2+12*x(2)-1)2+(49*x(1)+49*x(2)+84*x(1)+2324*x(2)-681)
3、2,1;1)x = 0.3363 0.2681fval = 5.4318 (5)x,fval=fminsearch(x)(x(1)+10*x(2)2+5*(x(3)-x(4)2+(x(2)-2*x(3)4+10*(x(1)-x(4)4,3;-1;0;1)x = 0.0094 -0.0009 0.0166 0.0166fval = 1.3906e-006 历史窗口%- 14-3-28 上午10:00 -%clearclcx,xfval=fminbnd(x2-10*x+36,3,7)x,xfval=fminbnd(x4-5*x3+4*x2-6*x+60,2,5)x,xfval=fminbnd(x+
4、1)*(x-2)2,1,4)clearclcx,fval=fminsearch(x)4*(x(1)-5)2+(x(2)-6)2,8;9)x,fval=fminsearch(x)(x(1)2+x(2)-11)2+(x(1)+x(2)2-7)2,1;1)x,fval=fminsearch(x)(1.5-x(1)*(1-x(2)2)2+(2.25-x(1)*(1-x(2)2)2+(2.625-x(1)*(1-x(2)3)2,2;0.2)x,fval=fminsearch(x)(x(1)2+12*x(2)-1)2+(49*x(1)+49*x(2)+84*x(1)+2324*x(2)-681)2,1;1
5、)x,fval=fminsearch(x)(x(1)+10*x(2)2+5*(x(3)-x(4)2+(x(2)-2*x(3)4+10*(x(1)-x(4)4,3;-1;0;1)x,xfval=fminbnd(x2-10*x+36,3,7)x,fval=fminsearch(x)(x(1)2+x(2)-11)2+(x(1)+x(2)2-7)2,1;1)约束优化方法的程序(1) x,fval=fmincon(x)objfun(x),3;3,1 1,2, , (x)confun(x)Warning: Large-scale (trust region) method does not current
6、ly solve this type of problem, switching to medium-scale (line search). In fmincon at 260f = 5c = 6ceq = f = 5.0000c = 6.0000ceq = f = 5.0000c = 6.0000ceq = f = 5.0000c = 2.0000ceq = f = 5.0000c = 2.0000ceq = f = 5.0000c = 2.0000ceq = f = 1.0000c = 9.9341e-009ceq = f = 1.0000c = 3.9736e-008ceq = f =
7、 1.0000c = -4.9671e-009ceq = Optimization terminated: first-order optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon.Active inequalities (to within options.TolCon = 1e-006): lower upper ineqlin ineqnonlin 1 1x = 1.0000 1.0000fval = 1.0000 (2) x,f
8、val=fmincon(x)objfun2(x),1;5,3 1.73205,6, , , (x)confun2(x)Warning: Large-scale (trust region) method does not currently solve this type of problem, switching to medium-scale (line search). In fmincon at 260f = -34.7222c = 4.8333c = 4.8333 -0.1667c = 4.8333 -0.1667 -1.0000c = 4.8333 -0.1667 -1.0000
9、-5.0000ceq = f = -34.7222c = 4.8333c = 4.8333 -0.1667c = 4.8333 -0.1667 -1.0000c = 4.8333 -0.1667 -1.0000 -5.0000ceq = f = -34.7222c = 4.8333c = 4.8333 -0.1667c = 4.8333 -0.1667 -1.0000c = 4.8333 -0.1667 -1.0000 -5.0000ceq = f = -0.0119c = -3.2760e-008c = -0.0000 -1.7738c = -0.0000 -1.7738 -1.8244c
10、= -0.0000 -1.7738 -1.8244 -0.3041ceq = f = -0.0119c = -3.7291e-008c = -0.0000 -1.7738c = -0.0000 -1.7738 -1.8244c = -0.0000 -1.7738 -1.8244 -0.3041ceq = f = -0.0119c = -1.7859e-008c = -0.0000 -1.7738c = -0.0000 -1.7738 -1.8244c = -0.0000 -1.7738 -1.8244 -0.3041ceq = f = -0.0119c = 0c = 0 -1.7738c =
11、0 -1.7738 -1.8244c = 0 -1.7738 -1.8244 -0.3041ceq = f = -0.0119c = -4.5311e-009c = -0.0000 -1.7738c = -0.0000 -1.7738 -1.8244c = -0.0000 -1.7738 -1.8244 -0.3041ceq = f = -0.0119c = 1.4901e-008c = 0.0000 -1.7738c = 0.0000 -1.7738 -1.8244c = 0.0000 -1.7738 -1.8244 -0.3041ceq = Optimization terminated:
12、 first-order optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon.Active inequalities (to within options.TolCon = 1e-006): lower upper ineqlin ineqnonlin 1 1x = 1.8244 0.3041fval = -0.0119 (3) x,fval=fmincon(x)objfun3(x),2;2;2,3.512 0.217 3.552,0,
13、, , (x)confun3(x)Warning: Large-scale (trust region) method does not currently solve this type of problem, switching to medium-scale (line search). In fmincon at 260f = 976c = -2c = -2 -2c = -2 -2 -2ceq = -13ceq = -13 2f = 976.0000c = -2.0000c = -2.0000 -2.0000c = -2.0000 -2.0000 -2.0000ceq = -13.00
14、00ceq = -13.0000 2.0000f = 976.0000c = -2c = -2.0000 -2.0000c = -2.0000 -2.0000 -2.0000ceq = -13.0000ceq = -13.0000 2.0000f = 976.0000c = -2c = -2 -2c = -2.0000 -2.0000 -2.0000ceq = -13.0000ceq = -13.0000 2.0000f = 795.9227c = 6.8107c = 6.8107 0.2770c = 6.8107 0.2770 -16.3378ceq = 288.3863ceq = 288.
15、3863 0.0000f = 932.7881c = 2.4054c = 2.4054 -0.8615c = 2.4054 -0.8615 -9.1689ceq = 65.5966ceq = 65.5966 1.0000f = 966.1007c = 0.2027c = 0.2027 -1.4307c = 0.2027 -1.4307 -5.5844ceq = 8.2741ceq = 8.2741 1.5000f = 973.9770c = -0.8987c = -0.8987 -1.7154c = -0.8987 -1.7154 -3.7922ceq = -6.8690ceq = -6.86
16、90 1.7500f = 973.9770c = -0.8987c = -0.8987 -1.7154c = -0.8987 -1.7154 -3.7922ceq = -6.8690ceq = -6.8690 1.7500f = 973.9770c = -0.8987c = -0.8987 -1.7154c = -0.8987 -1.7154 -3.7922ceq = -6.8690ceq = -6.8690 1.7500f = 973.9770c = -0.8987c = -0.8987 -1.7154c = -0.8987 -1.7154 -3.7922ceq = -6.8690ceq =
17、 -6.8690 1.7500f = 972.2917c = 2.1362c = 2.1362 -2.7450c = 2.1362 -2.7450 -4.9513ceq = 11.6139ceq = 11.6139 -0.0000f = 972.2917c = 2.1362c = 2.1362 -2.7450c = 2.1362 -2.7450 -4.9513ceq = 11.6139ceq = 11.6139 -0.0000f = 972.2917c = 2.1362c = 2.1362 -2.7450c = 2.1362 -2.7450 -4.9513ceq = 11.6139ceq =
18、11.6139 0.0000f = 972.2917c = 2.1362c = 2.1362 -2.7450c = 2.1362 -2.7450 -4.9513ceq = 11.6139ceq = 11.6139 -0.0000f = 975.5551c = 1.6687c = 1.6687 -3.0472c = 1.6687 -3.0472 -3.8126ceq = 1.6064ceq = 1.6064 -0.0000f = 975.5551c = 1.6687c = 1.6687 -3.0472c = 1.6687 -3.0472 -3.8126ceq = 1.6064ceq = 1.60
19、64 -0.0000f = 975.5551c = 1.6687c = 1.6687 -3.0472c = 1.6687 -3.0472 -3.8126ceq = 1.6064ceq = 1.6064 0.0000f = 975.5551c = 1.6687c = 1.6687 -3.0472c = 1.6687 -3.0472 -3.8126ceq = 1.6064ceq = 1.6064 0.0000f = 975.8815c = 1.5793c = 1.5793 -3.1050c = 1.5793 -3.1050 -3.5949ceq = 0.0587ceq = 0.0587 -0.00
20、00f = 975.8815c = 1.5793c = 1.5793 -3.1050c = 1.5793 -3.1050 -3.5949ceq = 0.0587ceq = 0.0587 -0.0000f = 975.8815c = 1.5793c = 1.5793 -3.1050c = 1.5793 -3.1050 -3.5949ceq = 0.0587ceq = 0.0587 0.0000f = 975.8815c = 1.5793c = 1.5793 -3.1050c = 1.5793 -3.1050 -3.5949ceq = 0.0587ceq = 0.0587 0.0000f = 97
21、5.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 9.1415e-005ceq = 1.0e-004 * 0.9142 -0.0000f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 9.1489e-005ceq = 1.0e-004 * 0.9149 -0.0019f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 9.1703
22、e-005ceq = 1.0e-004 * 0.9170 0.0065f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 9.1798e-005ceq = 1.0e-004 * 0.9180 0.0037f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 2.2183e-010ceq = 1.0e-009 * 0.2218 -0.0022f = 975.8924c = 1.5758c = 1.5758 -3.10
23、73c = 1.5758 -3.1073 -3.5863ceq = 7.4225e-008ceq = 1.0e-006 * 0.0742 -0.1879f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 2.8797e-007ceq = 1.0e-006 * 0.2880 0.6482f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 3.8353e-007ceq = 1.0e-006 * 0.3835 0.37
24、41f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 0ceq = 0 0f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 1.1092e-010ceq = 1.0e-009 * 0.1109 -0.0011f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 1.6637e-010ceq = 1.0e-009 * 0.1664 -0.0016f = 975.8924c = 1.5758c = 1.5758 -3.1073c = 1.5758 -3.1073 -3.5863ceq = 1.9410e-010ceq = 1.0e-009 * 0.1941 -0.0019f = 975.8924c = 1.5758c = 1.5758 -3.
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1