The Conley-Morse Graphs Software
indpop2d.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file indpop2d.h
4///
5/// Known Conley indices for a dynamical system.
6/// Alter this file every time a different system is considered.
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 April 5, 2008. Last revision: April 5, 2008.
29
30
31#ifndef _CMGRAPHS_INDPOP2D_H_
32#define _CMGRAPHS_INDPOP2D_H_
33
34// include selected header files from the CHomP library
35#include "chomp/system/textfile.h"
36#include "chomp/homology/chains.h"
37#include "chomp/struct/integer.h"
38
39// include local header files
40#include "config.h"
41#include "typedefs.h"
42#include "conindex.h"
43#include "morsedec.h"
44#include "typedyns.h"
45
46
47namespace custom {
48
49/// Customized version of a function for the computation of Conley indices
50/// of Morse sets which fail the isolation condition.
51/// This version is valid for the 2-dimensional Leslie population model
52/// and returns the Conley index of the origin if the Morse set
53/// seems to be a small neighborhood of the origin.
54namespace popOriginInd2d {
55
56
57// --------------------------------------------------
58// ---------------- set Conley index ----------------
59// --------------------------------------------------
60
61/// Assigns a prescribed Conley index to the given Morse set
62/// whose index could not be computed because of the lack of isolation.
63/// This procedure assigns the known index of the origin
64/// for the Leslie population model which comes from the linearization,
65/// based on its eigenvalues computed by hand for the 2-dimensional model:
66/// lambda_1 = theta_1 and lambda_2 = -p theta_2 / theta_1.
67/// Returns "true" if the index was set, "false" otherwise.
68inline bool setConleyIndex (theMorseDecompositionType &morseDec, int n,
69 int subdivDepth, const double *leftMapParam,
70 const double *rightMapParam, int paramCount)
71{
72 using chomp::homology::sbug;
73
74 // make sure that the dimension of the phase space is correct
75 if (spaceDim != 2)
76 return false;
77
78 // make sure that the ranges of parameters are good
79 if (leftMapParam [0] <= 1.0)
80 return false;
81 bool repelling = false;
82 double addError = 1.00000000000001;
83 if (leftMapParam [2] * leftMapParam [1] / rightMapParam [0] /
84 addError > 1)
85 {
86 repelling = true;
87 }
88 else if (rightMapParam [2] * rightMapParam [1] / leftMapParam [0] *
89 addError < 1)
90 {
91 repelling = false;
92 }
93 else
94 return false;
95
96 // if the set is quite large then skip it
97 if (morseDec [n]. size () > 10)
98 return false;
99
100 // determine a cube which covers the origin
101 spcCoord origin [spaceDim];
102 for (int i = 0; i < spaceDim; ++ i)
103 {
104 origin [i] = static_cast<spcCoord> (-spaceOffset [i] *
105 (1 << subdivDepth) / spaceWidth [i]);
106 }
107
108 // if the set does not contain the origin then skip it
109 if (!morseDec [n]. check (spcCube (origin, spaceDim)))
110 return false;
111
112 // set the Conley index of the origin according to the parameters
113 int betti [spaceDim + 1];
114 chomp::homology::mmatrix<chomp::homology::integer>
115 matr [spaceDim + 1];
116 for (int i = 0; i <= spaceDim; ++ i)
117 betti [i] = 0;
118 chomp::homology::integer e;
119 e = 1;
120 if (!repelling)
121 {
122 betti [1] = 1;
123 matr [1]. add (0, 0, e);
124 }
125 else
126 {
127 betti [2] = 1;
128 matr [2]. add (0, 0, -e);
129 }
131 ind. define (betti, matr, spaceDim);
132 morseDec. setindex (n, ind);
133 return true;
134} /* setConleyIndex */
135
136
137} // namespace popOriginInd2d
138} // namespace custom
139
140
141#endif // _CMGRAPHS_INDPOP2D_H_
142
The class that computes and returns properties of the Conley index.
Definition: conindex.h:86
The Morse decoposition class.
Definition: morsedec.h:65
Choice of configuration settings.
Conley index computation routines.
Morse decompositions.
const SpaceOffsetType spaceOffset
An imitation of an array which returns the offset of the rectangular area in the phase space which co...
Definition: p_differ.h:108
const int spaceDim
The dimension of the phase space.
Definition: p_differ.h:48
const int paramCount
The number of all the parameters, both varying and fixed.
Definition: p_differ.h:82
const SpaceWidthType spaceWidth
An imitation of an array which returns the width of the rectangular area in the phase space which con...
Definition: p_differ.h:128
bool setConleyIndex(theMorseDecompositionType &morseDec, int n, int subdivDepth, const double *leftMapParam, const double *rightMapParam, int paramCount)
Assigns a prescribed Conley index to the given Morse set whose index could not be computed because of...
Definition: indpop2d.h:68
Customizable settings that are supposed to be modified and/or chosen by the user of the software.
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
int spcCoord
The type of coordinates of cubes in the phase space.
Definition: typespace.h:50
chomp::homology::tCubeBase< spcCoord > spcCube
The type of a cube in the phase space.
Definition: typespace.h:55