Representation of initial condition
The rigorous solver requires that the initial condition for variational equations is given in one of the acceptable representation. We have implemented several algorithms and representations but C1Rect2Set and C1HORect2Set proved to be most efficient in most typical applications.
These classes represent a subset of in the form of doubleton where
- are interval vectors, contain zero
- are interval matrices, with close to orthogonal
They represent monodromy matrix also in the form of doubleton where
- are interval matrices, contain zero
- are interval matrices, with close to orthogonal
One can define an instance of C1Rect2Set or C1HORect2Set by constructor call
capd::dynset::C1DoubletonSet< capd::IMatrix, C1Rect2Policies > C1Rect2Set
Definition: typedefs.h:54
intervals::DoubleInterval interval
Definition: DoubleInterval.h:36
- Note
- initialTime can be skipped and then it is set to zero
- Note
- the above constructor sets Identity as the initial condition for variational equations
If the initial condition is not an interval vector but an affine set
we recommend to use one of the following overloaded constructors
Long-time integration of variational equations
The class TimeMap (see Long-time integration) provides interface for long-time integration of ODEs with associated variational equations. One has to specify initial condition
and call suitable operator
IMatrix monodromyMatrix(dimension,dimension);
IVector y = timeMap(finalTime,set);
After successful integration one can extract monodromy matrix from the object set
capd::vectalg::Matrix< capd::DInterval, CAPD_DEFAULT_DIMENSION, CAPD_DEFAULT_DIMENSION > IMatrix
Definition: typedefs.h:34
- Note
- When solving ODEs with variational equations step control mechanism predicts time steps to fix requested error tolerances both for main equations and for variational equations.
Below is an example of integration of the forced pendulum equation.
See also an example of integration of the Rossler system with variational equations: Integration of ODE along with a variational equations
Complete example (from examples/odes/ITimeMapVariationalEquationsExample.cpp):
#include <iostream>
cout.precision(17);
IMap pendulum(
"time:t;par:omega;var:x,dx;fun:dx,sin(omega*t)-sin(x);");
pendulum.setParameter("omega",1.);
u[0] = 1.;
u[1] = 2.;
u = timeMap(finalTime,set);
cout << "u=" << u << endl;
cout <<
"monodromyMatrix=" << (
IMatrix)set << endl;
return 0;
}
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(int argc, char *argv[])
Definition: argdemo.cpp:81
int order
Definition: tayltst.cpp:31
Definition: ApplicationDesc.h:23
capd::dynsys::OdeSolver< capd::IMap > IOdeSolver
Definition: typedefs.h:19
Variational equations - functional approach
As in the case of computing trajectories (see Solutions to IVPs as functions) one can obtain solution to variational equation as a functional object that can be evaluated at any intermediate time.
Complete example (from examples/odesrig/ITimeMapMonodromyMatrixCurveExample.cpp):
#include <iostream>
IMap pendulum(
"time:t;par:omega;var:x,dx;fun:dx,sin(omega*t)-sin(x);");
pendulum.setParameter("omega",1.);
u[0] = 1.;
u[1] = 2.;
timeMap(finalTime,set,solution);
cout.precision(17);
cout << "domain = [" << solution.getLeftDomain() << "," << solution.getRightDomain() << "]\n";
cout << "solution(4) =" << solution(4) << endl;
cout <<
"solution(5,5.125) =" << solution(
interval(5,5.125)) << endl;
cout << "solution(10)=" << solution(10) << endl;
cout << "monodromyMatrix(4)=" << solution.derivative(4) << endl;
cout <<
"monodromyMatrix(5,5.125)=" << solution.derivative(
interval(5,5.125)) << endl;
cout << "monodromyMatrix(10)=" << solution.derivative(10) << endl;
return 0;
}
Definition: SolutionCurve.h:131