liebouds_system.cpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.
00006  *    Developed within the Optimization in Engineering Center (OPTEC) under
00007  *    supervision of Moritz Diehl. All rights reserved.
00008  *
00009  *    ACADO Toolkit is free software; you can redistribute it and/or
00010  *    modify it under the terms of the GNU Lesser General Public
00011  *    License as published by the Free Software Foundation; either
00012  *    version 3 of the License, or (at your option) any later version.
00013  *
00014  *    ACADO Toolkit is distributed in the hope that it will be useful,
00015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  *    Lesser General Public License for more details.
00018  *
00019  *    You should have received a copy of the GNU Lesser General Public
00020  *    License along with ACADO Toolkit; if not, write to the Free Software
00021  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  */
00024 
00025 
00026 
00034 void liebouds_system( DifferentialEquation *f ){
00035 
00036     DifferentialState x("x",10,1);
00037 
00038     Control         u1, u2;
00039 
00040     DMatrix A0(10,10);
00041     A0.setZero();
00042 
00043     DMatrix A1(10,10);
00044     A1.setZero();
00045 
00046     DMatrix A2(10,10);
00047     A2.setZero();
00048 
00049     DMatrix A3(10,10);
00050     A3.setZero();
00051 
00052     DMatrix A4(10,10);
00053     A4.setZero();
00054 
00055     DVector b1(10), b2(10);
00056     b1.setZero();
00057     b2.setZero();
00058 
00059     // DEFINE THE MATRICES AND VECTORS:
00060     // --------------------------------
00061 
00062     A0(0,1) =  1.0;
00063     A0(1,1) = -1.0;
00064 
00065     A0(2,3) =  6.3;
00066     A0(3,3) = -71.4;
00067     A0(4,3) =  62.6;
00068     A0(5,3) = -91.1;
00069     A0(6,3) =  54.4;
00070     A0(7,3) = -126.5;
00071     A0(8,3) =  82.6;
00072     A0(9,3) = -228.4;
00073 
00074     A0(4,4) = -2000.0;
00075     A0(5,4) =  2000.0;
00076 
00077     A0(2,5) =  6.3;
00078     A0(3,5) =  0.0   ;
00079     A0(4,5) = -1882.6;
00080     A0(5,5) =  1662.3;
00081     A0(6,5) =  54.4;
00082     A0(7,5) = -126.5;
00083     A0(8,5) =  82.6;
00084     A0(9,5) = -228.4;
00085 
00086     A0(6,6) = -2000.0;
00087     A0(7,6) =  2000.0;
00088 
00089     A0(2,7) =  6.3;
00090     A0(3,7) =  0.0   ;
00091     A0(4,7) =  0.0   ;
00092     A0(5,7) =  0.0   ;
00093     A0(6,7) = -1888.9;
00094     A0(7,7) =  1589.4;
00095     A0(8,7) =  82.6;
00096     A0(9,7) = -228.4;
00097 
00098     A0(8,8) = -2000.0;
00099     A0(9,8) =  2000.0;
00100 
00101     A0(2,7) =  6.3;
00102     A0(3,7) =  0.0   ;
00103     A0(4,7) =  0.0   ;
00104     A0(5,7) =  0.0   ;
00105     A0(6,7) =  0.0   ;
00106     A0(7,7) =  0.0   ;
00107     A0(8,7) = -1834.4;
00108     A0(9,7) =  1303.4;
00109 
00110     A1(4,3) = -1.4597;
00111     A1(5,3) =  2.2015;
00112     A1(6,3) = -0.0238;
00113     A1(7,3) =  0.0306;
00114     A1(8,3) = -0.0072;
00115     A1(9,3) =  0.0106;
00116 
00117     A1(4,5) = -2.9068;
00118     A1(5,5) =  5.7267;
00119     A1(6,5) = -0.0238;
00120     A1(7,5) =  0.0306;
00121     A1(8,5) = -0.0072;
00122     A1(9,5) =  0.0106;
00123 
00124     A1(8,7) = -0.0072;
00125     A1(9,7) =  0.0106;
00126 
00127 
00128     A2(4,3) =  0.0129;
00129     A2(5,3) = -0.0206;
00130     A2(6,3) =  0.0002;
00131     A2(7,3) = -0.0003;
00132     A2(8,3) =  0.0001;
00133     A2(9,3) = -0.0001;
00134 
00135     A2(4,5) =  0.0284;
00136     A2(5,5) = -0.0448;
00137     A2(6,5) =  0.0002;
00138     A2(7,5) = -0.0003;
00139     A2(8,5) =  0.0001;
00140     A2(9,5) = -0.0001;
00141 
00142     A2(8,7) =  0.0001;
00143     A2(9,7) = -0.0001;
00144 
00145 
00146     A3(4,3) = -0.0497e-03;
00147     A3(5,3) =  0.0835e-03;
00148     A3(6,3) = -0.0009e-03;
00149     A3(7,3) =  0.0012e-03;
00150     A3(8,3) = -0.0003e-03;
00151     A3(9,3) =  0.0004e-03;
00152 
00153     A3(4,5) = -0.1225e-03;
00154     A3(5,5) =  0.1688e-03;
00155     A3(6,5) = -0.0009e-03;
00156     A3(7,5) =  0.0012e-03;
00157     A3(8,5) = -0.0003e-03;
00158     A3(9,5) =  0.0004e-03;
00159 
00160     A3(8,7) = -0.0003e-03;
00161     A3(9,7) =  0.0004e-03;
00162 
00163 
00164     A4(4,3) =  0.0691e-06;
00165     A4(5,3) = -0.1238e-06;
00166     A4(6,3) =  0.0014e-06;
00167     A4(7,3) = -0.0019e-06;
00168     A4(8,3) =  0.0004e-06;
00169     A4(9,3) = -0.0006e-06;
00170 
00171     A4(4,5) =  0.1936e-06;
00172     A4(5,5) = -0.2445e-06;
00173     A4(6,5) =  0.0014e-06;
00174     A4(7,5) = -0.0019e-06;
00175     A4(8,5) =  0.0004e-06;
00176     A4(9,5) = -0.0006e-06;
00177 
00178     A4(8,7) =  0.0004e-06;
00179     A4(9,7) = -0.0006e-06;
00180 
00181 
00182 
00183     b1(1) = 10.0  ;
00184     b2(3) = 2000.0;
00185 
00186     IntermediateState rho  = x(0)    ;
00187     IntermediateState rho2 = rho*rho ;
00188     IntermediateState rho3 = rho2*rho;
00189     IntermediateState rho4 = rho3*rho;
00190 
00191 
00192     // Define the Right-Hand-Side:
00193     // ---------------------------
00194 
00195     *f << dot(x) == ( A0 + A1*rho + A2*rho2 + A3*rho3 + A4*rho4 )*x - b1*u1 - b2*u2;
00196 }
00197 
00198 
00199 


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:59:02