=============================================================================== Title: mpc_buildmatFAST.m Version: 2.0 Project: Control of MLD systems Sub-Project: Constrained Finite Time Optimal Control (CFTOC) of MLD systems Purpose: Formulate multi-parametric (mixed integer) program equivalent to the CFTOC problem of MLD system Author: (C) Mato Baotic, Zurich, March 17, 2003 (C) Michal Kvasnica, Zurich, June 23, 2005 History: date subject 2003.11.19 first public release 2003.07.29 fast implementation (static allocation of memory space) Tobias Geyer = Version 1.2 2003.03.18 Various bugs fixed = Version 1.1 2003.03.17 Initial Version = Version 1.0 Description: Given: horizon SYSTEM, WEIGHT, x1, u1, d1, z1, y1, eps2, xtt, Options Returns: S1, S2, S3, F1, F2, F3, c1, c2, c3, IntIndex The optimization for the control problem is formulated as: min v' S1 v + 2(S2 + x0' S3) v s.t. F1 v <= F2 + F3 x0 Here we denote: horizon - vector of time segments (steps) through which specific SYSTEM is used in state update equation. NT - prediction horizon [1, inf), NT=sum(horizon) SYSTEM - cell structure with MLD system descriptions: A, B1, B2, B3, B5, C, D1, D2, D3, D5, E1, E2, E3, E4, E5 Note: if input is not cell structure (but just a structure) then we have a time invariant system WEIGHT - cell structure with weights on u, d, z, x, y: Qu, Qd, Qz, Qx, Qy IntIndex - indices of integer variables in optimizer vector v v = [ U',D',Z',EU',ED',EZ',EX',EY']' U = [ u'(0), ... , u'(T-1)]' D = [ d'(0), ... , d'(T-1)]' Z = [ z'(0), ... , z'(T-1)]' EU = [ epsu'(0), ... , epsu'(T-1)]' ED = [ epsd'(0), ... , epsd'(T-1)]' EZ = [ epsz'(0), ... , epsz'(T-1)]' EX = [ epsx'(0), ... , epsx'(T-1)]' EY = [ epsy'(0), ... , epsy'(T-1)] The steady state values are: x1, d1, u1, z1, y1. These variables can also be time-varying trajectories. If the steady state values have not the length n_*NT (n_ is the corresponding number of components), then the last value of the steady state vector is repeated. The terminal state is given by xtt c1,c2,c3: parameters for the constant term of the optimization the complete constant term is obtained as: Jc = 0.5*x(0)'*c1*x(0) + c2*x(0) + c3 It is assumed, that the prediction horizon and the control horizon are the same Contact: Mato Baotic Automatic Control Laboratory ETH Zentrum, Zurich, Switzerland baotic@control.ee.ethz.ch Comments and bug reports are highly appreciated