Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16655

NIntegrate and double integral -- very slow

From bluesaturn <bluesaturn.at.kellnerweg.de@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject NIntegrate and double integral -- very slow
Date 2014-03-15 07:52 +0000
Message-ID <lg10rm$517$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Dear all
I am trying to model something. This involves oscillating function 
(BesselJ0, BesselJ1) over that I have to integrate. An example is shown 
below.
Mathematica is not able to manage to calculate the last three lines, not 
even overnight (12-14h). I don't think there is a simple analytical 
solution that is why I tried the numerical approach.
How can I speed up the calculations, please?  For example the line with 
the Table-Command. Ideally I would like to have more than just 26 points.

Thank you for your feedback.
Kind regards
B.




%%%%%%%%%%%%%%%%%%%%%%% Example code

formfactorrodx[q_, alpha_] :=
  lengthcylinder*Sinc[q*alpha*lengthcylinder/2]*rhoRodcontrast*2*Pi*
   acylinder*BesselJ[1, q*acylinder*Sqrt[1 - alpha^2]]/(q*Sqrt[1 - alpha^2])

nx[rcx_] := ((2*Abs[beta])/(kappanormal*rcx*Cos[beta*Log[rcx/RM]]))^2*
    nR0;

formfactorcounterionx[q_, alpha_, rcx_] :=
   lengthcylinder*Sinc[q*alpha*lengthcylinder/2]*rhoPBsolvent*nx[rcx]*
    BesselJ[0, q*rcx*Sqrt[1 – alpha^2]]*2*Pi*rcx;


intensityRodCounterions[q_?NumericQ] :=
   NIntegrate[
    2*fp*formfactorcounterionx[q, alpha, rcx]*
     formfactorrodx[q, alpha], {rcx, acylinder, router}, {alpha, 0,
     1 - chiint}, Method -> {"MonteCarlo", "MaxPoints" -> 10^10}];


Table[intensityRodCounterions[1*10^(-1)*10^(9)*i], {i, 26}]

ListLinePlot[
  Table[intensityRodCounterions[q], {q, 1*^-1*1*^9, 2.6*1*^9, 26}]]

LogLogPlot[intensityRodCounterions[q], {q, 1*^-1*1*^9, 2.6*1*^9}]

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar


Thread

NIntegrate and double integral -- very slow bluesaturn <bluesaturn.at.kellnerweg.de@gmail.com> - 2014-03-15 07:52 +0000
  Re: NIntegrate and double integral -- very slow "Kevin J. McCann" <kjm@KevinMcCann.com> - 2014-03-17 06:26 +0000

csiph-web