The sources of the following examples can be found in the examples/encloseTrajectory
directory of the CAPD package.
Enclosure for a trajectory between time steps
{
try{
cout.precision(12);
IMap vectorField(
"par:mu,mj;var:x,y,dx,dy;fun:dx,dy,x-mj*(x+mu)*sqrt((x+mu)^2+y^2)^(-3)-mu*(x-mj)*sqrt((x-mj)^2+y^2)^(-3)+2*dy,y*(1-mj*sqrt((x+mu)^2+y^2)^(-3)-mu*sqrt((x-mj)^2+y^2)^(-3))-2*dx;");
vectorField.setParameter("mu",mu);
vectorField.setParameter("mj",mj);
x[0]=0.9928634178;
x[1]=0.0;
x[2]=0.0;
x[3]=2.129213043;
double T=5;
timeMap.stopAfterStep(true);
do
{
timeMap(T,s);
cout << "\nstep made: " << stepMade;
int grid=2;
for(int i=0;i<grid;++i)
{
std::cout << "\nenclosure for t=" << prevTime + subsetOfDomain << ": " << v;
std::cout <<
"\ndiam(enclosure): " <<
diam(v);
}
prevTime = timeMap.getCurrentTime();
cout << "\ncurrent time: " << prevTime << endl << endl;
}while(!timeMap.completed());
}catch(exception& e)
{
cout << "\n\nException caught!\n" << e.what() << endl << endl;
}
}
The set is represented as doubleton: x + C*r0 + B*r; and is moved by the following method.
Definition: C0DoubletonSet.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
int main()
Definition: encloseTrajectoryBetweenTimeSteps.cpp:21
Interval diam(const Interval &ix)
Definition: Interval.h:816
bool intersection(const Complex< T > &a, const Complex< T > &b, Complex< T > &result)
Definition: Complex.h:225
Definition: ApplicationDesc.h:23
intervals::DoubleInterval interval
Definition: DoubleInterval.h:36
Enclosure for derivatives (monodromy matrix) between time steps
{
try{
cout.precision(12);
IMap vectorField(
"par:mu,mj;var:x,y,dx,dy;fun:dx,dy,x-mj*(x+mu)*sqrt((x+mu)^2+y^2)^(-3)-mu*(x-mj)*sqrt((x-mj)^2+y^2)^(-3)+2*dy,y*(1-mj*sqrt((x+mu)^2+y^2)^(-3)-mu*sqrt((x-mj)^2+y^2)^(-3))-2*dx;");
vectorField.setParameter("mu",mu);
vectorField.setParameter("mj",mj);
x[0]=0.9928634178;
x[1]=0.0;
x[2]=0.0;
x[3]=2.129213043;
double T=1;
timeMap.stopAfterStep(true);
solver.setAbsoluteTolerance(1e-12);
solver.setRelativeTolerance(1e-12);
do
{
timeMap(T,s);
cout << "\nstep made: " << stepMade;
int grid=10;
for(int i=0;i<grid;++i)
{
std::cout << "\nenclosure for t=" << prevTime + subsetOfDomain << ": " << v;
std::cout <<
"\ndiam(enclosure): " <<
diam(v);
std::cout << "\nenclosure of monodromy matrix for t=" << prevTime + subsetOfDomain << ": " << M;
std::cout <<
"\ndiam(enclosure of monodromy matrix): " <<
diam(M);
}
prevTime = timeMap.getCurrentTime();
cout << "\ncurrent time: " << prevTime << endl << endl;
}while(!timeMap.completed());
}catch(exception& e)
{
cout << "\n\nException caught!\n" << e.what() << endl << endl;
}
}
The C1 set is represented as doubleton: x + C*r0 + B*r;.
Definition: C1DoubletonSet.h:43
static Matrix Identity(size_type dim)
Definition: Matrix.hpp:109
int main()
Definition: encloseMonodromyMatrixBetweenTimeSteps.cpp:21
capd::vectalg::Matrix< capd::DInterval, CAPD_DEFAULT_DIMENSION, CAPD_DEFAULT_DIMENSION > IMatrix
Definition: typedefs.h:34