Poincare map and return time - nonrigorous version
Given an instance of class PoincareMap one can compute image of a vector under Poincare map by call to overloaded operator
double returnTime = 0;
cout << "P(x)=" << pm(x,returnTime) << endl;
cout << "return time = " << returnTime << endl;
- Attention
- The second argument
returnTime
must be initialized as it is used both as input and output parameter.
- For autonomous systems it is usually initialized with zero. Then on output it will contain return time.
- For nonautonomous systems its initial value specifies initial time for integration. On output it will contain the time at which intersection with Poincare section occurred.
- Note
- The second argument
initialTime
of the operator can be skipped - then the initial time for integration is set to zero by default.
cout << "P(x)=" << pm(x) << endl;
Complete example (from examples/poincare/DPoincareMapExample.cpp):
#include <iostream>
#include "capd/capdlib.h"
using namespace std;
cout.precision(17);
DMap lorenz(
"par:s,r,q;var:x,y,z;fun:s*(y-x),x*(r-z)-y,x*y-q*z;");
lorenz.setParameter("s",10.);
lorenz.setParameter("r",28.);
lorenz.setParameter("q",8./3.);
section.setParameter("r",28);
double returnTime=0;
double data[] = {-2.1473674741633753,2.0780481172873415,27};
cout << " x=" << x << endl;
x = pm(x,returnTime);
cout << " P(x)=" << x << ", halfReturnTime=" << returnTime<< endl;
x = pm(x,returnTime);
cout << "P^2(x)=" << x << ", fullReturnTime=" << returnTime<< endl;
return 0;
}
Derivatives of Poincare maps
The class DPoincareMap provides an overloaded operator for computation of Poincare map and its derivative. In order to compute Poincare map and its derivative we have to
- specify initial condition for the main equation
- define matrix that will store monodromy matrix - this is derivative of the flow with respect to and evaluated at equal to return time
- call operator that computes simultaneously Poincare map and monodromy matrix
double returnTime = 0.;
DVector P = pm(initPoint,monodromyMatrix,returnTime);
- Note
- The last argument
returnTime
is optional and can be skipped for autonomous systems
After successful integration we have
P
is an aproximate value of Poincare map at initPoint
- approximate monodromy matrix
monodromyMatrix
Given monodromy matrix we can recompute it to derivative of Poincare map by
DMatrix DP = pm.computeDP(P,monodromyMatrix,returnTime);
- Note
- for nonautonomous systems the argument
returnTime
can be skipped
- Note
- we split computation of derivative of Poincare map into computation of monodromy matrix and solving implicit equation. This is because the user can provide own and optimized routine for recomputation of monodromy matrix to derivative of Poincare map. For user convenience we provide a general routine
computeDP
.
- Note
- The matrix
DP
returned by computeDP
is in full dimension. One can take a submatrix of DP
that correspond to variables on the section.
Complete example (from examples/poincare/DPoincareMapDerivativeExample.cpp):
#include <iostream>
#include "capd/capdlib.h"
using namespace std;
{
cout.precision(17);
try{
DMap vectorField(
"par:a,b;var:x,y,z;fun:-(y+z),x+b*y,b+z*(x-a);");
vectorField.setParameter("a",5.7);
vectorField.setParameter("b",0.2);
double data[] = {0.,-8.3809417428298 , 0.029590060630665};
double returnTime = 0.;
DVector P = pm(u,monodromyMatrix,returnTime);
DMatrix DP = pm.computeDP(P,monodromyMatrix,returnTime);
cout << " u=" << u << endl;
cout << "P(u)=" << P << endl;
cout << "return time = " << returnTime << endl;
cout << "monodromyMatrix=" << monodromyMatrix << endl;
cout << "DP(u)=" << DP << endl;
}catch(exception& e)
{
cout << "\n\nException caught: "<< e.what() << endl;
}
return 0;
}