The Conley-Morse Graphs Software
m_vpol1.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file m_vpol1.h
4///
5/// A specific time-t map for the Vanderpol ODE.
6///
7/// @author Pawel Pilarczyk
8///
9/////////////////////////////////////////////////////////////////////////////
10
11// Copyright (C) 1997-2022 by Pawel Pilarczyk.
12//
13// This file is part of my research software package. This is free software:
14// you can redistribute it and/or modify it under the terms of the GNU
15// General Public License as published by the Free Software Foundation,
16// either version 3 of the License, or (at your option) any later version.
17//
18// This software is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with this software; see the file "license.txt". If not,
25// please, see <https://www.gnu.org/licenses/>.
26
27// Started on February 9, 2008. Last revision: April 23, 2022.
28
29
30#ifndef _CMGRAPHS_VPOL1_H_
31#define _CMGRAPHS_VPOL1_H_
32
33
34// include local header files
35#include "maptype.h"
36#include "typeintv.h"
37
38// temporary - for debugging only
39#include "chomp/system/config.h"
40#include "chomp/system/textfile.h"
41
42// --------------------------------------------------
43// ----- a time-t map for the Vanderpol system ------
44// --------------------------------------------------
45
46/// This class defines a time-t map for the Vanderpol system
47/// with a fixed (hard-coded) time t.
49{
50public:
51 /// The default constructor.
53
54 /// Computes the image of a box whose left and right coordinates
55 /// are given. Fills in the images with the left and right
56 /// coordinates of the image box.
57 void compute (const double *xleft, const double *xright,
58 double *yleft, double *yright, int dim,
59 const spcCoord *coord, int subdiv) const;
60
61}; /* class MapVanderPol1 */
62
63// --------------------------------------------------
64
66{
68 return;
69} /* MapVanderPol1::MapVanderPol1 */
70
71inline void MapVanderPol1::compute (const double *xleft, const double *xright,
72 double *yleft, double *yright, int dim, const spcCoord *, int) const
73{
74 using chomp::homology::sbug;
75
76 if (dim != 2)
77 throw "Dimension 2 supported only.";
78
79 // create intervals that correspond to the point at the n-th iterate
80 IntervalType xn = IntervalType (xleft [0], xright [0]);
81 IntervalType yn = IntervalType (xleft [1], xright [1]);
82
83 // create an interval that corresponds to the parameter of the system
85
86 // compute the point at the next iteration using Euler's method
87 // note: x' = y - x^3 + ax, y' = -x
88 const double t (0.1);
89#ifdef REVERSED_TIME
90// [Vanderpol equations with reversed time:]
91 IntervalType xn1 = xn - t * (yn - xn * (xn * xn - a));
92 IntervalType yn1 = yn + t * xn;
93#else
94// [Vanderpol equations:]
95 IntervalType xn1 = xn + t * (yn - xn * (xn * xn - a));
96 IntervalType yn1 = yn - t * xn;
97#endif
98
99 // save the result
100 yleft [0] = xn1. leftBound ();
101 yright [0] = xn1. rightBound ();
102 yleft [1] = yn1. leftBound ();
103 yright [1] = yn1. rightBound ();
104
105 // swich the rounding direction to the neutral one
106 resetRounding ();
107 return;
108} /* MapVanderPol1::compute */
109
110
111#endif // _CMGRAPHS_VPOL1_H_
112
This is an abstract class which defines the interface to other classes that describe maps for the use...
Definition: maptype.h:59
const double & getLeftParam(int n) const
Returns the left value of the given parameter.
Definition: maptype.h:196
const double & getRightParam(int n) const
Returns the right value of the given parameter.
Definition: maptype.h:203
This class defines a time-t map for the Vanderpol system with a fixed (hard-coded) time t.
Definition: m_vpol1.h:49
void compute(const double *xleft, const double *xright, double *yleft, double *yright, int dim, const spcCoord *coord, int subdiv) const
Computes the image of a box whose left and right coordinates are given.
Definition: m_vpol1.h:71
MapVanderPol1()
The default constructor.
Definition: m_vpol1.h:65
An abstract map type.
Data types for interval arithmetic.
void resetRounding()
This function resets rounding switches of the processor and sets rounding to the nearest.
Definition: typeintv.h:65
bool testIntervals(bool throwException=false)
Testing interval arithmetic.
Definition: typeintv.h:82
capd::DInterval IntervalType
The type of an interval (from the CAPD library 2.9/3.0 beta).
Definition: typeintv.h:49
int spcCoord
The type of coordinates of cubes in the phase space.
Definition: typespace.h:50