Home > mpt > extras > analysis > mpt_getPWPLyapFct.m

# mpt_getPWPLyapFct

## PURPOSE

MPT_GETPWPLYAPFCT Calculates Piecewise Polynomial (sum of squares) Lyapunov function

## SYNOPSIS

function [dQ,feasible,drho,runtime]=mpt_getPWPLyapFct(ctrl,ndeg,Options)

## DESCRIPTION

```MPT_GETPWPLYAPFCT Calculates Piecewise Polynomial (sum of squares) Lyapunov function

[dQ,feasible,drho]=mpt_getPWPLyapFct(ctrl,ndeg,Options)

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
This function attempts to compute a piecewise higher order Sum of Squares Lyapunov function
using YALMIP which guarantees exponential stability. The following is satisfied
alpha * x^2 <= V(x(k))<= beta * x^2
V(x(k+1)) - V(x(k))<= - rho * x^2
(alpha,beta,rho>=0)

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
ctrl                        - Explicit controller (EXPCTRL object)
ndeg                        - Degree of Lyapunov Function(should be even)

Options.debug_level  - If this is set to 1, the solution provided by the LMI
solver will be double-checked manually via SDP. We
strongly advise to set this to 1, since we've experienced
numerous numerical issues with certain LMI solvers.
If this value is set to 2, an additional check via
state trajectories will be performed.
Options.enforcePositivity   - If set to zero, positivity constraints for PWQ
function are not included in LMI (reduces
constraints and computation time) Post
computation verification is performed to check
if postivity holds. If not, positivity
constraints are added and solution recomputed.
Options.abs_tol      - Absolute tolerance
Options.lpsolver     - Which LP solver to use (see help mpt_solveLP for details)
Options.epsilon      - This is a tolerance factor which is introduced to turn
LMI inequalities into strict inequalities.
scaled Lyapunov function. There is no benefit in this
apart from getting nicer plots afterwards. Therefore
this is switched off by default
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.

Note: If Options is missing or some of the fields are not defined, the default
values from mptOptions will be used

---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
dQ         - cell array of coefficients of Lyapunov polytope
In order to see the output polynomial in a "nice" way, proceed as follows:
x1=sdpvar(1,1), x2=sdpvar(1,1), ... , xn=sdpvar(1,1)
xmon=monolist([x1 x2 ... xn], ndeg);
sdisplay(dQ{i}'*xmon)

feasible   - 1: stable or 0: no statement about stability possible
drho       - the maximum Lyapunov decay rate over the partition
(is this is greater than zero, stability cannot be guaranteed)
The Lyapunov value decrease Delta V <= drho * ||x||^2
runtime    - structure that stores "setup_time", "solver_time" and "postproc_time"

## CROSS-REFERENCE INFORMATION

This function calls:
• isexplicit ISEXPLICIT Returns true if the controller is an explicit controller
• isinvariant ISINVARIANT Decides if a given explicit controller is invariant
• length LENGTH Returns number of regions over which the explicit control law is defined
• runtime RUNTIME returns runtime needed to compute a given explicit controller
• set SET Set a field of MPTCTRL objects
• bounding_box BOUNDING_BOX Compute a bounding box for a given polytope
• chebyball CHEBYBALL Computes center and radius of the largest ball inscribed in a polytope
• dimension DIMENSION Returns dimension of the given polytope
• domain DOMAIN Computes polytope that is mapped to an another polytope using affine map
• double DOUBLE Function used to access internal properties of the given polytope
• end END Returns the last element in a given polytope array
• isfulldim ISFULLDIM Checks if a polytope is full dimensional
• isinside ISINSIDE Checks if a given point lies in the interior of a given polytope
• length LENGTH Returns number of elements in a polytope array
• mldivide MLDIVIDE Set difference
• nconstr NCONSTR Returns number of constraints that form an H-representation of a polytope
• polytope POLYTOPE Default constructor for the POLYTOPE object
• set SET Used to modify internal properties of a given polytope object
• size SIZE Returns size of the given polytope object
• mpt_checkLyapFct MPT_CHECKLYAPFCT Checks if a function is a Lyapunov function for a given ctrlStruct
• mpt_transmap MPT_TRANSMAP Computes transition map
• mpt_error MPT_ERROR Function called if MPT toolbox is not initialized
• mpt_isnoise MPT_ISNOISE Checks if noise object is not empty
• mpt_verifySysStruct MPT_VERIFYSYSSTRUCT Verifies the sysStruct structure
This function is called by:
• mpt_lyapunov MPT_LYAPUNOV Computes a Lapunov-type function for a given explicit controller

Generated on Thu 30-Mar-2006 10:26:47 by m2html © 2003