Re: First and second derivative

From: parada hutauruk <p.hutauruk_at_physics.gla.ac.uk>
Date: Sat, 17 Jan 2009 01:20:41 +0000


Hi Lorenzo,

Thank you very much.
I got it now.

Cheers,
Parada

Lorenzo Moneta wrote:
> Hi Parada,
>
> You need to pass the function to be differentiated to the Derivator
> class. you can see this example
>
> http://root.cern.ch/drupal/content/function-derivation
>
> Best Regards
>
> Lorenzo
> On Jan 15, 2009, at 6:32 PM, Paraduan Hutauruk wrote:
>
>> Dear all,
>>
>> Does anyone know the command for first and second derivative of a
>> function?
>> I tried to wrote code for first derivative using
>> ROOT::Math::Derivator(), but i got some error message. Could anyone
>> let me know where is the mistake please? or guide me to right way?.
>> #include "Math/SpecFunc.h"
>> #include "TTree.h"
>> #include "TFile.h"
>> #include "TNtupleD.h"
>>
>> #include"Math/Derivator.h"
>>
>> const int LMAX=4;
>> double par[] ={1,1,1,1};
>> double x=1;
>> double cros_mul(double *par , double x )
>> {
>> double func=0;
>> for (int L=0; L<=LMAX ; L++)
>> {
>> int L2 =L+1;
>> func +=
>> par[L]*ROOT::Math::Derivator::ROOT::Math::assoc_legendre(L2,0,x) ;
>> }
>> return func; }
>>
>> Many thanks for help
>> Regards,
>> Parada
>>
>
Received on Sat Jan 17 2009 - 02:20:50 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 19 2009 - 23:50:01 CET