MPT 2.0.2 Changelog
Permanent saving of options in mpt_init
mpt_init
can now permanently save list of available solvers, such
that consequent runs of mpt_init are performed much faster. to utilize
the new feature, call:
>> mpt_init('save')
if you want to set some default options, e.g. if you want to use CDD as
default LP solver and change value of absolute tolerance to 1e-8
, call:
>> mpt_init('lpsolver', 'cdd', 'abs_tol', 1e-8, 'save');
Note! if you install some new solvers after you save the settings,
this change will not be reflected by MPT. in order to tell MPT to find
your new solver, call:
>> mpt_init('rehash')
Assign objects in caller's workspace
This cryptic name roughly means the following: when you use certain functions,
the result is automatically updated in the workspace, without the need to request
the output from the function explicitly. To illustrate this, take for instance
the mpt_simplify
function, which tries to simplify regions of an
explicit controller:
>> Double_Integrator;
>> ctrl = mpt_control(sysStruct, probStruct);
Now we have the variable ctrl
in our main workspace. In order
to simplify the controller, one can call:
>> ctrl_simple = mpt_simplify(ctrl)
or, with the new syntax, just call:
>> mpt_simplify(ctrl)
The new syntax internally does the following:
>> ctrl_dummy = mpt_simplify(ctrl)
>> ctrl = ctrl_dummy
>> clear ctrl_dummy
i.e. it updates the ctrl
variable in your workspace such that
it nows contains the simplified controller. The old syntax of course works as well.
Following functions can be used in the new way:
>> mpt_lyapunov(ctrl, function_type)
>> mpt_invariantSet(ctrl)
>> mpt_simplify(ctrl)
>> mpt_searchTree(ctrl)
Major speedup of invariant sets computation and Lyapunov functions calculations
Thanks to
Johan Löfberg,
mpt_invariantSet
and
mpt_lyapunov
now exploit
mpt_transmap
which allows to prune infeasible transitions very quickly.
This results in speedup typically by factor of 5-10.
New mpLP solvers
Miroslav Baric prepared 2 new mpLP solvers
(
mpt_mplp_ver6.m
and
mpt_mplp_ver7.m
), which
are significantly more numerically robust than previous versions.
New function to compute orthogonal cuts through polytope(s)
Frank J. Christophersen coded
polytope/slice.m
which calculates orthogonal cut through a polytope or
a polytope array:
>> Pcut = slice(P, coords, values)
where coords
is a vector of coordinates through which to cut and
values
is a vector of values at which to cut.
merge.m
now allows to use optimal merging
Tobias Geyer contributed an update to
polytope/merge.m
which allows
to use the optimal merging:
>> Options.greedy = 0; % use optimal merging instead of greedy method
>> Pm = merge(P, Options);
Improved analytical computation of convex hulls for dimensions above 2
Mario Vasak
contributed an update of the
hull.m
function, which
allows to solve convex hull problems more efficiently and more robustly.
New function to simulate MLD systems - mpt_mldsim
Allows to simulate a given MLD system for one time step by solving a feasibility
mixed-integer program:
>> [xn,y,d,z] = mpt_mldsim(S, x0, u)
where S
is a structure containing matrices of the MLD system,
x0
is the initial state and u
is the control input.
This type of simulation can also be used from mpt_simSys
if
Options.usemldsim=1
:
>> Options.usemldsim = 1;
>> [X,U,Y] = mpt_simSys(sysStruct, x0, U, Options);
Create sysStruct
structure based on MLD matrices
mpt_sys
now allows to use the following scenario:
>> sysStruct = mpt_sys(S, 'nopwa')
i.e. it creates a sysStruct
structure based on MLD matrices
without transforming the hybrid system into an equivalent PWA representation.
Penalties on d and z variables can now be specified
When solving an on-line MPC problem for MLD systems, penalties on boolean
d and on auxiliary continuous z variables can now be specified:
>> probStruct.Qd = Qd
>> probStruct.Qz = Qz
New function to plot Lyapunov functions
mpt_plotLyapunov
will plot a Lyapunov function stored in a given
controller object:
>> ctrl_lyap_pwq = mpt_lyapunov(ctrl, 'pwq')
>> ctrl_lyap_pwa = mpt_lyapunov(ctrl, 'pwa')
>> mpt_plotLyapunov(ctrl_lyap_pwq)
>> mpt_plotLyapunov(ctrl_lyap_pwa)
Note: works for PWQ and PWA Lyapunov functions, does not work for
Piecewise-Polynomial and SOS Lyapunov functions.
Verification of hybrid systems based on feasibility MILP
The question of verifying if a given hybrid system can enter a given
target set in finite time can now be formulated and solved as a feasibility
Mixed-Interger LP:
>> Options.usereachsets = 0; % use MILP instead of reachable sets
>> answer = mpt_verify(sysStruct, X0, Xf, N, U0, Options);
Allow terminal state and terminal set constraints for on-line MPC for MLD systems
On-line MPC controllers for MLD systems can now be instructed to obey
terminal point and terminal set constraints:
>> probStruct.xN = xN; % to use terminal point constraint
>> probStruct.Tset = Tset; % to use terminal set constraint
Allow time-varying penalties for on-line MPC problems for MLD systems
On-line MPC controllers for MLD systems can now use time-varying penalties
on states, inputs, outputs, d and z variables. To define a penalty
as being time-varying, simply assign it to a cell array:
>> probStruct.Q = {Q1, Q2, ..., Qn};
>> probStruct.R = {R1, R2, ..., Rn};
>> probStruct.Qy = {Qy1, Qy2, ..., Qyn};
>> probStruct.Qd = {Qd1, Qd2, ..., Qdn};
>> probStruct.Qz = {Qz1, Qz2, ..., Qzn};
Handle time-varying output penalties in explicit MPC for LTI systems
For explicit solutions for LTI systems, penalties on outputs can now be
time-varying by specifying probStruct.Qy
as a cell array:
>> probStruct.Qy = {Qy1, Qy2, ..., Qyn};
Other notable improvements and bugfixes
- do not reduce constraints in on-line MPC for LTI systems (leads
to significant speedup)
- vectorize code to improve set-up speed when looking for PWP
Lyapunov functions
- allow to pass initial guess of xopt and return full optimizers in
mpt_getInput
- fixed problems which caused annoying warnings under Matlab R12.1
- feasibility flag in
mpt_solveMPC
was not set properly for 1- and
Inf-norm problems
- fixed a problem where information about bounding boxes has been
lost if a polytope object was loaded from disk
- fixed problem with persistent variables, which caused craches
if 2 or more PWA2MLD translations are performed after each other
- compute proper mapping in
domain.m
if horizon
> 1
- properly close progress bar in hys2pwa.m
- use proper solver for 1/Inf-norm problems for LTI systems with
uncertainties
Acknowledgment
We are grateful to the following people for interesting comments and
feedback: Andrea G. Beccuti, Arne Linder, Arno van der Heijden, Hao Xia,
Jian Wan, J.S. Wang, Marcin Cychowski, Peter Ortner, Raphael Cagienard, Tina Paschedag.