Re: Integration of the oscillating function

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 13 Dec 2006 11:11:12 +0100


Andrei,

The besselJ0 (and others) functions are available in TMath. You can compute these functions,
their integral, and draw them. See an example below

Rene Brun

void J0() {

   //example showing a BesselJ0(x) function and its integral   

   TF1 *f1 = new TF1("f1","TMath::BesselJ0(x)",-1,6);    TCanvas *c1 = new TCanvas("c1","c1",800,1000);

   c1->Divide(1,2);
   c1->cd(1);
   f1->Draw();
   c1->cd(2);

   //see doc of TF1::Integral and TF1::Absvalue    TF1::AbsValue(kTRUE);
   f1->DrawIntegral();
}

Lorenzo Moneta wrote:
> Hi Andrey,
>
> currently in ROOT there is no method for an oscillatory function.
> There is one in GSL, see
>
>
> http://www.gnu.org/software/gsl/manual/html_node/QAWO-adaptive-integration-for-oscillatory-functions.html
>
>
> but is not yet implemented in the Integrator class of MathMore. If
> needed, I could add it for the next ROOT release.
>
> However if you want just to integrate the Bessel function, analytical
> formula exist in terms of other functions, for example for J0(z) see
>
> http://functions.wolfram.com/BesselAiryStruveFunctions/BesselJ/21/01/01/0003/
>
>
> also a J0(z) can be approximate for large z values as:
>
> cyl_bessel_j(0,z) ~ sqrt(2.0/( PI*x) ) * cos(x- PI/4 )
>
> Cheers
>
> Lorenzo
>
>
> On Dec 12, 2006, at 5:23 PM, andreyk1_at_post.tau.ac.il wrote:
>
>>
>> Dear Rooters!
>>
>> I have to perform a calculation of the integral of oscillating
>> function, namely
>> J0(z) (Bessel J0). How should I integrate it (in this case the
>> integration is
>> over "z" variable) in order to obtain a proper result?
>>
>> For example, in Matematica there is a method of integration which is
>> called
>> "Oscillatory method" which allows to integrate such oscillating
>> functions.
>>
>> *I use TF1 class with "IntegralMultiple" function
>> --Sincerely,
>>
>> Andrey K.
>>
>> *************************************************************
>> * Andrey Kormilitsin * *
>> * * *
>> * Department of * *
>> * Particle Physics * *
>> * School of Physics * Tel: ++ 972- 3 - 640 7954 (o) *
>> * Tel Aviv University * *
>> * Ramat Aviv,Tel Aviv * E-mail: andreyk1_at_post.tau.ac.il *
>> * 69978, ISRAEL * *
>> * * *
>> *************************************************************
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
Received on Wed Dec 13 2006 - 11:11:23 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET