[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? 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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)