Home > mpt > mpt_lyapunov.m

# mpt_lyapunov

## PURPOSE

MPT_LYAPUNOV Computes a Lapunov-type function for a given explicit controller

## SYNOPSIS

function ctrl = mpt_lyapunov(ctrl, funtype, ndeg, Options)

## DESCRIPTION

```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 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:
'sos'  - sum of squares lyapunov function
'pwa'  - piecewise-affine lyapunov function
'pwp'  - piecewise-polynomial lyapunov function
ndeg     - degree of piecewise-polynomial lyapunov function(should be even)
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

## CROSS-REFERENCE INFORMATION

This function calls:
• isexplicit ISEXPLICIT Returns true if the controller is an explicit controller
• mptctrl MPTCTRL Constructor for the MPT controller object
• end END Returns the last element in a given polytope array
• mpt_getCommonSOSLyapFct MPT_GETCOMMONSOSLYAPFCT Calculates Common SOS Lyapunov function for system with additive disturbance
• mpt_getPWALyapFct MPT_GETPWALYAPFCT Calculates PWA Lyapunov function
• mpt_getPWPLyapFct MPT_GETPWPLYAPFCT Calculates Piecewise Polynomial (sum of squares) Lyapunov function
• mpt_getPWQLyapFct MPT_GETPWQLYAPFCT Calculates PWQ Lyapunov function