


MPT_LYAPUNOV Computes a Lapunov-type function for a given explicit controller
ctrl = mpt_lyapunov(ctrl, functiontype)
ctrl = mpt_lyapunov(ctrl, functiontype, ndeg)
ctrl = mpt_lyapunov(ctrl, functiontype, Options)
ctrl = mpt_lyapunov(ctrl, functiontype, ndeg, Options)
---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
Computes a Lyapunov function for a given explicit controller (if one exists).
Three types of Lyapunov functions are supported:
* Common Quadratic Lyapunov Function (funtype = 'quad')
* Common Sum of Squares Lyapunov Function (funtype = 'sos')
* Piecewise-Affine Lyapunov Function (funtype = 'pwa')
* Piecewise-Quadratic Lyapunov Function (funtype = 'pwq')
* Piecewise-Polynomial Lyapunov Function (funtype = 'pwp')
NOTE: This function is NOT available for on-line controllers.
---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
ctrl - explicit controller (an MPTCTRL object)
funtype - type of lyapunov function to compute. valid options are:
'quad' - quadratic lyapunov function
'sos' - sum of squares lyapunov function
'pwa' - piecewise-affine lyapunov function
'pwq' - piecewise-quadratic lyapunov function
'pwp' - piecewise-polynomial lyapunov function
ndeg - degree of piecewise-polynomial lyapunov function(should be even)
Options - additional options (see help mpt_getQuadLyapFct, mpt_getPWALyapFct,
mpt_getCommonSOSLyapFct and mpt_getPWQLyapFct for more details)
Options.useTmap - If set to true (default), transition map will
be computed to rule out certain transitions
Options.sphratio - Gives factor which governs maximum number of separating
hyperplanes computed in transition maps. Number of
separating hyperplnaes computed at each step is given
by length(Pn)^2 / Options.ratio
Default value is 20.
Set this option to 0 if you don't want to impose any
limit on number of separating hyperplanes. The higher
the value of this parameter is, the less separating
hyperplanes will be computed, resulting in (possibly)
less efficiency.
---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
ctrl - updated controller with Lyapunov function stored in
ctrl.details.lyapunov
see also MPT_GETQUADLYAPFCT, MPT_GETPWQLYAPFCT, MPT_GETPWALYAPFCT