Main Content

mpcActiveSetOptions

Create default option set for mpcActiveSetSolver

Since R2020a

Description

Settings for mpcActiveSetSolver, that you can use to solve a QP optimization problem. To set options for the active-set QP solver used within the mpc object instead, access the ActiveSet object within the Optimizer property of the mpc object using dot notation.

example

options = mpcActiveSetOptions creates an ActiveSet options object containing default options for mpcActiveSetSolver, which solves a quadratic programming (QP) problem using an active-set algorithm.

example

options = mpcActiveSetOptions(type) creates a default option set using the specified input data type. All real options are specified using this data type.

Examples

collapse all

Create a default option set.

opt = mpcActiveSetOptions;

Create a default option set.

opt = mpcActiveSetOptions;

Specify the maximum number of iterations allowed during computation.

opt.MaxIterations = 100;

Specify a constraint tolerance for verifying that the optimal solution satisfies the inequality constraints.

opt.ConstraintTolerance = 1.0e-4;

Create a default option set, specifying the input argument type.

opt = mpcActiveSetOptions('single');

Input Arguments

collapse all

Solver input argument data type, specified as either 'double' or 'single'. This data type is used for both simulation and code generation. All real options in the option set are specified using this data type, and all real input arguments to mpcActiveSetSolver must match this type.

Output Arguments

collapse all

Option set for mpcActiveSetSolver, returned as an ActiveSet options object, which has the following properties.

PropertyDescriptionDefault
DataTypeInput argument data type, specified as either 'double' or 'single'. This data type is used for both simulation and code generation, and all real input arguments to the solver function must match this type.'double'
MaxIterationsMaximum number of iterations allowed when computing the QP solution, specified as a positive integer.200
ConstraintToleranceTolerance used to verify that inequality constraints are satisfied by the optimal solution, specified as a positive scalar. A larger ConstraintTolerance value allows for larger constraint violations.1e-6
UseHessianAsInput

Indicator of whether the first input argument to mpcActiveSetSolver is the Hessian matrix, specified as a logical value. If UseHessianAsInput is true, pass the Hessian matrix to mpcActiveSetSolver. Otherwise, use the inverse of the lower-triangular Cholesky decomposition (Linv) of the Hessian matrix.

If your application requires repetitive calls of mpcActiveSetSolver using a constant Hessian matrix, you can improve computational efficiency by passing Linv to mpcActiveSetSolver instead of the Hessian matrix.

true
IntegrityChecksIndicator of whether integrity checks are performed on the solver function input data, specified as a logical value. If IntegrityChecks is true, then integrity checks are performed and diagnostic messages are displayed. Use false for code generation only.true

Extended Capabilities

Version History

Introduced in R2020a