integrator_runge_kutta78.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-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00027 
00034 #include <acado/utils/acado_utils.hpp>
00035 #include <acado/matrix_vector/matrix_vector.hpp>
00036 #include <acado/symbolic_expression/symbolic_expression.hpp>
00037 #include <acado/function/function_.hpp>
00038 #include <acado/function/differential_equation.hpp>
00039 #include <acado/integrator/integrator.hpp>
00040 #include <acado/integrator/integrator_runge_kutta.hpp>
00041 #include <acado/integrator/integrator_runge_kutta78.hpp>
00042 
00043 
00044 
00045 
00046 BEGIN_NAMESPACE_ACADO
00047 
00048 
00049 //
00050 // PUBLIC MEMBER FUNCTIONS:
00051 //
00052 
00053 IntegratorRK78::IntegratorRK78( )
00054                :IntegratorRK(13,0.1428571428571428571){
00055 
00056     if( A != 0 ) initializeButcherTableau();
00057 }
00058 
00059 IntegratorRK78::IntegratorRK78( const DifferentialEquation &rhs_ )
00060                :IntegratorRK(rhs_,13,0.1428571428571428571){
00061 
00062     if( A != 0 ) initializeButcherTableau();
00063 }
00064 
00065 IntegratorRK78::IntegratorRK78( const IntegratorRK78& arg )
00066                :IntegratorRK(arg){ }
00067 
00068 IntegratorRK78::~IntegratorRK78( ){ }
00069 
00070 IntegratorRK78& IntegratorRK78::operator=( const IntegratorRK78& arg ){
00071 
00072     if( this != &arg ){
00073         IntegratorRK::operator=(arg);
00074     }
00075     return *this;
00076 }
00077 
00078 Integrator* IntegratorRK78::clone() const{
00079 
00080     return new IntegratorRK78(*this);
00081 }
00082 
00083 
00084 void IntegratorRK78::initializeButcherTableau(){
00085 
00086     A[0][ 0] = 0.0;
00087     A[0][ 1] = 0.0;
00088     A[0][ 2] = 0.0;
00089     A[0][ 3] = 0.0;
00090     A[0][ 4] = 0.0;
00091     A[0][ 5] = 0.0;
00092     A[0][ 6] = 0.0;
00093     A[0][ 7] = 0.0;
00094     A[0][ 8] = 0.0;
00095     A[0][ 9] = 0.0;
00096     A[0][10] = 0.0;
00097     A[0][11] = 0.0;
00098     A[0][12] = 0.0;
00099 
00100     A[1][ 0] = 1.0/18.0;
00101     A[1][ 1] = 0.0;
00102     A[1][ 2] = 0.0;
00103     A[1][ 3] = 0.0;
00104     A[1][ 4] = 0.0;
00105     A[1][ 5] = 0.0;
00106     A[1][ 6] = 0.0;
00107     A[1][ 7] = 0.0;
00108     A[1][ 8] = 0.0;
00109     A[1][ 9] = 0.0;
00110     A[1][10] = 0.0;
00111     A[1][11] = 0.0;
00112     A[1][12] = 0.0;
00113 
00114     A[2][ 0] = 1.0/48.0;
00115     A[2][ 1] = 1.0/16.0;
00116     A[2][ 2] = 0.0;
00117     A[2][ 3] = 0.0;
00118     A[2][ 4] = 0.0;
00119     A[2][ 5] = 0.0;
00120     A[2][ 6] = 0.0;
00121     A[2][ 7] = 0.0;
00122     A[2][ 8] = 0.0;
00123     A[2][ 9] = 0.0;
00124     A[2][10] = 0.0;
00125     A[2][11] = 0.0;
00126     A[2][12] = 0.0;
00127 
00128     A[3][ 0] = 1.0/32.0;
00129     A[3][ 1] = 0.0;
00130     A[3][ 2] = 3.0/32.0;
00131     A[3][ 3] = 0.0;
00132     A[3][ 4] = 0.0;
00133     A[3][ 5] = 0.0;
00134     A[3][ 6] = 0.0;
00135     A[3][ 7] = 0.0;
00136     A[3][ 8] = 0.0;
00137     A[3][ 9] = 0.0;
00138     A[3][10] = 0.0;
00139     A[3][11] = 0.0;
00140     A[3][12] = 0.0;
00141 
00142     A[4][ 0] = 5.0/16.0;
00143     A[4][ 1] = 0.0;
00144     A[4][ 2] = -75.0/64.0;
00145     A[4][ 3] = 75.0/64.0;
00146     A[4][ 4] = 0.0;
00147     A[4][ 5] = 0.0;
00148     A[4][ 6] = 0.0;
00149     A[4][ 7] = 0.0;
00150     A[4][ 8] = 0.0;
00151     A[4][ 9] = 0.0;
00152     A[4][10] = 0.0;
00153     A[4][11] = 0.0;
00154     A[4][12] = 0.0;
00155 
00156     A[5][ 0] = 3.0/80.0;
00157     A[5][ 1] = 0.0;
00158     A[5][ 2] = 0.0;
00159     A[5][ 3] = 3.0/16.0;
00160     A[5][ 4] = 3.0/20.0;
00161     A[5][ 5] = 0.0;
00162     A[5][ 6] = 0.0;
00163     A[5][ 7] = 0.0;
00164     A[5][ 8] = 0.0;
00165     A[5][ 9] = 0.0;
00166     A[5][10] = 0.0;
00167     A[5][11] = 0.0;
00168     A[5][12] = 0.0;
00169 
00170     A[6][ 0] = 29443841.0/614563906.0;
00171     A[6][ 1] = 0.0;
00172     A[6][ 2] = 0.0;
00173     A[6][ 3] = 77736538.0/692538347.0;
00174     A[6][ 4] = -28693883.0/1125000000.0;
00175     A[6][ 5] = 23124283.0/1800000000.0;
00176     A[6][ 6] = 0.0;
00177     A[6][ 7] = 0.0;
00178     A[6][ 8] = 0.0;
00179     A[6][ 9] = 0.0;
00180     A[6][10] = 0.0;
00181     A[6][11] = 0.0;
00182     A[6][12] = 0.0;
00183 
00184     A[7][ 0] = 16016141.0/946692911.0;
00185     A[7][ 1] = 0.0;
00186     A[7][ 2] = 0.0;
00187     A[7][ 3] = 61564180.0/158732637.0;
00188     A[7][ 4] = 22789713.0/633445777.0;
00189     A[7][ 5] = 545815736.0/2771057229.0;
00190     A[7][ 6] = -180193667.0/1043307555.0;
00191     A[7][ 7] = 0.0;
00192     A[7][ 8] = 0.0;
00193     A[7][ 9] = 0.0;
00194     A[7][10] = 0.0;
00195     A[7][11] = 0.0;
00196     A[7][12] = 0.0;
00197 
00198     A[8][ 0] = 39632708.0/573591083.0;
00199     A[8][ 1] = 0.0;
00200     A[8][ 2] = 0.0;
00201     A[8][ 3] = -433636366.0/683701615.0;
00202     A[8][ 4] = -421739975.0/2616292301.0;
00203     A[8][ 5] = 100302831.0/723423059.0;
00204     A[8][ 6] = 790204164.0/839813087.0;
00205     A[8][ 7] = 800635310.0/3783071287.0;
00206     A[8][ 8] = 0.0;
00207     A[8][ 9] = 0.0;
00208     A[8][10] = 0.0;
00209     A[8][11] = 0.0;
00210     A[8][12] = 0.0;
00211 
00212     A[9][ 0] = 246121993.0/1340847787.0;
00213     A[9][ 1] = 0.0;
00214     A[9][ 2] = 0.0;
00215     A[9][ 3] = -37695042795.0/15268766246.0;
00216     A[9][ 4] = -309121744.0/1061227803.0;
00217     A[9][ 5] = -12992083.0/490766935.0;
00218     A[9][ 6] = 6005943493.0/2108947869.0;
00219     A[9][ 7] = 393006217.0/1396673457.0;
00220     A[9][ 8] = 123872331.0/1001029789.0;
00221     A[9][ 9] = 0.0;
00222     A[9][10] = 0.0;
00223     A[9][11] = 0.0;
00224     A[9][12] = 0.0;
00225 
00226     A[10][ 0] = -1028468189.0/846180014.0;
00227     A[10][ 1] = 0.0;
00228     A[10][ 2] = 0.0;
00229     A[10][ 3] = 8478235783.0/508512852.0;
00230     A[10][ 4] = 1311729495.0/1432422823.0;
00231     A[10][ 5] = -10304129995.0/1701304382.0;
00232     A[10][ 6] = -48777925059.0/3047939560.0;
00233     A[10][ 7] = 15336726248.0/1032824649.0;
00234     A[10][ 8] = -45442868181.0/3398467696.0;
00235     A[10][ 9] = 3065993473.0/597172653.0;
00236     A[10][10] = 0.0;
00237     A[10][11] = 0.0;
00238     A[10][11] = 0.0;
00239 
00240     A[11][ 0] = 185892177.0/718116043.0;
00241     A[11][ 1] = 0.0;
00242     A[11][ 2] = 0.0;
00243     A[11][ 3] = -3185094517.0/667107341.0;
00244     A[11][ 4] = -477755414.0/1098053517.0;
00245     A[11][ 5] = -703635378.0/230739211.0;
00246     A[11][ 6] = 5731566787.0/1027545527.0;
00247     A[11][ 7] = 5232866602.0/850066563.0;
00248     A[11][ 8] = -4093664535.0/808688257.0;
00249     A[11][ 9] = 3962137247.0/1805957418.0;
00250     A[11][10] = 65686358.0/487910083.0;
00251     A[11][11] = 0.0;
00252     A[11][12] = 0.0;
00253 
00254     A[12][ 0] = 403863854.0/491063109.0;
00255     A[12][ 1] = 0.0;
00256     A[12][ 2] = 0.0;
00257     A[12][ 3] = -5068492393.0/434740067.0;
00258     A[12][ 4] = -411421997.0/543043805.0;
00259     A[12][ 5] = 652783627.0/914296604.0;
00260     A[12][ 6] = 11173962825.0/925320556.0;
00261     A[12][ 7] = -13158990841.0/6184727034.0;
00262     A[12][ 8] = 3936647629.0/1978049680.0;
00263     A[12][ 9] = -160528059.0/685178525.0;
00264     A[12][10] = 248638103.0/1413531060.0;
00265     A[12][11] = 0.0;
00266     A[12][12] = 0.0;
00267 
00268 
00269 
00270     b4[ 0] = 14005451.0/335480064.0;
00271     b4[ 1] = 0.0;
00272     b4[ 2] = 0.0;
00273     b4[ 3] = 0.0;
00274     b4[ 4] = 0.0;
00275     b4[ 5] = -59238493.0/1068277825.0;
00276     b4[ 6] = 181606767.0/758867731.0;
00277     b4[ 7] = 561292985.0/797845732.0;
00278     b4[ 8] = -1041891430.0/1371343529.0;
00279     b4[ 9] = 760417239.0/1151165299.0;
00280     b4[10] = 118820643.0/751138087.0;
00281     b4[11] = -528747749.0/2220607170.0;
00282     b4[12] = 1.0/4.0;
00283 
00284     b5[ 0] = 13451932.0/455176623.0;
00285     b5[ 1] = 0.0;
00286     b5[ 2] = 0.0;
00287     b5[ 3] = 0.0;
00288     b5[ 4] = 0.0;
00289     b5[ 5] = -808719846.0/976000145.0;
00290     b5[ 6] = 1757004468.0/5645159321.0;
00291     b5[ 7] = 656045339.0/265891186.0;
00292     b5[ 8] = -3867574721.0/1518517206.0;
00293     b5[ 9] = 465885868.0/322736535.0;
00294     b5[10] = 53011238.0/667516719.0;
00295     b5[11] = 2.0/45.0;
00296     b5[12] = 0.0;
00297 
00298     c[ 0] = 0.0;
00299     c[ 1] = 1.0/18.0;
00300     c[ 2] = 1.0/12.0;
00301     c[ 3] = 1.0/8.0;
00302     c[ 4] = 5.0/16.0;
00303     c[ 5] = 3.0/8.0;
00304     c[ 6] = 59.0/400.0;
00305     c[ 7] = 93.0/200.0;
00306     c[ 8] = 5490023248.0/9719169821.0;
00307     c[ 9] = 13.0/20.0;
00308     c[10] = 1201146811.0/1299019798.0;
00309     c[11] = 1.0;
00310     c[12] = 1.0;
00311 }
00312 
00313 CLOSE_NAMESPACE_ACADO
00314 
00315 // end of file.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:37:27