The Conley-Morse Graphs Software
m_roessler_a.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file m_roessler_a.h
4///
5/// An approximate time-t map for the Roessler equations.
6/// This map defines a sample time-t map for an ODE.
7///
8/// @author Pawel Pilarczyk
9///
10/////////////////////////////////////////////////////////////////////////////
11
12// Copyright (C) 1997-2014 by Pawel Pilarczyk.
13//
14// This file is part of my research software package. This is free software:
15// you can redistribute it and/or modify it under the terms of the GNU
16// General Public License as published by the Free Software Foundation,
17// either version 3 of the License, or (at your option) any later version.
18//
19// This software is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU General Public License for more details.
23//
24// You should have received a copy of the GNU General Public License
25// along with this software; see the file "license.txt". If not,
26// please, see <https://www.gnu.org/licenses/>.
27
28// Started on May 26, 2011. Last revision: May 29, 2011.
29
30
31#ifndef _CMGRAPHS_ROESAPPROX_H_
32#define _CMGRAPHS_ROESAPPROX_H_
33
34
35// include local header files
36#include "maptype.h"
37#include "odeapprox.h"
38
39
40// --------------------------------------------------
41// ------------ the Roessler time-t map -------------
42// --------------------------------------------------
43
44/// An approximate time-t map for the Roessler equations.
46{
47public:
48 /// The constructor of a Roessler map object.
50
51private:
52 /// The vector field.
53 void vectorField (double, const double *x, double *y, int dim) const;
54
55}; /* class MapRoesslerApprox */
56
57// --------------------------------------------------
58
60 MapOdeApprox (1.0/64, 192, 2)
61{
62 return;
63} /* MapRoesslerApprox::MapRoesslerApprox */
64
66 const double *x, double *y, int dim) const
67{
68 if (dim != 3)
69 throw "This model is valid in dimension 3 only.";
70
71 // is this the Roessler equation with reversed time?
72 const bool reversed = false;
73
74 // retrieve the parameters (the left bound only)
75 double a = getLeftParam (0);
76 double b = getLeftParam (1);
77
78 // scale the point in order to stretch the neighborhood
79 const int sCount = 7;
80 double sIn [sCount] =
81 {-5, -1.0 / 4, -1.0 / 8, 0, 1.0 / 8, 1.0 / 4, 5};
82 double sOut [sCount] =
83 {-5, -2, -1, 0, 1, 2, 5};
84 double scaled [3];
85 for (int i = 0; i < 3; ++ i)
86 scaled [i] = x [i];
87 double stretch [3];
88 for (int i = 0; i < 3; ++ i)
89 stretch [i] = 1;
90
91 const bool scaling = false;
92 for (int i = 0; scaling && (i < 2); ++ i)
93 {
94 if ((x [i] <= sIn [0]) || (x [i] >= sIn [sCount - 1]))
95 {
96 continue;
97 }
98 for (int j = 1; j < sCount; ++ j)
99 {
100 if (x [i] < sIn [j])
101 {
102 stretch [i] = (sOut [j] - sOut [j - 1]) /
103 (sIn [j] - sIn [j - 1]);
104 scaled [i] = sOut [j - 1] +
105 (x [i] - sIn [j - 1]) * stretch [i];
106 break;
107 }
108 }
109 }
110
111 // compute the vector field
112 y [0] = (-(scaled [1] + scaled [2])) * stretch [0];
113 y [1] = (scaled [0] + b * scaled [1]) * stretch [1];
114 y [2] = (b + scaled [2] * (scaled [0] - a)) * stretch [2];
115
116 // reverse the vector field if requested to
117 if (reversed)
118 {
119 for (int i = 0; i < dim; ++ i)
120 y [i] = -y [i];
121 }
122
123 return;
124} /* MapRoesslerApprox::vectorField */
125
126
127
128#endif // _CMGRAPHS_ROESAPPROX_H_
129
This class defines a map for the nonlinear density dependent overcompensatory Leslie population model...
Definition: odeapprox.h:61
An approximate time-t map for the Roessler equations.
Definition: m_roessler_a.h:46
void vectorField(double, const double *x, double *y, int dim) const
The vector field.
Definition: m_roessler_a.h:65
MapRoesslerApprox()
The constructor of a Roessler map object.
Definition: m_roessler_a.h:59
const double & getLeftParam(int n) const
Returns the left value of the given parameter.
Definition: maptype.h:196
An abstract map type.
A generic method for computing a time-t map for ODEs in an approximate way.