Post Reply 
[VA] SRC#001 - Spiky Integral
07-20-2018, 08:06 PM (This post was last modified: 07-21-2018 03:41 AM by Albert Chan.)
Post: #38
RE: [VA] SRC#001 - Spiky Integral
(07-18-2018 03:07 AM)Gerson W. Barbosa Wrote:  would you please check how many significant digits I get right for N=20000?

3.06979593309e-6

Let F= cos(x) cos(2x) cos(3x) ... cos(N x)

Since N mod 4 = 20000 mod 4 = 0, I(N) = \(\int_{0}^{2 \pi} F dx \) = 4 \(\int_{0}^{\pi/2} F dx \)

For big N, integral is dominated mostly by the area of spike:

I(N) ~ 4 \(\int_{0}^{\pi /(2N)} F dx \)

I did the integral in Python (plain float):

I(20000) ~ 4 * 7.67448983276e-07 = 3.0697959331e-06

Both values agreed each other, to 11 digits.

Comment:
it is not necessary to sum the full spike area.
For x = Pi / (20N) (one tenth of spike base), F = 1.547e-36, which contribution little to the sum.
With this tighter base, I(20000) still converge to the same value, but only take 16 sec (instead of 145 sec)

BTW, my computer is 20+ years old Dell P3, modern computer may only take few seconds.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC#001 - Spiky Integral - pier4r - 07-11-2018, 11:10 AM
RE: [VA] SRC#001 - Spiky Integral - Pjwum - 07-12-2018, 10:32 AM
RE: [VA] SRC#001 - Spiky Integral - DavidM - 07-15-2018, 07:53 PM
RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-20-2018 08:06 PM
RE: [VA] SRC#001 - Spiky Integral - Werner - 07-18-2018, 06:17 AM



User(s) browsing this thread: 1 Guest(s)