Re: New package proposal: Math_Calculus
| From: | Jesus M. Castagnetto | Date: | Fri, 16 May 2003 21:45:44 +0000 |
| Subject: | Re: New package proposal: Math_Calculus | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16384@lists.php.net to get a copy of this message | ||
The class looks OK for simple functions withouth many singular points.
As it stands now, I would not recommend its inclusion in PEAR: -1
The problems are:
1) The name of the class: Perhaps you will be better of having 2 or more
Math_Numerical_Differentiation, Math_Numerical_Integration, etc. Or how about a
Math_Numerical (or Math_NumericalMethod or Math_NumericalSolution?) class that
works as facade to the ones implementing the algorithms?
2) The implementation of your differentiation function, if you are handed a
non-continuous function, then you will be in trouble using the simple approach,
w/o previously testing for continuity in the interval where you are calculating
the derivative. A look at: http://lib-www.lanl.gov/numerical/index.html,
and in
particular at: http://lib-www.lanl.gov/numerical/bookfpdf/f5-7.pdf,
will surely
help in this respect. Might also need to be careful not to generate an floating
point overflow.
3) The implementation of the Romberg's integration method tries to minimize
errors by using iterations of the trapezoidal rule. But for analytical
functions, you might be better using other approaches.
4) The method that finds point of a function where the derivative is zero is
OK, but it is of no use if it is not coupled with one that find the extrema
(minima and maxima). Also, if might be better named findZeroDerivative()
instead. Of course you will need to define a second derivative method for the
extrema.
Overall the idea is good. The implementation needs some work. For example, a
stable and reliable differentiation package could be use to solve funding the
roots of an equations using any of the well-known methods (e.g.
Newton-Raphson's).
The URL mentioned above has a lot of great numerical recipes. And as we cannot
add GSL to PECL due to licensing conflicts, perhaps implementing them in PHP
would be nice.
--- Johannes Schlueter <phpng@schlueters.de> wrote:
> Hi,
>
> I've wrote a PHP class numeric integration and derivation. Additionaly it
> offers a method for searching for nulls.
>
> Documentation, at the moment, only as PHPDoc and a PHPUnit-Unit-Test-Script.
>
> Source: http://www.schlueters.de/test/Calculus.phps
> Unit-Test: http://www.schlueters.de/test/Calculus_test.phps
>
> Any votes please ;-)
>
> johannes
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
Research:
http://metallo.scripps.edu/
Personal: http://www.castagnetto.org/
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com