BranchBound
Description
Use the BranchBound
object to set options for the active-set QP
solver used within an mpc
object.
Creation
Creating an mpc
object automatically creates an
BranchBound
object set to default options. If the Type
property of any manipulated variable is set to anything different than
"continuous"
, the BranchBound
object is assigned to the
Optimizer.SolverOption
property of the mpc
object. You
can access the object and its properties using dot notation.
Properties
QPSolver
— QP solver
'active-set'
(default)
This property is read-only.
QP solver, returned as 'active-set'
. This property indicates the
algorithm used to solve the relaxed, continuous, QP problem.
QPSolverOptions
— QP solver options
ActiveSet
object (default)
QP solver options, specified as an ActiveSet
object. This object contains the settings for the QP algorithm used to solve the
relaxed, continuous QP problem.
DiscreteConstraintTolerance
— Tolerance used to verify that constraints on the discrete manipulated variables are satisfied
1e-6
(default) | positive scalar
Tolerance used to verify that constraints in the discrete manipulated variables are
satisfied by the optimal solution, specified as a positive scalar. A larger
DiscreteConstraintTolerance
value allows for larger constraint
violations.
Example: mpcobj.Optimizer.SolverOptions.DiscreteConstraintTolerance =
1e-5
RoundingAtRootNode
— Option to round solution at root node
1
(default) | 0
Option to round the solution at the root node, specified as a boolean. When
RoundingAtRootNode
is 1
, the solver rounds the
solution of the relaxed QP problem solved at the root node of the search tree, so that
discrete constraints are satisfied. Then, an additional QP is solved with respect to the
remaining (continuous) variables. If such a QP has a feasible solution, the
corresponding cost is used as a valid upper-bound on the optimal solution of the
original mixed-integer problem. Having such an upper-bound can eliminate entire subtrees
in the rest of the execution of the solver and accelerate the solution of the following
QP relaxations. Unless the number of iterations MaxIterations
is
small, set RoundingAtRootNode
to 1
. Set
RoundingAtRootNode
to 0
to avoid solving the
additional QP.
Example: mpcobj.Optimizer.SolverOptions.RoundingAtRootNode =
true
MaxPendingNodes
— Maximum number of pending QP relaxations
1000
(default) | positive scalar
Maximum number of pending QP relaxations that can be stored, specified as a positive
scalar. This property determines the memory allocated to store all pending QP
relaxations, which is proportional to
(2*m+3*Nd)*MaxPendingNodes
,
where m is the number of inequality constraints and
Nd is the number of discrete variables. If the number of pending
relaxations exceeds MaxPendingNodes
, then the solver is stopped
with status code -3
, -4
or
-5
.
Example: mpcobj.Optimizer.SolverOptions.MaxPendingNodes =
2000
Object Functions
Examples
Access Properties of BranchBound
Options Object
Create an mpc
object.
plant = ss(0.8,0.5,0.25,0,0.1); mpcobj=mpc(plant);
-->"PredictionHorizon" is empty. Assuming default 10. -->"ControlHorizon" is empty. Assuming default 2. -->"Weights.ManipulatedVariables" is empty. Assuming default 0.00000. -->"Weights.ManipulatedVariablesRate" is empty. Assuming default 0.10000. -->"Weights.OutputVariables" is empty. Assuming default 1.00000.
Display the fields of the Optimizer
property.
mpcobj.Optimizer
ans = struct with fields:
OptimizationType: 'QP'
Solver: 'active-set'
SolverOptions: [1x1 mpc.solver.options.qp.ActiveSet]
MinOutputECR: 0
UseSuboptimalSolution: 0
CustomSolver: 0
CustomSolverCodeGen: 0
Set the Type
property of the manipulated variable to "integer"
. Doing so makes the problem noncontinuous, therefore requiring an MIQP solver instead of a simple QP solver.
mpcobj.ManipulatedVariables(1).Type='integer';
Display the properties of the SolverOptions
object.
mpcobj.Optimizer.SolverOptions
ans = BranchBound with properties: QPSolver: 'active-set' QPSolverOptions: [1x1 mpc.solver.options.qp.ActiveSet] DiscreteConstraintTolerance: 1.0000e-06 RoundingAtRootNode: 1 MaxPendingNodes: 1000
Modify the DiscreteConstraintTolerance
property.
mpcobj.Optimizer.SolverOptions.DiscreteConstraintTolerance = 1e-5;
Extract the object.
bbopts = mpcobj.Optimizer.SolverOptions;
Modify the MaxPendingNodes
property.
bbopts.MaxPendingNodes = 500;
Reassign the object to the SolverOptions
field of the Optimizer
property of mpcobj
.
mpcobj.Optimizer.SolverOptions = bbopts;
Display the fields of the Optimizer
property again.
mpcobj.Optimizer.SolverOptions
ans = BranchBound with properties: QPSolver: 'active-set' QPSolverOptions: [1x1 mpc.solver.options.qp.ActiveSet] DiscreteConstraintTolerance: 1.0000e-05 RoundingAtRootNode: 1 MaxPendingNodes: 500
Version History
Introduced in R2024a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)