Home > mpt > extras > control > mpt_constructMatrices.m

# mpt_constructMatrices

## PURPOSE

MPT_CONSTRUCTMATRICES Constructs matrices for the finite time constrained optimal control problem

## SYNOPSIS

function [G,W,E,H,F,Y,Cf,Cx,Cc,symmetric,bndA,bndb,Pinvset]=mpt_constructMatrices(sysStruct,probStruct,Options,setHorizon)

## DESCRIPTION

MPT_CONSTRUCTMATRICES Constructs matrices for the finite time constrained optimal control problem

[G,W,E,H,F,Y,Cf,Cx,Cc,symmetric,bndA,bndb,Pinvset]=
mpt_constructMatrices(sysStruct,probStruct,Options,setHorizon)

[Matrices]=mpt_constructMatrices(sysStruct,probStruct,Options,setHorizon)

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
Constructs cost and constraint matrices for the finite time constrained
optimal control problems for linear and PWA systems as a function of the
prediction horizon "horizon".

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
sysStruct        - System structure in the sysStruct format
Dynamics:       x(k+1)=Ax(k)+Bu(k)+f
y(k)=Cx(k)+Du(k)
Constraints:    ymin  <=    y(k)     <= ymax
umin  <=    u(k)     <= umax
dumin <= u(k)-u(k+1) <=dumax
Uncertainty:    Either polytopic ("Aunc", "Bunc") or
additive "noise". All constraints will be
enforced for the uncertain system.

Consult the MPT manual for additional details

probStruct       - Problem structure in the probStruct format
NORM=2
R,Q - Objective:    min J=x'(t+N_y|t) P x(t+N_y|t) +
\sum_{k=0}^N_y-1  x'(t+k|t) Q x(t+k|t) + u'(t+k) R u(t+k)
NORM=1
R,Q - Objective:    min J=  ||P x(t+N_y|t)||_1 +
\sum_{k=0}^N_y-1  ||Q x(t+k|t)||_1 + ||R u(t+k)||_1
NORM=Inf
R,Q - Objective:    min J=  ||P x(t+N_y|t)||_Inf +
\sum_{k=0}^N_y-1   ||Q x(t+k|t)||_Inf + ||R u(t+k)||_Inf

- horizon
Prediction horizon N; How many time steps are considered.

- Tset
Terminal set constraint: For the final state x_N the
following must hold: Tset.H * x_N <= Tset.K; If the system
is subject to uncertainty, the terminal set constraint is
automatically "robustified";

- Qy
If a weight Qy is specified, then the cost will be on the output (y(k)'Qy(k))
and not on the state (x(k)'Qx(k)) for the optimization problem at hand
(see Problem structure above).

Options.includeLQRset
If set to 1 and probStruct.Tconstraint==1, the LQR target set around
the origin will be computed and added to the matrices
Options.noNoiseOnTset
If set to 1 the set constraint is not robustified with respect
to additive noise. This is only relevant if robust controllers
for PWA systems are computed. For those problems the Tset is
"robustified" outside of this function. Default 0;
Options.lpsolver
Solver for LPs (see help mpt_solveLP for details)
Options.verbose
Level of verbosity (see help mpt_init for details)
Options.abs_tol
absolute tolerance

setHorizon
Time step at which the terminal set constraint Tset is
enforced. This is equal to the prediction horizon by default.

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

---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------

NORM=2
------

G,W,E,H,F,Y,Cf,Cx,Cc  - matrices of the problem, i.e.

J=min_U  (0.5 U' H U + (x(0)' F + Cf) U + x(0) Y x(0) + Cx x + Cc)
G U <= W + E x(0)

symmetric   0/1 if constraints are symmetric

Note: The elements Cf, Cx, Cc will be zero if the affine dynamics
"f" are zero (x+=Ax+Bu+f).

NORM=1 / Infinity
------
G,W,E,H,F  - matrices of the problem, i.e.

J=min_U   H U + Fx
G U <= W + E x(0)

symmetric   0/1 if constraints are symmetric

Note: in order to compute these problems slack variables epsilon are introduced.
Therefore, the optimizer U will actually be [U epsilon]. The first
(no. Inputs * prediction Horzion) elemenst correspond to the input

## CROSS-REFERENCE INFORMATION

This function calls:
• length LENGTH Returns number of regions over which the explicit control law is defined
• 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
• length LENGTH Returns number of elements in a polytope array
• polytope POLYTOPE Default constructor for the POLYTOPE object
• size SIZE Returns size of the given polytope object
• unique UNIQUE Removes redundant entries from a polytope array
• mpt_infset MPT_INFSET Calculates the maximal positively invariant set for an LTI system
• mpt_dlqr MPT_DLQR Linear-quadratic regulator design for discrete-time systems.
• mpt_error MPT_ERROR Function called if MPT toolbox is not initialized
• mpt_evalSystem MPT_EVALSYSTEM Extracts data from sysStruct and probStruct structures
• mpt_isnoise MPT_ISNOISE Checks if noise object is not empty
• mpt_solveLPi MPT_SOLVELPi Interface to various LP solvers (version without errorchecks)
• mpt_verifyProbStruct MPT_VERIFYPROBSTRUCT Verifies the probStruct structure
• mpt_verifySysStruct MPT_VERIFYSYSSTRUCT Verifies the sysStruct structure
This function is called by:
• mptctrl MPTCTRL Constructor for the MPT controller object
• mpt_maxCtrlSet MPT_MAXCTRLSET Computes the maximal robust control invariant set C_inf
• mpt_optControlPWAold MPT_OPTCONTROLPWA Solves the CFTOC problem for a given PWA system
• mpt_iterative MPT_ITERATIVE Computes a time-optimal or low-complexity explicit controller for LTI systems
• mpt_iterativePWA MPT_ITERATIVEPWA Computes a time-optimal or low-complexity explicit controller for PWA systems
• mpt_mixedMinTime MPT_MIXEDMINTIME Computes minimum time controller for systems with discrete and continuous inputs
• mpt_optBoolCtrl MPT_OPTBOOLCTRL Computes optimal controller for systems with discrete inputs
• mpt_optControl MPT_OPTCONTROL Solves the CFTOC problem for a given LTI system
• mpt_optControlPWA MPT_OPTCONTROLPWA Solves the CFTOC problem for a given PWA system
• mpt_optInfControl MPT_OPTINFCONTROL Solves the infinite-time constrained optimal control problem for LTI systems
• mpt_optInfControlPWA MPT_OPTINFCONTROLPWA Solves the infinite-time constrained optimal control problem for PWA systems
• mpt_optMixedCtrl MPT_OPTMIXEDCTRL Computes optimal controller for systems discrete and continuous inputs
• mpt_simplexContr MPT_SIMPLEXCONTR Computes a piecewise affine feedback law defined over simplices
• mpt_solveMPC MPT_SOLVEMPC Solves the on line optimization MPC problem

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