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