| Author |
Comment/Response |
Peter Pein
|
11/16/12 01:19am
In Response To 'Re: numerical integration and limits of integra...' --------- Hi,
this is a possibility when one knows the range of integration. To write a little function that does a correct job in any case is simple:
nintval[r_] :=
NIntegrate[f[x], {x, -r, r}, AccuracyGoal -> 8,(*(*either*)Method->
"LocalAdaptive",(*or sth. like*)*)
MinRecursion -> Ceiling@Log[1 + Abs@r]]
but in this case I would do
Integrate[f[x],{x,-r,r}]
to get
7 Sqrt[Pi/5] Erf[Sqrt[5] r]
and then write a function like:
intval[r_] := N[(7 Sqrt[\[Pi]/5] Erf[Sqrt[5] r]), {Infinity, 8}]
to get an accuracy of 8 digits.
hth,
Peter
URL: , |
|