popmodel.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 ///
00003 /// @file popmodel.h
00004 ///
00005 /// The nonlinear Leslie population model map.
00006 ///
00007 /// This map defines the nonlinear density dependent overcompensatory
00008 /// population model, as described in the paper
00009 /// by I. Ugarcovici and H. Weiss, "Chaotic dynamics of a nonlinear
00010 /// density dependent population model", Nonlinearity 17 (2004), 1689-1711.
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: February 21, 2008.
00034 
00035 
00036 #ifndef _CMGRAPHS_POPMODEL_H_
00037 #define _CMGRAPHS_POPMODEL_H_
00038 
00039 // the generic class for the type of a map
00040 #include "maptype.h"
00041 
00042 // the interval arithmetic package from the CAPD library
00043 #include "interval/doubleInterval.h"
00044 
00045 
00046 // --------------------------------------------------
00047 // -------- the Leslie population model map ---------
00048 // --------------------------------------------------
00049 
00050 /// This class defines a map for the nonlinear density dependent
00051 /// overcompensatory Leslie population model.
00052 /// The interpretation of parameters depends on the dimension.
00053 class MapPopModel: public MapType
00054 {
00055 public:
00056         /// Computes the image of a box whose left and right coordinates
00057         /// are given. Fills in the images with the left and right
00058         /// coordinates of the image box.
00059         void compute (const double *xleft, const double *xright,
00060                 double *yleft, double *yright, int dim) const;
00061 
00062 }; /* class MapPopModel */
00063 
00064 // --------------------------------------------------
00065 
00066 inline void MapPopModel::compute (const double *xleft, const double *xright,
00067         double *yleft, double *yright, int dim) const
00068 {
00069         // an interval enclosure of the number e
00070         const interval e (2.7182818284590452, 2.7182818284590454);
00071 
00072         // compute the interval for the first coordinate of the result
00073         interval first = 0;
00074         interval sum = 0;
00075         for (int i = 0; i < dim; ++ i)
00076         {
00077                 interval x = interval (xleft [i], xright [i]);
00078                 first += interval (getLeftParam (i), getRightParam (i)) * x;
00079                 sum += x;
00080         }
00081         first *= exp (-interval (getLeftParam (2 * dim - 1),
00082                 getRightParam (2 * dim - 1)) * sum);
00083 
00084         // compute the remainder of the result
00085         // starting with the last coordinate
00086         for (int i = dim - 1; i > 0; -- i)
00087         {
00088                 interval result = interval (getLeftParam (dim + i - 1),
00089                         getRightParam (dim + i - 1)) *
00090                         interval (xleft [i - 1], xright [i - 1]);
00091                 yleft [i] = result. leftBound ();
00092                 yright [i] = result. rightBound ();
00093         }
00094 
00095         // save the first coordinate of the result
00096         yleft [0] = first. leftBound ();
00097         yright [0] = first. rightBound ();
00098 
00099         // swich the rounding direction to the nearest representable number
00100         capd::rounding::DoubleRounding::roundNearest ();
00101         return;
00102 } /* MapPopModel::compute */
00103 
00104 
00105 #endif // _CMGRAPHS_POPMODEL_H_
00106 

Generated on Sun Mar 28 17:47:58 2010 for The Conley-Morse Graphs Software by  doxygen 1.5.3