Hybrid Identification Toolbox [HIT], link [not maintained]
Multi-Parametric Toolbox [MPT], link [none native support]
SARXSAT, tool for identifying ARX (autoregressive models with exogenous inputs) and piecewise ARX, Github repo
HySynth, synthesis of hybrid automata from data, Github repo [recent]
Predictor Based Subspace IDentification (PBSID) Toolbox, Github repo
Suggested literature:
-
Paoletti, S., Juloski, A.L., Ferrari-Trecate, G., Vidal, R.: Identification of hybrid systems: A tutorial. Eur. J. Control 13(2-3), 242–260 (2007), https://doi.org/10. 3166/ejc.13.242-260
-
Ozay, N.: An exact and efficient algorithm for segmentation of ARX models. In: ACC. pp. 38–41. IEEE (2016), https://doi.org/10.1109/ACC.2016.7524888
-
Synthesis of Hybrid Automata with Affine Dynamics from Time-Series Data https://arxiv.org/pdf/2102.12734.pdf
-
Download HIT from the official website. I also backed up the files here.
-
Unzip HIT and add it to the Matlab path. You can do it via right-click on the root folder and choose
Add files to path
andSelect Folders and Subfolders
or viaaddpath(genpath(...))
.Adding HIT to the path is needed everytime you open Matlab and want to use HIT. You can use
savepath
command or modifystartup.m
or change the environment variableMATLABPATH
if you want to store the path indefinitely. Useful link: 1 -
Download MPT version 3 from the offical website. The website provides an installation manual. The easiest option is to opt for the automatic installation option and download the file install_mpt3.m. I have backed up the file here.
-
Run the
install_mpt.m
from Matlab and choose the directory where you want to place MPT.The MPT files are added to the path automatically, everytime you open Matlab.
-
Run
mpt_init.m
to initialize MPT and check the tool status (e.g. available or missing solvers).Note that we want to run the files located in `hit/examples/`
-
Find and open the files
hit/hit_init.m
andhit/plotting/hit_plot_regions3D.m
. Replace the global variablemptoptions
byMPTOPTIONS
. -
Again go to
hit_plot_regions3D.m
and delete or comment out the lines 70-72 (an if-then statement that uses the extreme solver). This option is deprecated in MPT version 3. Also, replace line 74Options.newfigure=MPTOPTIONS.newfigure;
byOptions.newfigure=1
; -
Change the default solver for quadratic programming problems in MPT.
- Run
which quadprog -all
- If the answer is something like
/Applications/MATLAB_R2022a.app/toolbox/optim/optim/quadprog.m
, then find and open the filempt_solvers_options.m
.
It should be somewhere like
tbxmanager/toolboxes/mpt/3.2.1/all/mpt3-3_2_1/mpt/modules/solvers/mpt_solvers_options.m
-
Search for the following lines (~lines 588-589):
options.quadprog.Algorithm = 'trust-region-reflective’;
%options.quadprog.Algorithm = 'interior-point-convex’;
-
Comment out the first one and uncomment the second one.
-
Save the file and re-run
mpt_init.m
- Run
-
Edit
examples/ex_pwarx_1d_5modes.m
and change line 94 fromidpar.patt_rec_algo='svc';
to
idpar.patt_rec_algo='psvc';
-
Now you should be able to run all the models/examples located in
examples/
- Original model: Mathworks' nonlinear MPC for a flying robot
- Run the data generation part of our FlyingRobot_model. You can use the pregenerated data stored as a .mat file.
- In our case, we have an identification problem and we start from a collection of inputs-outputs. Our input is
$X$ eight-dimensional and our output is$U$ which is two-dimensional. - HIT works for single outputs so we need to split the problem into two: going from
$X$ ->$U_1$ and from$X$ ->$U_2$. - Need to modify
ex_cake_1.m
to match our case. It seems that you need to choose the number of PWA regions beforehand. - to be continued.