Main Content

mpcqpsolverOptions

(To be removed) Create default option set for mpcqpsolver

mpcqpsolverOptions will be removed in a future release. Use mpcActiveSetOptions instead. For more information, see Version History.

Description

options = mpcqpsolverOptions creates a structure of default options for mpcqpsolver, which solves a quadratic programming (QP) problem using the KWIK algorithm.

example

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

example

Examples

collapse all

opt = mpcqpsolverOptions;

Create default option set.

opt = mpcqpsolverOptions;

Specify the maximum number of iterations allowed during computation.

opt.MaxIter = 100;

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

opt.FeasibilityTol = 1.0e-3;
opt = mpcqpsolverOptions('single');

Input Arguments

collapse all

MPC QP 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 mpcqpsolver must match this type.

Output Arguments

collapse all

Option set for mpcqpsolver, returned as a structure with the following fields:

FieldDescriptionDefault
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 mpcqpsolver must match this type.'double'
MaxIterMaximum number of iterations allowed when computing the QP solution, specified as a positive integer.200
FeasibilityTolTolerance used to verify that inequality constraints are satisfied by the optimal solution, specified as a positive scalar. A larger FeasibilityTol value allows for larger constraint violations.1.0e-6
IntegrityChecksIndicator of whether integrity checks are performed on the mpcqpsolver 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

Version History

Introduced in R2015b

collapse all

R2020a: mpcqpsolverOptions will be removed

mpcqpsolverOptions will be removed in a future release. Use mpcActiveSetOptions instead. There are differences between these functions that require updates to your code.

Update Code

To update your code:

  • Change the function name from mpcqpsolverOptions to mpcActiveSetOptions. The syntaxes are equivalent.

  • Some field names of the returned structure have changed. The default field values are the same. This table shows the new property names.

    Previous Property NameNew Property Name
    MaxIterMaxIterations
    FeasibilityTolConstraintTolerance
  • The returned structure of mpcActiveSetOptions contains the new field UseHessianAsInput. To continue to use the inverse of the lower-triangular decomposition of the Hessian matrix with mpcActiveSetSolver, you must set UseHessianAsInput to false.

For syntax examples showing how to update your code, see mpcqpsolver.