monte
所属分类:单片机开发
开发工具:C/C++
文件大小:299KB
下载次数:3
上传日期:2015-06-28 23:39:40
上 传 者:
clearwaters
说明: 基于蒙特卡洛方法的随机误差模拟方法,可以用于工程仿真应用。
(the random error simulated by Montecarlo method)
文件列表:
monte (0, 2009-06-27)
monte\barray.cpp (5201, 2008-04-02)
monte\barray.hpp (2010, 2008-04-02)
monte\Classes.list (3220, 1999-08-01)
monte\Debug (0, 2009-06-27)
monte\Debug\barray.obj (17951, 2008-04-02)
monte\Debug\barray.sbr (0, 2008-04-02)
monte\Debug\getargs.obj (11266, 2008-04-02)
monte\Debug\getargs.sbr (0, 2008-04-02)
monte\Debug\mctest.obj (25332, 2008-04-02)
monte\Debug\mctest.sbr (0, 2008-04-02)
monte\Debug\monte.exe (270389, 2008-04-02)
monte\Debug\monte.pdb (689152, 2008-04-02)
monte\Debug\monteint.obj (5577, 2008-04-02)
monte\Debug\monteint.sbr (0, 2008-04-02)
monte\Debug\quasi.obj (14559, 2008-04-02)
monte\Debug\quasi.sbr (0, 2008-04-02)
monte\Debug\registrar.obj (5446, 2008-04-02)
monte\Debug\registrar.sbr (0, 2008-04-02)
monte\Debug\standio.obj (20383, 2008-04-02)
monte\Debug\standio.sbr (0, 2008-04-02)
monte\Debug\stoi.obj (3402, 2008-04-02)
monte\Debug\stoi.sbr (0, 2008-04-02)
monte\Debug\vc60.pdb (69632, 2008-04-02)
monte\getargs.c (4834, 1999-08-01)
monte\getargs.h (830, 1999-08-01)
monte\Makefile (2055, 1999-08-01)
monte\mctest.cpp (2762, 2008-04-02)
monte\monte.dsp (5220, 2008-04-02)
monte\monte.dsw (535, 2008-04-02)
monte\monte.ncb (74752, 2008-04-02)
monte\monte.opt (58368, 2008-04-02)
monte\monte.plg (3385, 2008-04-02)
monte\monteint.cpp (2124, 2008-04-02)
monte\monteint.hpp (1694, 2008-04-02)
monte\quasi.cpp (4873, 2008-04-02)
monte\quasi.hpp (1450, 2008-04-02)
monte\registrar.cpp (283, 2008-04-02)
monte\registrar.hpp (705, 1999-08-01)
... ...
Monte Carlo Integrator V1.4
This class defines an object that performs a Monte Carlo integration.
The class is designed to perform the definite integral over any number
of dimensions, but a limitation in the present version of the random
number generator (see below) limits the number of dimensions to no
more than 52 (the limit of the generator itself).
The function to integrate should have the prototype:
float function(float *x);
where the array x represents a vector of point to evaluate the function
at.
The class methods:
MonteIntegrator(Function f,const int d)
Declares the integrator to work with function f
and to integrate in d dimensions. The number of dimensions
defaults to 1.
void iterations(const unsigned long int it)
Sets the number of iterations to use in the integration
(if not used, the integrator defaults to 10,000 iterations).
void minmax(const float min, const float max)
This method allows the user to inform the object of the
known minimum and maximum of the function to integrate. If
this method is not called, the object will try to determine the
exterema on its own. THIS IS AN OBSOLETE METHOD that is present
for backwards compatibility with older versions of this class,
it does not do anything.
float integral(const float a, const float b, const unsigned long it)
Does the integral between the limits a and b for
1-dimensional integrals. If the parameter it is supplied, then
that number of iterations is performed.
float integral(const float* a, const float* b,
const unsigned long it)
Does the integral between the limits a[] and b[] for
n-dimensional integrals. If the parameter it is supplied, then
that number of iterations is performed.
By changing the definition of Real in monteint.hpp to double,
the object can work with doubles instead of floats.
The Random Number generator:
The random number generator used by this class generates QUASI-RANDOM
numbers. Quasi-random numbers give up any attempt at independence of
successive values in order to obtain as uniform a coverage of the domain
as possible. This type of coverage improves the convergence rate for
Monte Carlo integration. Instead of the 1/Sqrt(N) convergence obtained
by the use of pseudo-random numbers, one gets (log(N))^d / N (slightly
slower than 1/N) convergence with quasi-random numbers (d is the number
of dimensions).
The implementation is my C++ version of the FORTRAN code described in the
Numerical Recipes column (by W.H. Press and S.A. Teukolsky) in the
Nov/Dec 1***9 (V.3 No. 6) issue.
The Quasi-random number generator is presently (V1.5) set up for generating
data in up to 52 dimensions, but this can be extended if necessary.
(see the Press and Teukolsky article for details).
Everett (Skip) Carter Phone: 408-***1-0***5 FAX: 408-394-5561
Taygeta Scientific Inc. INTERNET: skip@taygeta.com
1340 Munras Ave., Suite 223 UUCP: ...!uunet!taygeta!skip
Monterey, CA. 93940 WWW: http://www.taygeta.com/skip.html
近期下载者:
相关文件:
收藏者: