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: This function is called by:
Generated on Thu 30-Mar-2006 10:26:47 by m2html © 2003