The Conley-Morse Graphs Software
m_stdmap.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file m_stdmap.h
4///
5/// The Standard Map.
6/// This is the Standard Map which is an example of a surface-preserving
7/// map of the torus which is chaotic.
8///
9/// @author Pawel Pilarczyk
10///
11/////////////////////////////////////////////////////////////////////////////
12
13// Copyright (C) 1997-2014 by Pawel Pilarczyk.
14//
15// This file is part of my research software package. This is free software:
16// you can redistribute it and/or modify it under the terms of the GNU
17// General Public License as published by the Free Software Foundation,
18// either version 3 of the License, or (at your option) any later version.
19//
20// This software is distributed in the hope that it will be useful,
21// but WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23// GNU General Public License for more details.
24//
25// You should have received a copy of the GNU General Public License
26// along with this software; see the file "license.txt". If not,
27// please, see <https://www.gnu.org/licenses/>.
28
29// Started on October 26, 2008. Last revision: October 26, 2008.
30
31
32#ifndef _CMGRAPHS_STDMAP_H_
33#define _CMGRAPHS_STDMAP_H_
34
35
36// include local header files
37#include "maptype.h"
38#include "typeintv.h"
39
40
41// --------------------------------------------------
42// ---------------- the Standard Map ----------------
43// --------------------------------------------------
44
45/// This class defines the Standard Map.
46/// This map has only one parameter: 'K'.
47class StandardMap: public MapType
48{
49public:
50 /// The default constructor.
51 StandardMap ();
52
53 /// Computes the image of a box whose left and right coordinates
54 /// are given. Fills in the images with the left and right
55 /// coordinates of the image box.
56 void compute (const double *xleft, const double *xright,
57 double *yleft, double *yright, int dim,
58 const spcCoord *coord, int subdiv) const;
59
60}; /* class StandardMap */
61
62// --------------------------------------------------
63
65{
67 return;
68} /* StandardMap::StandardMap */
69
70inline void StandardMap::compute (const double *xleft, const double *xright,
71 double *yleft, double *yright, int dim, const spcCoord *, int) const
72{
73 // use the number "pi" defined in the CAPD package
74 const IntervalType Pi (pi);
75
76 // determine the value of the parameter K
77 const IntervalType K (getLeftParam (0), getRightParam (0));
78
79 // determine the input variables
80 IntervalType I_n (xleft [0], xright [0]);
81 IntervalType Theta_n (xleft [1], xright [1]);
82
83 // rescale the input data from [0,2] to [0,2pi] for I
84 // and from [-1,1] to [-pi,pi] for theta
85 I_n *= Pi;
86 Theta_n *= Pi;
87
88 // compute the values of the next iteration of the two variables
89 IntervalType I_next (I_n + K * sin (Theta_n));
90 IntervalType Theta_next (Theta_n + I_next);
91
92 // rescale the output back to the intervals [0,2] and [-1,1]
93 I_next /= Pi;
94 Theta_next /= Pi;
95
96 // save the coordinates of the result
97 yleft [0] = I_next. leftBound ();
98 yright [0] = I_next. rightBound ();
99 yleft [1] = Theta_next. leftBound ();
100 yright [1] = Theta_next. rightBound ();
101
102 // swich the rounding direction to the neutral one
103 resetRounding ();
104 return;
105} /* StandardMap::compute */
106
107
108#endif // _CMGRAPHS_STDMAP_H_
109
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 the Standard Map.
Definition: m_stdmap.h:48
StandardMap()
The default constructor.
Definition: m_stdmap.h:64
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_stdmap.h:70
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