block
Purpose
Adds a move blocking constraint
Syntax
Description
Adding this filter to an MPC setup will modify the constraints in
such a way that the differences between several consecutive
optimization variables are equal to zero.
In the most common scenario, adding this filter to a signal
representing control inputs will add a move-blocking constraint,
which is equivalent to setting a control horizon.
To enable this filter, call model.u.with('block') (note
that you can add this constrain to any type of signals, e.g., to
state and output signals as well).
Once the filter is enabled, parameters of the blocking scheme can
be specified in the model.u.block.from and
model.u.block.to parameters. Setting these values to
non-zero integers will add the constraint
.
The filter can be removed by calling
model.x.without('block').
Example(s)
Example
1
Create a 1D LTI system
.model = LTISystem('A', 0.9, 'B', 1);
Add constraints and penalties
model.x.min = -4; model.x.max = 4;
model.u.min = -1; model.u.max = 1;
model.x.penalty = QuadFunction(1);
model.u.penalty = QuadFunction(1);
Create an MPC controller with prediction horizon 10M = MPCController(model, 5);
Tell the controller that only the first two control moves
are free, the rest are to fixed
M.model.u.with('block');
M.model.u.block.from = 2;
M.model.u.block.to = 5;
x0 = 4;
[~, ~, openloop] = M.evaluate(x0);
openloop.U
ans =
-1 -0.719434753448955 -0.719434753448955 -0.719434753448955 -0.719434753448955
◀ |
filter_terminalset |
|
filter_softmin |
▶ |
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk