3
$\begingroup$

I am trying to integrate the following :

θ=π/20.0;
q=.3;g=0.05;v=5;w=.2;Z=2;
 NIntegrate[Integrate[BesselJ[0,x
 *Sin[θ]]*Exp[-x*Cos[θ]],{x,0.0,q*v*t}]
 *Exp[-g*t/2]*Cos[w*t]/t,{t,0.0,∞},
 PrecisionGoal ->12,WorkingPrecision->12]

I am getting a lot of errors, related to MaxPrecision. Though I set the WorkingPrecision to 12, it tells me that it ran to MaxPrecision $20$. I tried modifying the numerical limits also, but it did not change anything.

$\endgroup$
3
$\begingroup$

Using Integrate inside NIntegrate is pointless, since the result is numerical anyways. I'd suggest:

\[Theta] = \[Pi]/20;
q = 3/10; g = 5/100; v = 5; w = 2/10; Z = 2;
int[t_?NumericQ] := NIntegrate[BesselJ[0, x*Sin[\[Theta]]]*Exp[-x*Cos[\[Theta]]],{x, 0, q*v*t}]
NIntegrate[int[t]*Exp[-g*t/2]*Cos[w*t]/t, {t, 0, \[Infinity]}, PrecisionGoal -> 12]

Specify your constants as exact numbers to reduce round off error, and when you want precision 12, working precision should be more than that. The standard 15.9546 seems to be fine.

$\endgroup$
  • $\begingroup$ Thanks for your answer, I was missing the point in the way I was trying to perform the numerical integration, you helped me get it clear. $\endgroup$ – Francisco Jun 18 '15 at 13:57
  • $\begingroup$ @Francisco if you agree that Coolwater's answer addressed your issue, you should consider accepting it. You can do so by clicking on the grey checkmark beside the answer. $\endgroup$ – MarcoB Jun 19 '15 at 3:05
  • $\begingroup$ Sorry for that, I didn't know. $\endgroup$ – Francisco Jun 23 '15 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.