dynamic_system.hpp
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 
00034 #ifndef ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP
00035 #define ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP
00036 
00037 
00038 #include <acado/utils/acado_utils.hpp>
00039 #include <acado/function/function.hpp>
00040 
00041 
00042 BEGIN_NAMESPACE_ACADO
00043 
00044 
00057 class DynamicSystem
00058 {
00059         //
00060         // PUBLIC MEMBER FUNCTIONS:
00061         //
00062         public:
00063 
00066                 DynamicSystem( );
00067 
00072                  DynamicSystem( const DifferentialEquation& _diffEqn
00073                                                 );
00074 
00081                  DynamicSystem( const DifferentialEquation& _diffEqn,
00082                                                 const OutputFcn& _outputFcn
00083                                                 );
00084 
00089                 DynamicSystem(  const DynamicSystem &rhs
00090                                                 );
00091 
00094                 ~DynamicSystem( );
00095 
00100                 DynamicSystem& operator=(       const DynamicSystem& rhs
00101                                                                         );
00102 
00103 
00111                 returnValue addSubsystem(       const DifferentialEquation& _diffEqn
00112                                                                         );
00113 
00123                 returnValue addSubsystem(       const DifferentialEquation& _diffEqn,
00124                                                                         const OutputFcn& _outputFcn
00125                                                                         );
00126 
00127 
00134                 returnValue addSwitchFunction(  const Function& _switchFcn
00135                                                                                 );
00136 
00143                 returnValue setSelectFunction(  const Function& _selectFcn
00144                                                                                 );
00145 
00146 
00155                 inline returnValue getSubsystem(        uint stageIdx,
00156                                                                                         DifferentialEquation& _diffEqn,
00157                                                                                         OutputFcn& _outputFcn
00158                                                                                         ) const;
00159 
00166                 inline const DifferentialEquation& getDifferentialEquation(     uint stageIdx = 0
00167                                                                                                                                 ) const;
00168 
00175                 inline const OutputFcn& getOutputFcn(   uint stageIdx = 0
00176                                                                                 ) const;
00177 
00184                 inline returnValue getSwitchFunction(   uint idx,
00185                                                                                                 Function& _switchFcn
00186                                                                                                 ) const;
00187 
00194                 inline returnValue getSelectFunction(   Function& _selectFcn
00195                                                                                                 ) const;
00196 
00197 
00203                 inline BooleanType isODE( ) const;
00204 
00210                 inline BooleanType isDAE( ) const;
00211 
00212 
00218                 inline BooleanType isDiscretized( ) const;
00219 
00225                 inline BooleanType isContinuous( ) const;
00226 
00232                 inline double getSampleTime( ) const;
00233 
00234 
00239                 inline uint getNumDynamicEquations( ) const;
00240 
00245                 inline uint getNumAlgebraicEquations( ) const;
00246 
00251                 inline uint getNumOutputs( ) const;
00252 
00253 
00258                 inline uint getNumControls( ) const;
00259 
00264                 inline uint getNumParameters( ) const;
00265 
00270                 inline uint getNumDisturbances( ) const;
00271 
00272 
00277                 inline uint getNumSubsystems( ) const;
00278 
00283                 inline uint getNumSwitchFunctions( ) const;
00284 
00290                 inline BooleanType hasImplicitSwitches( ) const;
00291 
00292 
00293 
00294         //
00295         // PROTECTED MEMBER FUNCTIONS:
00296         //
00297         protected:
00298 
00307                 BooleanType isConsistentDiffEqn(        const DifferentialEquation& _diffEqn
00308                                                                                         ) const;
00309 
00318                 BooleanType isConsistentOutputFcn(      const OutputFcn& _outputFcn
00319                                                                                         ) const;
00320 
00321 
00322 
00323         //
00324         // DATA MEMBERS:
00325         //
00326         protected:
00327 
00328                 uint nDiffEqn;                                                  
00329                 uint nSwitchFcn;                                                
00331                 DifferentialEquation** diffEqn;                 
00332                 OutputFcn** outputFcn;                                  
00334                 Function** switchFcn;                                   
00335                 Function* selectFcn;                                    
00336 };
00337 
00338 
00339 CLOSE_NAMESPACE_ACADO
00340 
00341 
00342 
00343 #include <acado/dynamic_system/dynamic_system.ipp>
00344 
00345 
00346 #endif  // ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP
00347 
00348 
00349 /*
00350  *      end of file
00351  */


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