The Conley-Morse Graphs Software
m_popmodel.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file m_popmodel.h
4///
5/// The nonlinear Leslie population model map.
6///
7/// This map defines the nonlinear density dependent overcompensatory
8/// population model, as described in the paper
9/// by I. Ugarcovici and H. Weiss, "Chaotic dynamics of a nonlinear
10/// density dependent population model", Nonlinearity 17 (2004), 1689-1711.
11///
12/// @author Pawel Pilarczyk
13///
14/////////////////////////////////////////////////////////////////////////////
15
16// Copyright (C) 1997-2014 by Pawel Pilarczyk.
17//
18// This file is part of my research software package. This is free software:
19// you can redistribute it and/or modify it under the terms of the GNU
20// General Public License as published by the Free Software Foundation,
21// either version 3 of the License, or (at your option) any later version.
22//
23// This software is distributed in the hope that it will be useful,
24// but WITHOUT ANY WARRANTY; without even the implied warranty of
25// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26// GNU General Public License for more details.
27//
28// You should have received a copy of the GNU General Public License
29// along with this software; see the file "license.txt". If not,
30// please, see <https://www.gnu.org/licenses/>.
31
32// Started on February 9, 2008. Last revision: February 21, 2008.
33
34
35#ifndef _CMGRAPHS_POPMODEL_H_
36#define _CMGRAPHS_POPMODEL_H_
37
38
39// include local header files
40#include "maptype.h"
41#include "typeintv.h"
42
43
44// --------------------------------------------------
45// -------- the Leslie population model map ---------
46// --------------------------------------------------
47
48/// This class defines a map for the nonlinear density dependent
49/// overcompensatory Leslie population model.
50/// The interpretation of parameters depends on the dimension.
51class MapPopModel: public MapType
52{
53public:
54 /// The default constructor.
55 MapPopModel ();
56
57 /// Computes the image of a box whose left and right coordinates
58 /// are given. Fills in the images with the left and right
59 /// coordinates of the image box.
60 void compute (const double *xleft, const double *xright,
61 double *yleft, double *yright, int dim,
62 const spcCoord *coord, int subdiv) const;
63
64}; /* class MapPopModel */
65
66// --------------------------------------------------
67
69{
71 return;
72} /* MapPopModel::MapPopModel */
73
74inline void MapPopModel::compute (const double *xleft, const double *xright,
75 double *yleft, double *yright, int dim, const spcCoord *, int) const
76{
77 // an interval enclosure of the number e
78 const IntervalType e (2.7182818284590452, 2.7182818284590454);
79
80 // compute the interval for the first coordinate of the result
81 IntervalType first = 0;
82 IntervalType sum = 0;
83 for (int i = 0; i < dim; ++ i)
84 {
85 IntervalType x = IntervalType (xleft [i], xright [i]);
86 first += IntervalType (getLeftParam (i),
87 getRightParam (i)) * x;
88 sum += x;
89 }
90 first *= exp (-IntervalType (getLeftParam (2 * dim - 1),
91 getRightParam (2 * dim - 1)) * sum);
92
93 // compute the remainder of the result
94 // starting with the last coordinate
95 for (int i = dim - 1; i > 0; -- i)
96 {
97 IntervalType result =
98 IntervalType (getLeftParam (dim + i - 1),
99 getRightParam (dim + i - 1)) *
100 IntervalType (xleft [i - 1], xright [i - 1]);
101 yleft [i] = result. leftBound ();
102 yright [i] = result. rightBound ();
103 }
104
105 // save the first coordinate of the result
106 yleft [0] = first. leftBound ();
107 yright [0] = first. rightBound ();
108
109 // swich the rounding direction to the neutral one
110 resetRounding ();
111 return;
112} /* MapPopModel::compute */
113
114
115#endif // _CMGRAPHS_POPMODEL_H_
116
This class defines a map for the nonlinear density dependent overcompensatory Leslie population model...
Definition: m_popmodel.h:52
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_popmodel.h:74
MapPopModel()
The default constructor.
Definition: m_popmodel.h:68
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
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