CAPD::DynSys Library  6.0.0
ODE integration

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

Integration of an ordinary differential equation

#include "capd/capdlib.h"
using namespace capd;
using namespace std;
int main()
{
cout.precision(12);
try{
// This is vector field for the Rossler system
IMap vectorField("par:a,b;var:x,y,z;fun:-(y+z),x+b*y,b+z*(x-a);");
// set chaotic parameter values
vectorField.setParameter("a",interval(57.)/10.); // a=5.7
vectorField.setParameter("b",interval(2.)/10.); // b=0.2
// the solver, is uses high order enclosure method to verify the existence
// of the solution. The order is set to 20.
IOdeSolver solver(vectorField,20);
solver.setAbsoluteTolerance(1e-10);
solver.setRelativeTolerance(1e-10);
ITimeMap timeMap(solver);
// this is a good approximation of a periodic point
IVector c(3);
c[0] = 0.;
c[1] = -8.3809417428298;
c[2] = 0.029590060630665;
// take some box around c
c += interval(-1,1)*1e-10;
// define a doubleton representation of the interval vector c
// we integrate the set s over the time T
interval T(100);
cout << "\ninitial set: " << c;
cout << "\ndiam(initial set): " << diam(c) << endl;
IVector result = timeMap(T,s);
cout << "\n\nafter time=" << T << " the image is: " << result;
cout << "\ndiam(image): " << diam(result) << endl << endl;
}catch(exception& e)
{
cout << "\n\nException caught!\n" << e.what() << endl << endl;
}
} // END
This class uses representation of subset of R^n inherited from template parameter.
Definition: C0HOSet.h:39
Definition: OdeSolver.h:40
Definition of template class Interval.
Definition: Interval.h:83
This class is used to represent a map .
Definition: Map.h:125
TimeMap class provides methods for transport of sets (or points) by a given flow over some time inter...
Definition: TimeMap.h:34
Definition: Vector.h:54
int main()
Definition: integrate.cpp:21
Interval diam(const Interval &ix)
Definition: Interval.h:816
Definition: ApplicationDesc.h:23
intervals::DoubleInterval interval
Definition: DoubleInterval.h:36
Definition: Logger.h:88

Integration of ODE along with a variational equations

#include "capd/capdlib.h"
using namespace capd;
using namespace std;
int main()
{
cout.precision(12);
try{
// This is vector field for the Rossler system
IMap vectorField("par:a,b;var:x,y,z;fun:-(y+z),x+b*y,b+z*(x-a);");
// set chaotic parameter values
vectorField.setParameter("a",interval(57.)/10.); // a=5.7
vectorField.setParameter("b",interval(2.)/10.); // b=0.2
// the solver, is uses high order enclosure method to verify the existence
// of the solution. The order is set to 20.
IOdeSolver solver(vectorField,20);
ITimeMap timeMap(solver);
// this is a good approximation of a periodic point
IVector c(3);
c[0] = 0.;
c[1] = -8.3809417428298;
c[2] = 0.029590060630665;
// take some box around c
c += interval(-1,1)*1e-10;
// define a doubleton representation of the interval vector c
// and its derivative wrt initial condition
C1Rect2Set s(c);
// we integrate the set s over the time T
interval T(20);
cout << "\ninitial set: " << c;
cout << "\ndiam(initial set): " << diam(c) << endl;
IMatrix monodromyMatrix(3,3); // this is for result
IVector result = timeMap(T,s,monodromyMatrix);
cout << "\n\nafter time=" << T << " the image is: " << result;
cout << "\ndiam(image): " << diam(result);
cout << "\n\nmonodromyMatrix:\n" << monodromyMatrix;
cout << "\n\ndiam(monodromyMatrix): " << diam(monodromyMatrix) << endl << endl;
}catch(exception& e)
{
cout << "\n\nException caught!\n" << e.what() << endl << endl;
}
} // END
The C1 set is represented as doubleton: x + C*r0 + B*r;.
Definition: C1DoubletonSet.h:43
Definition: Matrix.h:65
int main()
Definition: integrateVariationalEquation.cpp:21