ellipsoidal_integrator.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
27 
34 #ifndef ACADO_TOOLKIT_ELLIPSOIDAL_INTEGRATOR_HPP
35 #define ACADO_TOOLKIT_ELLIPSOIDAL_INTEGRATOR_HPP
36 
37 #include <iostream>
38 #include <iomanip>
39 #include <acado/clock/clock.hpp>
47 
48 
50 
51 
61 {
62 
63  public:
64 
67 
73  EllipsoidalIntegrator( const DifferentialEquation &rhs_, const int &N_ = 3 );
74 
77 
79  virtual ~EllipsoidalIntegrator( );
80 
83 
84 
85 
86 
87  Tmatrix<Interval> integrate( double t0, double tf, int M, const Tmatrix<Interval> &x );
88 
89  Tmatrix<Interval> integrate( double t0, double tf, int M, const Tmatrix<Interval> &x, const Tmatrix<Interval> &p );
90 
91  Tmatrix<Interval> integrate( double t0, double tf, int M, const Tmatrix<Interval> &x,
92  const Tmatrix<Interval> &p, const Tmatrix<Interval> &w );
93 
94 
95  template <typename T> returnValue integrate( double t0, double tf,
96  Tmatrix<T> *x, Tmatrix<T> *p = 0, Tmatrix<T> *w = 0 );
97 
98  template <typename T> double step( const double &t, const double &tf,
99  Tmatrix<T> *x, Tmatrix<T> *p = 0, Tmatrix<T> *w = 0 );
100 
101  returnValue init( const DifferentialEquation &rhs_, const int &N_ = 3 );
102 
103  Tmatrix<Interval> boundQ() const;
104 
105  template <typename T> Tmatrix<Interval> getStateBound( const Tmatrix<T> &x ) const;
106 
107 
108 
109 
110 // PRIVATE FUNCTIONS:
111 // ----------------------------------------------------------
112 
113 private:
114 
115 
116  virtual returnValue setupOptions( );
117 
118 
119  void copy( const EllipsoidalIntegrator& arg );
120 
121  template <typename T> void phase0( double t,
122  Tmatrix<T> *x, Tmatrix<T> *p, Tmatrix<T> *w,
123  Tmatrix<T> &coeff, Tmatrix<double> &C );
124 
125  template <typename T> double phase1( double t, double tf,
126  Tmatrix<T> *x, Tmatrix<T> *p, Tmatrix<T> *w,
127  Tmatrix<T> &coeff,
128  Tmatrix<double> &C );
129 
130  template <typename T> void phase2( double t, double h,
131  Tmatrix<T> *x, Tmatrix<T> *p, Tmatrix<T> *w,
132  Tmatrix<T> &coeff,
133  Tmatrix<double> &C );
134 
135  template <typename T> Tmatrix<T> evaluate( Function &f, double t,
136  Tmatrix<T> *x, Tmatrix<T> *p, Tmatrix<T> *w ) const;
137 
138 
139  template <typename T> Tmatrix<T> evaluate( Function &f, Interval t,
140  Tmatrix<T> *x, Tmatrix<T> *p, Tmatrix<T> *w ) const;
141 
142 
143  template <typename T> Tmatrix<T> phi( const Tmatrix<T> &coeff, const double &h ) const;
144 
145 
146 
147  template <typename T> Tmatrix<double> hat( const Tmatrix<T> &x ) const;
148 
149  Tmatrix<Interval> evalC ( const Tmatrix<double> &C, double h ) const;
150  Tmatrix<double> evalC2( const Tmatrix<double> &C, double h ) const;
151 
152  double scale( const Interval &E, const Interval &X ) const;
153  double norm ( const Tmatrix<Interval> &E, Tmatrix<Interval> &X ) const;
154 
155 
156  BooleanType isIncluded( const Tmatrix<Interval> &A, const Tmatrix<Interval> &B ) const;
157 
158  template <typename T> Tmatrix<Interval> bound( const Tmatrix<T> &x ) const;
159 
160  template <typename T> Tmatrix<Interval> getRemainder( const Tmatrix<T> &x ) const;
161 
162  template <typename T> Tmatrix<T> getPolynomial( const Tmatrix<T> &x ) const;
163 
164  template <typename T> void center( Tmatrix<T> &x ) const;
165 
167 
168  void setInfinity();
169 
170 
171 
172 // PRIVATE MEMBERS:
173 // ----------------------------------------------------------
174 
175 private:
176 
177  int nx; // number of differential states.
178  int N ; // the order of the integrator.
179 
180  Function g ; // Taylor expansion of the solution trajectory
181  Function gr ; // Remainder term associated with g
182  Function dg ; // Jacobian of the function g : g(t,x,...)/dx
183  Function ddg; // Directional derivative of dg: (d^2 g(t,x,...)/d^2x)*r*r
184 
185  Tmatrix<double> Q; // Ellipsoidal remainder matrix
186 
190 };
191 
193 
194 
195 #include <acado/validated_integrator/ellipsoidal_integrator.ipp>
196 
197 #endif // ACADO_TOOLKIT_ELLIPSOIDAL_INTEGRATOR_HPP
198 
199 // end of file.
virtual returnValue setupOptions()
void phase2(double t, double h, Tmatrix< T > *x, Tmatrix< T > *p, Tmatrix< T > *w, Tmatrix< T > &coeff, Tmatrix< double > &C)
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
Implements a templated dense matrix class.
Definition: t_matrix.hpp:53
Tmatrix< Interval > getStateBound(const Tmatrix< T > &x) const
void copy(const EllipsoidalIntegrator &arg)
Tmatrix< Interval > integrate(double t0, double tf, int M, const Tmatrix< Interval > &x)
Allows real time measurements based on the system&#39;s clock.
Definition: real_clock.hpp:53
Allows to pass back messages to the calling function.
Tmatrix< Interval > boundQ() const
Base class for all algorithmic modules within the ACADO Toolkit providing some basic functionality...
void updateQ(Tmatrix< double > C, Tmatrix< Interval > R)
double norm(const Tmatrix< Interval > &E, Tmatrix< Interval > &X) const
BooleanType isIncluded(const Tmatrix< Interval > &A, const Tmatrix< Interval > &B) const
virtual EllipsoidalIntegrator & operator=(const EllipsoidalIntegrator &arg)
#define CLOSE_NAMESPACE_ACADO
Implements a rudimentary interval class.
Definition: interval.hpp:67
double scale(const Interval &E, const Interval &X) const
Validated integrator for ODEs based on Taylor models with ellipsoidal remainder term.
#define E
returnValue init(const DifferentialEquation &rhs_, const int &N_=3)
double phase1(double t, double tf, Tmatrix< T > *x, Tmatrix< T > *p, Tmatrix< T > *w, Tmatrix< T > &coeff, Tmatrix< double > &C)
void center(Tmatrix< T > &x) const
Tmatrix< Interval > evalC(const Tmatrix< double > &C, double h) const
double step(const double &t, const double &tf, Tmatrix< T > *x, Tmatrix< T > *p=0, Tmatrix< T > *w=0)
#define BEGIN_NAMESPACE_ACADO
Tmatrix< T > evaluate(Function &f, double t, Tmatrix< T > *x, Tmatrix< T > *p, Tmatrix< T > *w) const
Tmatrix< Interval > getRemainder(const Tmatrix< T > &x) const
Tmatrix< double > evalC2(const Tmatrix< double > &C, double h) const
Tmatrix< T > getPolynomial(const Tmatrix< T > &x) const
Tmatrix< T > phi(const Tmatrix< T > &coeff, const double &h) const
Tmatrix< Interval > bound(const Tmatrix< T > &x) const
#define R
Tmatrix< double > hat(const Tmatrix< T > &x) const
void phase0(double t, Tmatrix< T > *x, Tmatrix< T > *p, Tmatrix< T > *w, Tmatrix< T > &coeff, Tmatrix< double > &C)
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:33