Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Optimization Toolbox Release Notes COPYRIGHT 20052012 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the governments needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information.
Contents
Summary by Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Version 6.2 (R2012a) Optimization Toolbox Software . . Version 6.1 (R2011b) Optimization Toolbox Software . . Version 6.0 (R2011a) Optimization Toolbox Software . . Version 5.1 (R2010b) Optimization Toolbox Software . . Version 5.0 (R2010a) Optimization Toolbox Software . . Version 4.3 (R2009b) Optimization Toolbox Software . . Version 4.2 (R2009a) Optimization Toolbox Software . . Version 4.1 (R2008b) Optimization Toolbox Software . . Version 4.0 (R2008a) Optimization Toolbox Software . . Version 3.1.2 (R2007b) Optimization Toolbox Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Version 3.1.1 (R2007a) Optimization Toolbox Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Version 3.1 (R2006b) Optimization Toolbox Software . . Version 3.0.4 (R2006a) Optimization Toolbox Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Version 3.0.3 (R14SP3) Optimization Toolbox Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 4 6 10 14 16 18 21 25 29
32
33 35
38
39
iii
40
iv
Contents
Summary by Version
This table provides quick access to whats new in each version. For clarification, see Using Release Notes on page 2. Version (Release) New Features and Changes Yes Details Yes Details Yes Details Yes Details Yes Details Yes Details Yes Details Yes Details Yes Details No Yes Details Yes Details Version Compatibility Considerations Yes Summary Yes Summary Yes Summary No Yes Summary Yes Summary Yes Summary Yes Summary Yes Summary No Yes Summary Yes Summary Fixed Bugs and Known Problems Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes Bug Reports Includes fixes
Latest Version V6.2 (R2012a) V6.1 (R2011b) V6.0 (R2011a) V5.1 (R2010b) V5.0 (R2010a) V4.3 (R2009b) V4.2 (R2009a) V4.1 (R2008b) V4.0 (R2008a) V3.1.2 (R2007b) V3.1.1 (R2007a) V3.1 (R2006b)
Version (Release)
Fixed Bugs and Known Problems Bug Reports Includes fixes Bug Reports Includes fixes
Summary by Version
Compatibility issues reported after the product release appear under Bug Reports at the MathWorks Web site. Bug fixes can sometimes result in incompatibilities, so review the fixed bugs in Bug Reports for any compatibility impact. Fixed Bugs and Known Problems MathWorks offers a user-searchable Bug Reports database so you can view Bug Reports. The development team updates this database at release time and as more information becomes available. Bug Reports include provisions for any known workarounds or file replacements. Information is available for bugs existing in or fixed in Release 14SP2 or later. Information is not available for all bugs in earlier releases. Access Bug Reports using your MathWorks Account.
New features and changes introduced in this version are: Enhanced Robustness in fminunc on page 4 FinDiffRelStep Option in Optimization Tool on page 4 Levenberg-Marquardt Algorithm Tweak on page 5 fmincon sqp Algorithm Tweak on page 5
Compatibility Considerations
When objective function values drop below ObjectiveLimit (default value: -1e20), iterations end with a -3 exit flag. Use optimset to change the value of ObjectiveLimit. Set ObjectiveLimit to -Inf to disable this tolerance.
Compatibility Considerations
The solvers now stop with exit flag 2 in most situations where previously they stopped with exit flag -3.
Compatibility Considerations
The fmincon sqp algorithm can give slightly different results than before.
New features and changes introduced in this version are: Derivative Estimate Changes on page 6 Gauss-Newton Algorithm Removed on page 7 DerivativeCheck Changes on page 7 fmincon ScaleProblem Default Changed on page 8 fsolve trust-region-dogleg Algorithm Change on page 8 Conversion of Error and Warning Message Identifiers on page 8
that uses finite differences. For details, see FinDiffRelStep in Options Structure.
Compatibility Considerations
The previous way of selecting the Gauss-Newton algorithm was to set the LargeScale option to 'off', and in: fsolve set the NonlEqnAlgorithm option to 'gn'. lsqcurvefit or lsqnonlin set the LevenbergMarquardt option to 'off'. To select an algorithm, use optimset to set the Algorithm option: fsolve trust-region-dogleg, trust-region-reflective, or
levenberg-marquardt
Solvers no longer use the LevenbergMarquardt, LineSearchType, and NonlEqnAlgorithm options, since these options relate only to the Gauss-Newton algorithm.
DerivativeCheck Changes
The DerivativeCheck option checks whether a solvers finite-difference approximations match the gradient or Jacobian functions that you supply. When a solver finds a discrepancy between the computed derivatives and their finite-difference approximations, the solver now errors. Solvers used to pause in this situation instead of erroring. Additionally, solvers now compare derivatives at a point near the initial point
x0, but not exactly at x0. Previously, solvers performed the comparison at x0. This change usually gives more reliable DerivativeCheck decisions. For
Solvers do not include the computations for DerivativeCheck in the function count. See Iterations and Function Counts.
Compatibility Considerations
Solvers compare the derivatives at a different point than before, so can change their decision on whether the derivatives match. Solvers now error instead of pause when they encounter a discrepancy.
Compatibility Considerations
Because of a bug in previous releases, when you did not provide gradients of the objective and nonlinear constraint functions, fmincon did not scale these functions. fmincon did scale linear constraints. So, if you do not provide gradients and have no linear constraints, the current fmincon behavior is the same as in previous releases. However, the current behavior can differ if you do provide gradients (GradObj or GradConstr is 'on'). If you provide gradients, have no linear constraints, and want to obtain the previous behavior, set ScaleProblem to 'obj-and-constr' with optimset.
Compatibility Considerations
fsolve iterations differ from previous versions. Additionally, the solution and
all associated outputs can differ from previous versions. Usually, results are numerically equivalent to previous results.
Compatibility Considerations
If you have scripts or functions that use message identifiers that changed, you must update the code to use the new identifiers. Typically, message identifiers are used to turn off specific warning messages, or in code that uses a try/catch statement and performs an action based on a specific error identifier. For example, the 'optim:fmincon:ConstrainedProblemsOnly' identifier has changed to 'optimlib:fmincon:ConstrainedProblemsOnly'. If your code checks for 'optim:fmincon:ConstrainedProblemsOnly', you must update it to check for 'optimlib:fmincon:ConstrainedProblemsOnly' instead. To determine the identifier for a warning, run the following command just after you see the warning:
[MSG,MSGID] = lastwarn;
This command saves the message identifier to the variable MSGID. To determine the identifier for an error, run the following command just after you see the error:
exception = MException.last; MSGID = exception.identifier;
Tip Warning messages indicate a potential issue with your code. While you can turn off a warning, a suggested alternative is to change your code so it runs warning free.
New features and changes introduced in this version are: New Quadratic Programming Algorithm on page 10 Enhanced Robustness in Nonlinear Solvers on page 11 New Defaults in DiffMinChange and DiffMaxChange Options on page 12 Output Structure Tweak on page 12 ktrlink Compatible with KNITRO 7 on page 13 New quadprog Demo on page 13
The algorithm has fast internal linear algebra. The algorithm handles sparse problems. There is a new presolve module that can improve speed, numerical stability, and detection of infeasibility. The algorithm handles large convex problems, and accepts and uses sparse inputs. See Large-Scale vs. Medium-Scale Algorithms. The algorithm optionally gives iterative display. The algorithm has enhanced exit messages.
10
For details on the algorithm, see interior-point-convex quadprog Algorithm. For help choosing the algorithm to use, see Quadratic Programming Algorithms.
Compatibility Considerations
You now choose the quadprog algorithm by using optimset to set the Algorithm option instead of the LargeScale option. If you dont set Algorithm or LargeScale, quadprog behaves as before.
Algorithm option choices are:
trust-region-reflective (formerly LargeScale = 'on'), the default active-set (formerly LargeScale = 'off') interior-point-convex The previous way of choosing the quadprog algorithm at the command line was to set the LargeScale option to 'on' or 'off'. quadprog now ignores the LargeScale option, except when you set the inconsistent values LargeScale = 'off' and Algorithm = 'trust-region-reflective'. In this case, to avoid backward incompatibility, quadprog honors the LargeScale option, and uses the 'active-set' algorithm.
quadprog now checks whether any inputs are complex, and, if so, it errors. The only exception is the Hinfo argument for the HessMult option is allowed to be complex.
11
fsolve trust-region-reflective, trust-region-dogleg, and levenberg-marquardt algorithms lsqcurvefit trust-region-reflective and levenberg-marquardt algorithms lsqnonlin trust-region-reflective and levenberg-marquardt algorithms
Compatibility Considerations
Some solver iterations can differ from previous ones. To obtain the previous behavior:
options = optimset('DiffMinChange',1e-8,'DiffMaxChange',0.1);
12
Compatibility Considerations
To avoid errors or unexpected results, update any code that depends on the exact value of the output.algorithm string.
13
New features and changes introduced in this version are: Enhanced fmincon Finite Difference Algorithms Add Robustness on page 14 ktrlink Available for Macintosh 64-Bit Systems on page 14 Output Structure Tweaks on page 14 New Video Demo on Modeling on page 15
14
All fmincon and quadprog algorithms now create a constrviolation field in the output structure. This field contains the largest value of the constraint functions at the final point: bounds, linear constraints, and nonlinear constraints. (Some algorithms return the larger of the constraint functions and 0.) See Writing Constraints.
15
New features and changes introduced in this version are: New fmincon Algorithm on page 16 lsqnonneg No Longer Uses x0 on page 16
Honors bounds at all iterations Attempts a different step if one leads to an objective or constraint function returning a NaN, Inf, or complex result Fast internal linear algebra for solving quadratic programs Choose the algorithm at the command line by setting the Algorithm option to 'sqp' with optimset. For more information about the algorithm, see fmincon SQP Algorithm in the Optimization Toolbox documentation.
Compatibility Considerations
The Optimization Tool no longer has an input region for accepting a start point. If you import or run a problem that contains a start point x0, MATLAB issues a warning. Also, the Optimization Tool and lsqnonneg ignore x0,
16
and instead use a start point of a vector of zeroes. If you export a problem structure from the Optimization Tool, there is no x0 field.
17
New features and changes introduced in this version are: Enhanced Exit Messages in Selected Solvers on page 18 fmincon Interior-Point Algorithm Robust to Certain Errors on page 18 Changes in quadprog on page 19 Changes in linprog on page 19 Multiobjective optimValues Changes on page 19
Compatibility Considerations
For solvers with enhanced exit messages, the content of output.message contains many more characters than before. User code that relies on this field might need to be modified in order to display the larger exit message satisfactorily.
18
Changes in quadprog
The large-scale quadprog algorithm now uses the TolFun and MaxIter tolerances for deciding when to end iterations when there are only linear equality constraints, instead of the TolPCG and MaxPCGIter tolerances. The quadprog output structure now contains the constrviolation field, which reports the maximum constraint function at the final point.
Compatibility Considerations
For large-scale linear equality constrained problems, the default values of the tolerances are much tighter than before, so quadprog can take more iterations, but the resulting solution should be more accurate.
Changes in linprog
The large-scale interior-point algorithm of linprog now has a backtracking mechanism for the case of stalling, and performs LDL factorization when there is rank deficiency. For more information, see Large Scale Linear Programming. The linprog output structure now contains the constrviolation field, which reports the maximum constraint function at the final point.
Compatibility Considerations
The interior-point algorithm of linprog might arrive at different solutions than before, and can solve more problems than before.
19
Furthermore, the value stored in optimValues.fval has changed. Now optimValues.fval contains the vector F of objective function values. For a complete description of the current optimValues structure, see Fields in optimValues.
Compatibility Considerations
User code that uses the optimValues.fval field within an output function in fgoalattain and fminimax might need to be updated to avoid errors
20
New features and changes introduced in this version are: Parallel Gradient Estimation Available in fmincon Interior-Point Algorithm on page 21 Enhanced Exit Messages in Selected Solvers on page 21 Change in linprog Simplex Algorithm on page 23 Change in fminunc Exit Flag on page 23 New demos on page 23
21
22
separated by a line of text stating Stopping criteria details:. The message field does not contain hyperlinks; it contains only text.
Compatibility Considerations
For solvers with enhanced exit messages, the content of output.message contains many more characters than before. User code that relies on this field may need to be modified in order to display the larger exit message satisfactorily.
Compatibility Considerations
The simplex algorithm of linprog might arrive at different solutions than before, and can solve more problems than before.
Compatibility Considerations
This change might cause users (or code) that examine exit flags to evaluate a result more favorably than previously, since positive exit flags represent normal termination of solvers.
New demos
There are two new demos: A demo showing how to use Symbolic Math Toolbox functions to help calculate gradients and Hessians. Run the demo at the MATLAB command line by entering echodemo symbolic_optim_demo.
23
A demo showing how to use fseminf for investigating the effect of parameter uncertainty. Run the demo at the MATLAB command line by entering echodemo airpollution. Furthermore, the optimization tutorial demo now shows how to include extra parameters. Run the demo at the MATLAB command line by entering echodemo tutdemo.
24
New features and changes introduced in this version are: fsolve, lsqcurvefit, lsqnonlin Algorithm and Options Changes on page 25 Optimization Tool Enables Parallel Functionality on page 26 Central Finite Differences Available in Selected Solvers on page 26 lsqnonneg Refactored on page 27 Finite Difference Algorithm Tweaked on page 27 DerivativeCheck Tolerance Changed on page 28
25
Compatibility Considerations
The refactored Levenberg-Marquardt algorithm can cause fsolve, lsqcurvefit and lsqnonlin to yield different answers than before. The previous way of choosing the algorithm at the command line was to set the LargeScale option to 'on' or 'off', and, for all solvers but fsolve, to set the LevenbergMarquardt option to 'on' or 'off'. For fsolve, in addition to the LargeScale option, you needed to set the NonlEqnAlgorithm option appropriately. LargeScale, NonlEqnAlgorithm, and LevenbergMarquardt are now ignored, except when choosing to use the Gauss-Newton algorithm. The Gauss-Newton algorithm warns that soon it may no longer be available. The default value of the MaxFunEvals option in the refactored Levenberg-Marquardt algorithm is now 200*numberOfVariables; the previous value was 100*numberOfVariables.
26
algorithm already had them, and the trust-region-reflective algorithm for both solvers requires a user-supplied gradient, so does not use finite differences. To use central finite differences, use optimset to set the FinDiffType option to 'central' instead of the default 'forward'. This causes the solver to estimate gradients by formulae such as
f ( x + 1 e1 ) f ( x 1 e1 ) f ( x + n en ) f ( x n en ) f ( x) , , , 21 2 n
instead of
f ( x + 1 e1 ) f ( x) f ( x + 2 e2 ) f ( x) f ( x + n en ) f ( x) f ( x) , , , . 1 2 n
Central finite differences take twice as many function evaluations as forward finite differences, but are usually much more accurate. Central finite differences can work in parallel for gradient estimation in fgoalattain, fmincon active-set algorithm, and fminimax. For details on how to use this parallel gradient estimation, see the Parallel Computing for Optimization chapter in the Users Guide.
lsqnonneg Refactored
lsqnonneg was refactored. It can now use sparse matrices, and it preserves sparsity during its execution.
27
Compatibility Considerations
Nonlinear solvers can run slightly differently whenever an iteration causes a component of x to be zero, and gradients are estimated by forward finite differences.
Compatibility Considerations
Some problems will now report violations of the DerivativeCheck condition, when previously they would not.
28
New features and changes introduced in this version are: Parallel Computing Toolbox Support in fmincon, fminimax, and fgoalattain on page 29 Combined and Extended optimtool on page 29 New fmincon Solver, New Option Algorithm for fmincon, Option LargeScale Changed on page 30 External Interface to KNITRO Libraries on page 30 Default PrecondBandWidth = Inf in lsqcurvefit, lsqnonlin, and fsolve on page 31 New Option TolConSQP with Incompatible Default Value on page 31 Field constrviolation in Output Structure on page 31
in order to speed the estimation of gradients. For details on how to use this parallel gradient estimation, see the Parallel Computing for Optimization chapter in the Users Guide.
29
Furthermore, three new Global Optimization Toolbox solvers were added to Optimization Tool: gamultiobj, simulannealbnd, and threshacceptbnd. Optimization Tool shows Global Optimization Toolbox solvers only if these solvers are licensed.
New fmincon Solver, New Option Algorithm for fmincon, Option LargeScale Changed
The new interior-point algorithm is a large-scale algorithm that can handle all types of constraints. It has several new options, explained in the fmincon function reference pages.
fmincon now has three algorithms. Choose between them by setting the new option Algorithm to:
'trust-region-reflective' (formerly known as 'large scale') 'active-set' (formerly known as 'medium scale') 'interior-point' By default, Algorithm = 'trust-region-reflective'.
Compatibility Considerations
The previous way of choosing the algorithm at the command line was to set option LargeScale to 'on' or 'off'. LargeScale is now ignored, except when LargeScale = 'off' and Algorithm = 'trust-region-reflective'. In this case, the 'active-set' algorithm is used, to minimize backward incompatibility.
30
Compatibility Considerations
The new default can lead to slower performance for problems with high-dimensional nonlinearities. If this happens, change the default to another value such as 0 (the previous default).
Compatibility Considerations
The new default value is TolConSQP = 1e6. This did not affect a vast majority of tested cases, and was beneficial in some. If you want exactly the same behavior as before, set TolConSQP = eps using optimset.
31
32
Compatibility Considerations
The third output argument of the solver fminimax, maxfval, is described in the documentation as the maximum of the objective functions in the input fun evaluated at the solution x, that is, max(fval). Before this release, fminimax actually returned the maximum of the objective functions in the reformulated minimax problem internally constructed by the algorithm. This value was typically very close to, but not necessarily equal to, max(fval). fminimax now returns the exact value of max(fval) in the output maxfval. The iterative display for fminimax includes a new column with header Objective value that reports the objective function value of the nonlinear programming reformulation of the minimax problem. The column header Max{F,constraints} has been changed to Max constraint, and the column now contains the maximum violation among all constraints, both internally constructed and user-provided. The iterative display for fgoalattain now shows the value of the attainment factor in the Attainment factor column. A new column, Max
33
34
New features and changes introduced in this version are: New Optimization Tool on page 35 Plot Functions Option Added on page 36 Output Function Option Enhanced to Accept Multiple Functions on page 36 Changes to the Output Function on page 36
35
Compatibility Considerations
The above changes to the input x and optimValues structure have the following compatibility considerations in the output function: If you have references to the residual in a previous version, note that the value of this field has changed for lsqnonlin and lsqcurvefit. This fixes the problem addressed by the bug report S-289285. Any references to fval for lsqnonlin and lsqcurvefit need to be updated to resnorm. This fixes the problem addressed by the bug report S-289285. Any references to procedure for lsqnonlin and lsqcurvefit need to be removed. This fixes the problem addressed by the bug report S-291974.
36
Previously, for fgoalattain and fminimax, x returned a column vector with an additional last element. If you have references to the values for x in a previous version, the extra element must be removed and the output vector may need to be reshaped. This fixes the problem addressed by the bug report S-315658.
37
38
39
40
Version (Release)
New Features and Changes with Version Compatibility Impact Conversion of Error and Warning Message Identifiers on page 8
V6.0 (R2011a)
See the Compatibility Considerations subheading for each of these changes or new features: New Quadratic Programming Algorithm on page 10 New Defaults in DiffMinChange and DiffMaxChange Options on page 12 Output Structure Tweak on page 12
None See the Compatibility Considerations subheading for this change: lsqnonneg No Longer Uses x0 on page 16
V4.3 (R2009b)
See the Compatibility Considerations subheading for each of these new features or changes: Enhanced Exit Messages in Selected Solvers on page 18 Changes in quadprog on page 19 Changes in linprog on page 19 Multiobjective optimValues Changes on page 19
41
New Features and Changes with Version Compatibility Impact See the Compatibility Considerations subheading for each of these new features or changes: Enhanced Exit Messages in Selected Solvers on page 21 Change in linprog Simplex Algorithm on page 23 Change in fminunc Exit Flag on page 23
V4.1 (R2008b)
See the Compatibility Considerations subheading for each of these new features or changes: fsolve, lsqcurvefit, lsqnonlin Algorithm and Options Changes on page 25 Finite Difference Algorithm Tweaked on page 27 DerivativeCheck Tolerance Changed on page 28
42
New Features and Changes with Version Compatibility Impact See the Compatibility Considerations subheading for each of these new features or changes: New fmincon Solver, New Option Algorithm for fmincon, Option LargeScale Changed on page 30 Default PrecondBandWidth = Inf in lsqcurvefit, lsqnonlin, and fsolve on page 31 New Option TolConSQP with Incompatible Default Value on page 31
None See the Compatibility Considerations subheading for this change: Changes to Outputs of Multiobjective Solvers on page 33
V3.1 (R2006b)
See the Compatibility Considerations subheading for this change: Changes to the Output Function on page 36
None None
43