00001 ///////////////////////////////////////////////////////////////////////////// 00002 /// 00003 /// @file parpop2p.h 00004 /// 00005 /// Parameters for a sample Leslie population model in R^2 00006 /// with 2 varying parameters. 00007 /// This is a configuration file for the program "cmgraphs.cpp" 00008 /// which defines the ranges of parameters to scan 00009 /// and the details of the phase space. 00010 /// 00011 /// @author Pawel Pilarczyk 00012 /// 00013 ///////////////////////////////////////////////////////////////////////////// 00014 00015 // Copyright (C) 1997-2008 by Pawel Pilarczyk. 00016 // 00017 // This file is part of my research software package. This is free software; 00018 // you can redistribute it and/or modify it under the terms of the GNU 00019 // General Public License as published by the Free Software Foundation; 00020 // either version 2 of the License, or (at your option) any later version. 00021 // 00022 // This software is distributed in the hope that it will be useful, 00023 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 // GNU General Public License for more details. 00026 // 00027 // You should have received a copy of the GNU General Public License along 00028 // with this software; see the file "license.txt". If not, write to the 00029 // Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00030 // MA 02111-1307, USA. 00031 00032 // Started on February 9, 2008. Last revision: March 7, 2008. 00033 00034 00035 #ifndef _CMGRAPHS_PARPOP2P_H_ 00036 #define _CMGRAPHS_PARPOP2P_H_ 00037 00038 00039 namespace custom { 00040 00041 /// Parameters for sample computations for the 2-dimensional Leslie 00042 /// population model with 2 varying parameters. 00043 namespace pop2p { 00044 00045 00046 // -------------------------------------------------- 00047 // --------- the phase space configuration ---------- 00048 // -------------------------------------------------- 00049 00050 /// The dimension of the phase space. 00051 const int spaceDim = 2; 00052 00053 /// The initial depth of subdivisions in the phase space. 00054 const int initialDepth = 6; 00055 00056 /// The final depth of subdivisions in the phase space. 00057 const int finalDepth = 12; 00058 00059 00060 // -------------------------------------------------- 00061 // ------------ the parameter selection ------------- 00062 // -------------------------------------------------- 00063 00064 /// The dimension of the parameter space to iterate. Only those parameters 00065 /// which are varying are taken into consideration here. 00066 const int paramDim = 2; 00067 00068 /// The numbers of subintervals in each direction of the parameter space. 00069 /// The type of these numbers must match "parCoord" in "typedefs.h". 00070 const short int paramSubdiv [paramDim] = {50, 50}; 00071 00072 /// The numbers of parameters to subdivide. 00073 const int paramSelect [paramDim] = {0, 1}; 00074 00075 00076 // -------------------------------------------------- 00077 // ---------- the parameter space settings ---------- 00078 // -------------------------------------------------- 00079 00080 /// The number of all the parameters, both varying and fixed. 00081 const int paramCount = 2 * spaceDim; 00082 00083 /// The left bounds on the parameters. 00084 const double paramLeft [paramCount] = {8, 3, 0.7, 0.1}; 00085 00086 /// The right bounds on the parameters. 00087 const double paramRight [paramCount] = {37, 50, 0.7, 0.1}; 00088 00089 00090 // -------------------------------------------------- 00091 // -------------- the phase space size -------------- 00092 // -------------------------------------------------- 00093 00094 /// An imitation of an array which returns the offset of the rectangular area 00095 /// in the phase space which contains the invariant sets of interest. 00096 struct SpaceOffsetType 00097 { 00098 /// Returns the space offset in the requested direction. 00099 double operator [] (int n) const 00100 { 00101 return -0.001; 00102 } 00103 }; /* struct SpaceOffsetType */ 00104 00105 /// An imitation of an array which returns the offset of the rectangular area 00106 /// in the phase space which contains the invariant sets of interest. 00107 const SpaceOffsetType spaceOffset = SpaceOffsetType (); 00108 00109 /// An imitation of an array which returns the width of the rectangular area 00110 /// in the phase space which contains the invariant sets of interest. 00111 struct SpaceWidthType 00112 { 00113 /// The constructor which computes the space width in each direction. 00114 SpaceWidthType () 00115 { 00116 double e = 2.7182818284590453; 00117 double addError = 1.00000000000001; 00118 double sumTheta = 0; 00119 for (int i = 0; i < spaceDim; ++ i) 00120 { 00121 sumTheta += paramRight [i]; 00122 sumTheta *= addError; 00123 } 00124 double t = paramLeft [2 * spaceDim - 1] * e * addError; 00125 double r = (sumTheta / t) * addError; 00126 width [0] = (r - spaceOffset [0]) * addError; 00127 for (int i = 1; i < spaceDim; ++ i) 00128 { 00129 r = (r * paramRight [spaceDim + i - 1]) * addError; 00130 width [i] = (r - spaceOffset [i]) * addError; 00131 } 00132 return; 00133 } 00134 00135 /// Returns the precomputed value of the space width 00136 /// in the requested direction. 00137 double operator [] (int n) const 00138 { 00139 if ((n < 0) || (n >= spaceDim)) 00140 throw "Incorrect phase space width requested."; 00141 return width [n]; 00142 } 00143 00144 private: 00145 double width [spaceDim]; 00146 00147 }; /* struct SpaceWidthType */ 00148 00149 /// An imitation of an array which returns the width of the rectangular area 00150 /// in the phase space which contains the invariant sets of interest. 00151 const SpaceWidthType spaceWidth = SpaceWidthType (); 00152 00153 00154 // -------------------------------------------------- 00155 // --------------- joining Morse sets --------------- 00156 // -------------------------------------------------- 00157 00158 /// The maximal number of cubes in a trivial Morse set for which an attempt 00159 /// is made to join this set with another near-by Morse set. 00160 /// Set to zero to suppress joining. 00161 const int maxJoinSize = 0; 00162 00163 /// The maximal size of a connecting orbit between two Morse sets 00164 /// which can be considered for joining. 00165 const int maxJoinConnection = 1000; 00166 00167 /// The maximal allowed distance between two Morse sets which can be 00168 /// considered for joining. 00169 const int maxJoinDistance = 100; 00170 00171 00172 // -------------------------------------------------- 00173 // ----------------- other settings ----------------- 00174 // -------------------------------------------------- 00175 00176 /// Should the ordering between the Morse sets be taken into consideration 00177 /// while determining whether two Morse decompositions 00178 /// computed for adjacent parameter boxes are in the same class? 00179 const bool compareMorseOrdering = true; 00180 00181 /// Ignoring the isolation problem while matching Morse decompositions. 00182 /// If this constant is set to "true" then Morse sets are matched 00183 /// with each other indepent of whether the Conley index could be computed 00184 /// for them or not. Otherwise, 'correct' and 'wrong' Morse sets 00185 /// are matched with their counterparts in the same category only. 00186 const bool ignoreIsolationForContinuation = true; 00187 00188 /// Ignoring the isolation problem while computing the Conley index. 00189 /// If the constant is set to "true" then the index pair constructed on the 00190 /// basis of a combinatorial Morse set with respect to the dynamics 00191 /// restricted to the rectangular area of interest is also restricted 00192 /// to that area by means of projecting the any boxes which stick out 00193 /// of the region onto a single layer of boxes around the boundary. 00194 const bool ignoreIsolationForConleyIndex = false; 00195 00196 00197 } // namespace pop2p 00198 } // namespace custom 00199 00200 00201 #endif // _CMGRAPHS_PARPOP2P_H_ 00202
1.5.3