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"
void RosslerExample() {
IMap f(
"par:a,b;var:x,y,z;fun:-(y+z),x+b*y,b+z*(x-a);");
double eps = 1.0e-4;
IMap perturb(
"par:e;var:x,y,z;fun:e,e,e;");
perturb.setParameter(
"e",
DInterval(-eps, eps));
double timeStep = 1. / 512.;
cwDiffInclSolver.setStep(timeStep);
lnDiffInclSolver.setStep(timeStep);
x1[0] = 0.0; x1[1] = -10.3; x1[2] = 0.03;
cwSet(x1);
int numberOfSteps = 10;
for(int i = 0; i < numberOfSteps; ++i) {
lnSet.move(lnDiffInclSolver);
cwSet.move(cwDiffInclSolver);
}
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";
}
RosslerExample();
return 0;
}