codac 2.0.0
Loading...
Searching...
No Matches
codac2_CtcLohner.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_TimePropag.h"
14#include "codac2_TDomain.h"
15#include "codac2_SlicedTube.h"
16
17namespace codac2
18{
19
25 struct GlobalEnclosureError : public std::runtime_error {
26 GlobalEnclosureError() : std::runtime_error(
27 "Exceeded loop maximum range while looking for a global enclosure for the system.") {}
28 };
29
37 public:
38 constexpr static const double FWD = 1., BWD = -1.;
39
50 LohnerAlgorithm(const AnalyticFunction<VectorType> *f,
51 double h,
52 bool forward,
53 const IntervalVector &u0,
54 int contractions = 1,
55 double eps = 0.1);
63 const IntervalVector &integrate(unsigned int steps, double H = -1);
64
71
79
86 private:
94 IntervalVector globalEnclosure(const IntervalVector &initialGuess, double dir);
95
96 unsigned int _dim;
97 double _h;
98 double _direction;
99 double _eps;
100 int _contractions;
101 IntervalVector _u;
102 IntervalVector _z;
103 IntervalVector _r;
104 IntervalVector _u_tilde;
105 Matrix _B, _Binv;
106 Vector _u_hat;
107 const AnalyticFunction<VectorType> *_f;
108 };
109
117 {
118 public:
119
127 CtcLohner(const AnalyticFunction<VectorType>& f, int contractions = 5, double eps = 0.1);
128
135 void contract(SlicedTube<IntervalVector> &tube, TimePropag t_propa = TimePropag::FWD_BWD) const;
136
137
138 protected:
139
140 AnalyticFunction<VectorType> _f;
142 int _dim;
143 double _eps;
144 };
145}
CtcLohner(const AnalyticFunction< VectorType > &f, int contractions=5, double eps=0.1)
Creates the contractor.
AnalyticFunction< VectorType > _f
forward function
Definition codac2_CtcLohner.h:140
double _eps
inflation parameter for the global enclosure
Definition codac2_CtcLohner.h:143
int _dim
dimension of the state vector
Definition codac2_CtcLohner.h:142
int _contractions
number of contractions of the global enclosure by the estimated local enclosure
Definition codac2_CtcLohner.h:141
void contract(SlicedTube< IntervalVector > &tube, TimePropag t_propa=TimePropag::FWD_BWD) const
Applies .
void contractStep(const IntervalVector &x)
contract the global & local enclosure of the previous integration step
const IntervalVector & integrate(unsigned int steps, double H=-1)
integrate the system over a given number of steps
const IntervalVector & getLocalEnclosure() const
Returns the current global enclosure, i.e. the box enclosing the trajectories between times and .
LohnerAlgorithm(const AnalyticFunction< VectorType > *f, double h, bool forward, const IntervalVector &u0, int contractions=1, double eps=0.1)
Creates a Lohner algorithm object.
const IntervalVector & getGlobalEnclosure() const
Returns the current local enclosure, i.e. the box enclosing the trajectories at time .
Definition codac2_OctaSym.h:21
Eigen::Matrix< double,-1, 1 > Vector
Alias for a dynamically-sized column vector of doubles.
Definition codac2_Vector.h:24
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26
TimePropag
Enumeration specifying the temporal propagation way (forward or backward in time).
Definition codac2_TimePropag.h:23