CAPD DynSys Library 5.2.0
Integration of differential inclusions

The sources of the following examples can be found in the examples/diffIncldemo directory of the CAPD package.

The following example show how to integrate differential inclusions with two different methods.

#include <iostream>
#include "capd/capdlib.h"
using namespace capd;
void RosslerExample() {
// f is an unperturbed vector field
IMap f("par:a,b;var:x,y,z;fun:-(y+z),x+b*y,b+z*(x-a);");
f.setParameter("a", DInterval(57.) / DInterval(10.)); // note that 5.7 is not a representable number
f.setParameter("b", DInterval(2.) / DInterval(10.));
// we define a perturbation
double eps = 1.0e-4; // maximal forcing (perturbation)
IMap perturb("par:e;var:x,y,z;fun:e,e,e;");
perturb.setParameter("e", DInterval(-eps, eps));
// We set right hand side of differential inclusion to f + perturb
IMultiMap rhs(f, perturb);
double timeStep = 1. / 512.; // time step for integration
int order = 10; // order of Taylor method
// We set up two differential inclusions (they differ in the way they handle perturbations)
CWDiffInclSolver cwDiffInclSolver(rhs, order, IMaxNorm());
LNDiffInclSolver lnDiffInclSolver(rhs, order, IEuclLNorm());
cwDiffInclSolver.setStep(timeStep);
lnDiffInclSolver.setStep(timeStep);
// Starting point for computations
IVector x1(3);
x1[0] = 0.0; x1[1] = -10.3; x1[2] = 0.03;
// We prepare sets that know how to propagate themselves with differential inclusions
InclRect2Set lnSet(x1),
cwSet(x1);
// We do the numberOfSets steps
int numberOfSteps = 10;
for(int i = 0; i < numberOfSteps; ++i) {
lnSet.move(lnDiffInclSolver);
cwSet.move(cwDiffInclSolver);
}
// We compute interval vector that covers given set.
IVector lnResult = IVector(lnSet),
cwResult = IVector(cwSet);
std::cout.precision(16);
std::cout << "\n\n Method based on logarithmic norms : \n " << lnResult
<< "\n diam = " << maxDiam(lnResult) << "\n";
std::cout << "\n\n Method based on component wise estimates : \n " << cwResult
<< "\n diam = " << maxDiam(cwResult) << "\n";
}
int main() {
RosslerExample();
return 0;
} // END
Class for rigorous integration of differential inclusions.
Definition: DiffInclusionCW.h:40
Class for rigorous integration of differential inclusions.
Definition: DiffInclusionLN.h:40
Set representation for differential inclusions based on capd::dynset::Rect2Set class.
Definition: InclRect2Set.h:37
A multi map for differential inclusions.
Definition: MultiMap.h:44
This class is used to represent a map .
Definition: Map.h:125
Euclidean Logarithmic Norm.
Definition: Norm.h:89
norm (max norm)
Definition: Norm.h:61
#define main()
Definition: krak-lib.h:388
int order
Definition: tayltst.cpp:31
IObject::ScalarType maxDiam(const IObject &v)
returns the upper bound for the biggest diameter of IntervalObject (vector or matrix) coordinates
Definition: iobject.hpp:52
capd::vectalg::Vector< interval, 3 > IVector
Definition: vecttst.cpp:28
This class provides a trait of being set of a given type, i.e.
Definition: DagIndexer.h:22