Re: New package proposal: Math_Calculus

From: Date: Sat, 17 May 2003 14:02:51 +0000
Subject: Re: New package proposal: Math_Calculus
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16406@lists.php.net to get a copy of this message
On Friday 16 May 2003 23:45, you wrote: > The class looks OK for simple functions withouth many singular points. > As it stands now, I would not recommend its inclusion in PEAR: -1 Ok. > 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? Math_Numerical looks good, but then we need many method's with it, but I'll look how I can implement all useful Numerical Alogrithms with PHP ;-) > 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 Yes, that's true. The version I posted was the work of very few hours, just for solving a problem I had. Therefore it worked. Then I saw there's no such thing for PEAR so I wrote some comments to see the reactions, imho it don't make sense spending hours of work if nobody wants it ;-) > 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. The links look really interesting. All have a closer look over these an improve my code. > 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. Romberg'smethod was the one I've found most implementations for and the one I've understood easily ;-) > 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. Yes... > 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. If I'm going to implement all of them I'll never be bored again. And if I'm still bored I can implement it using BCMath, GMP and PEAR Math_Complex. ;-) johannes

« previous php.pear.dev (#16406) next »