Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.6K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Set WorkingPrecision in NIntegrate?

Posted 8 years ago

Consider the following input:

In[1]:= c = 1.2``200; n = 7;
2/Pi NIntegrate[ChebyshevU[n, x]^2 Sqrt[1 - x^2], {x, -1, 1}, 
  WorkingPrecision -> 200]
(2 I)/(c^2 Pi) 
 NIntegrate[ ChebyshevU[n, k/(I c)]^2 Sqrt[c^2 + k^2], {k, I c, -I c},
   WorkingPrecision -> 200]

Out[2]= 1.\
0000000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000000\
000000000000000000000000000000000000000000000000000000000000

During evaluation of In[1]:= NIntegrate::precw: The precision of the \
argument function \
(\[Sqrt](1.\
4400000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000+k^2) \
((0.+<<18>> \[ImaginaryI]) k+<<2>>+(0.+<<1>>) <<1>>)^2) is less than \
WorkingPrecision (200.`). >>

Out[3]= 1.\
0000000000000000838554115034660068008817729444357599619488431719194210\
2454049745574593544006347656250000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000

These two integrals are related by a simple transformation. Why then the first integral is calculated with the prescribed accuracy, and the second is not? What to change in the code so that the second integral would also be computed with accuracy 200 digits?

3 Replies
POSTED BY: Michael Rogers

It's because Precision[c^2] is 199.778. I would set c = 12/10 (infinite precision), unless the uncertainty in c is an important consideration.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard