Contenido principal

Iterative Display

Types of Iterative Display

Iterative display gives you information about the progress of solvers during their runs.

There are two types of iterative display:

  • Global solver display

  • Local solver display

Both types appear at the command line, depending on global and local options.

Obtain local solver iterative display by setting the Display option in the problem.options field to "iter" or "iter-detailed" with optimoptions. For more information, see Iterative Display.

Obtain global solver iterative display by setting the Display property in the GlobalSearch or MultiStart object to "iter".

Global solvers set the default Display option of the local solver to "off", unless the problem structure has a value for this option. Global solvers do not override any setting you make for local options.

Note

Setting the local solver Display option to anything other than "off" can produce a great deal of output. The default Display option created by optimoptions(@solver) is "final".

Examine Types of Iterative Display

Run the example described in Run the Solver using GlobalSearch with GlobalSearch iterative display:

% Set the random stream to get exactly the same output
% rng(14,"twister")
gs = GlobalSearch(Display="iter");
opts = optimoptions(@fmincon,Algorithm="interior-point");
sixmin = @(x)(4*x(1)^2 - 2.1*x(1)^4 + x(1)^6/3 ...
    + x(1)*x(2) - 4*x(2)^2 + 4*x(2)^4);
problem = createOptimProblem("fmincon",x0=[-1,2],...
    objective=sixmin,lb=[-3,-3],ub=[3,3],...
    options=opts);
[xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
 Num Pts                 Best       Current    Threshold        Local        Local                 
Analyzed  F-count        f(x)       Penalty      Penalty         f(x)     exitflag        Procedure
       0       34      -1.032                                  -1.032            1    Initial Point
     200     1240      -1.032                                       0            1    Stage 1 Local
     300     1342      -1.032         15.67      -0.2963                              Stage 2 Search
     400     1442      -1.032         102.6        1.022                              Stage 2 Search
     500     1542      -1.032          4.02       0.2542                              Stage 2 Search
     506     1582      -1.032       0.08424       0.2542       -1.032            1    Stage 2 Local
     512     1623      -1.032       -0.2141      0.08424      -0.2155            1    Stage 2 Local
     600     1711      -1.032         97.04      -0.7218                              Stage 2 Search
     700     1811      -1.032         114.7      -0.4829                              Stage 2 Search
     800     1911      -1.032         287.4       0.3737                              Stage 2 Search
     900     2011      -1.032         2.339       0.8699                              Stage 2 Search
     905     2060      -1.032        0.5993       0.8699      -0.2155            1    Stage 2 Local
    1000     2155      -1.032         25.61        -1.03                              Stage 2 Search

GlobalSearch stopped because it analyzed all the trial points.

All 5 local solver runs converged with a positive local solver exit flag.

Run the same example without GlobalSearch iterative display, but with fmincon iterative display:

gs.Display = "final";
problem.options.Display = "iter";
[xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
                                            First-order      Norm of
 Iter F-count            f(x)  Feasibility   optimality         step
    0       3    4.823333e+01    0.000e+00    1.088e+02
    1       7    2.020476e+00    0.000e+00    2.176e+00    2.488e+00
    2      10    6.525252e-01    0.000e+00    1.937e+00    1.886e+00
    3      13   -8.776121e-01    0.000e+00    9.076e-01    8.539e-01
    4      16   -9.121907e-01    0.000e+00    9.076e-01    1.655e-01
    5      19   -1.009367e+00    0.000e+00    7.326e-01    8.558e-02
    6      22   -1.030423e+00    0.000e+00    2.172e-01    6.670e-02
    7      25   -1.031578e+00    0.000e+00    4.278e-02    1.444e-02
    8      28   -1.031628e+00    0.000e+00    8.777e-03    2.306e-03
    9      31   -1.031628e+00    0.000e+00    8.845e-05    2.750e-04
   10      34   -1.031628e+00    0.000e+00    8.744e-07    1.352e-06

Local minimum found that satisfies the constraints.

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.

                                            First-order      Norm of
 Iter F-count            f(x)  Feasibility   optimality         step
    0       3   -4.399715e-01    0.000e+00    1.980e+00
    1       9   -9.929469e-01    0.000e+00    1.230e+00    3.442e-01
    2      15   -1.028480e+00    0.000e+00    3.291e-01    9.982e-02
    3      18   -1.031263e+00    0.000e+00    6.726e-02    3.436e-02
    4      21   -1.031627e+00    0.000e+00    8.806e-03    7.753e-03
    5      24   -1.031628e+00    0.000e+00    1.433e-04    3.723e-04
    6      27   -1.031628e+00    0.000e+00    2.492e-06    2.254e-05
    7      30   -1.031628e+00    0.000e+00    8.744e-07    3.155e-07

Local minimum found that satisfies the constraints.

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.

                                            First-order      Norm of
 Iter F-count            f(x)  Feasibility   optimality         step
    0       3   -1.906111e-01    0.000e+00    8.356e-01
    1      14   -2.146803e-01    0.000e+00    1.300e-01    5.455e-02
    2      20   -2.151309e-01    0.000e+00    1.060e-01    6.160e-03
    3      23   -2.150434e-01    0.000e+00    9.182e-02    1.143e-02
    4      26   -2.154599e-01    0.000e+00    1.558e-02    5.912e-03
    5      29   -2.154638e-01    0.000e+00    2.230e-04    6.503e-04
    6      32   -2.154638e-01    0.000e+00    1.543e-04    1.133e-05
    7      35   -2.154638e-01    0.000e+00    1.543e-06    6.249e-06
    8      38   -2.154638e-01    0.000e+00    2.600e-08    5.015e-08

Local minimum found that satisfies the constraints.

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.


GlobalSearch stopped because it analyzed all the trial points.

All 3 local solver runs converged with a positive local solver exit flag.

Setting GlobalSearch iterative display, as well as fmincon iterative display, yields both displays intermingled.

For an example of iterative display in a parallel environment, see Parallel MultiStart.

See Also

Topics