Home > mpt > @mptctrl > mptctrl.m

mptctrl

PURPOSE ^

MPTCTRL Constructor for the MPT controller object

SYNOPSIS ^

function ctrl = mptctrl(varargin)

DESCRIPTION ^

MPTCTRL Constructor for the MPT controller object

 ctrl = mptctrl(ctrlStruct)
 ctrl = mptctrl(sysStruct, probStruct)

 ---------------------------------------------------------------------------
 DESCRIPTION
 ---------------------------------------------------------------------------

 Creates an MPT controller object. The controller can represent both an
 explicit control law (i.e. a Piecewise-Affine feedback law defined over a
 polyhedral partition of a state-space), or an implicit controller (i.e. an MPC
 controller where the optimization problem is being solved at every time step
 for current measurements of the states).

 USAGE:

   ctrl = mptctrl(ctrlStruct)

     If called with one input parameter, the input is assumed to be a
     controller structure, as defined in the MPT manual. The output will then
     be an explicit controller.

   ctrl = mptctrl(sysStruct, probStruct)

     If called with two input parameters, creates an on-line controller.

 ---------------------------------------------------------------------------
 REPRESENTATION OF CONTROLLERS
 ---------------------------------------------------------------------------

 Each MPTCTRL object is internally represented as a structure with following
 fields:

   .type        - type of the controller {'explicit' | 'online'}
   .sysStruct   - system structure
   .probStruct  - problem structure
   .Pn          - polyhedral partition over which the explicit controller is
                  defined (POLYTOPE object)
   .Pfinal      - feasible set of the controller, i.e. set of states for which
                  there exists a control law (POLYTOPE object) 

   .Fi          - if the given state "x" is in region Pn(i), the associated
   .Gi          /    control law is given by U = Fi{i}*x + Gi{i}

   .Ai          \
   .Bi          - value of the objective function at point 'x' is given by
   .Ci          /    J = x'*Ai{i}*x + Bi{i}*x + Ci{i}

   .dynamics    - a vector which associates dynamics of a PWA system to a given
                     region of controller parition. 
   .details     - additional details about the solution
   .overlaps    - binary flag, takes a "true" value if regions of the
                     controller partition overlap, "false" otherwise
   .simplified  - binary flag, takes a "true" value if regions of the
                     controller partition have been simplified using greedy or
                     optimal merging, "false" otherwise 


 ---------------------------------------------------------------------------
 ACCESING INTERNAL DATA OF A CONTROLLER OBJECT
 ---------------------------------------------------------------------------

 Even though the MPT controller is represented as an object, it's fields can
 still be accessed as it were a structure. That means that you can do, for
 instance, the following:

   ctrl.Pn
   ctrl.details

 and so on. There are also couple of short-cut functions defined to quickly
 access important fields:

 nR = length(ctrl)    - returns number of regions of the controller partition
 time = runtime(ctrl) - returns runtime
 isexplicit(ctrl)     - returns 1 if the controller is an explicit one, 0 if it
                          is an on-line controller

 ---------------------------------------------------------------------------
 INPUT
 ---------------------------------------------------------------------------
 either: 
   ctrlStruct  - valid controller structure (see manual for more details)

 or:
   sysStruct   - valid system structure
   probStruct  - valid problem structure

 ---------------------------------------------------------------------------
 OUTPUT                                                                                                    
 ---------------------------------------------------------------------------
 ctrl          - an MPTCTRL object


 see also MPTCTRL/ANALYZE, MPTCTRL/ISEXPLICIT, MPTCTRL/LENGTH, MPTCTRL/PLOT

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Thu 30-Mar-2006 10:26:47 by m2html © 2003