MATLAB---非线性优化问题二

OPTIONS = optimset('HessUpdate','bfgs','gradobj','on','display','iter');
x=[-1.9,2];
[x,fval,exitflag,output]=fminunc(@BanaFunWithGrad,x,OPTIONS)```
                                                        First-order 
 Iteration  Func-count       f(x)        Step-size       optimality
     0           1           267.62                      1.23e+03
     1           2          214.416    0.000813405            519  
     2           3          54.2992              1            331  
     3           5          5.90157       0.482557           1.46  
     4           7          5.89006             10           2.58  
     5           8          5.84192              1           6.56  
     6          12          4.10287        3.36173           15.2  
     7          14          4.08487       0.115157           19.9  
     8          16          3.39008             10           11.3  
     9          17          3.13374              1           20.7  
    10          18          2.47005              1           3.18  
    11          20          2.12377       0.680691           8.62  
    12          21          1.92984              1           8.86  
    13          22          1.43587              1            2.9  
    14          24            1.297       0.424918            6.5  
    15          25          1.11139              1           5.84  
    16          26         0.846847              1           2.07  
    17          28          0.69475       0.355559           5.72  
    18          29         0.610218              1           3.12  
    19          31         0.478643       0.654646           5.39  
                                                        First-order 
 Iteration  Func-count       f(x)        Step-size       optimality
    20          32         0.343148              1           1.82  
    21          34         0.285595            0.5            3.9  
    22          35         0.194664              1           3.02  
    23          36         0.135051              1           2.03  
    24          38        0.0853711       0.432792           2.77  
    25          39        0.0672554              1            2.7  
    26          40        0.0375608              1           2.44  
    27          42        0.0155788       0.426799            1.7  
    28          43        0.0112938              1           1.68  
    29          44       0.00380389              1           1.08  
    30          46      0.000739863        0.48751          0.533  
    31          47      0.000329285              1          0.441  
    32          48      2.84167e-05              1          0.105  
    33          49      5.15928e-06              1         0.0787  
    34          50      3.45885e-08              1       0.000565  

Local minimum found.

Optimization completed because the size of the gradient is less than
the value of the optimality tolerance.

<stopping criteria details>

x =

    0.9998    0.9996


fval =

   3.4588e-08


exitflag =

     1


output = 

  包含以下字段的 struct:

       iterations: 34
        funcCount: 50
         stepsize: 0.0030
     lssteplength: 1
    firstorderopt: 5.6450e-04
        algorithm: 'quasi-newton'
          message: '↵Local minimum found.↵↵Optimization completed because the size of the gradient is less than↵the value of the optimality tolerance.↵↵↵↵Optimization completed: The first-order optimality measure, 4.587978e-07, is less ↵than options.OptimalityTolerance = 1.000000e-06.↵↵'

你可能感兴趣的:(MATLABGUI图形展示,MATLAB可视化,可视化,非线性优化,matlab)