Post Reply 
Sharp EL-W506T vs. Sharp EL-W516T
01-30-2020, 02:44 PM (This post was last modified: 01-30-2020 02:45 PM by Albert Chan.)
Post: #32
RE: Sharp EL-W506T vs. Sharp EL-W516T
(11-20-2019 12:25 AM)Mjim Wrote:  I tried breaking up the integral and managed to get a better result on the Sharp using the default sample rate of n=100:

(C = G*mE*1000 = 3.98589*10^17, r = distance to center of earth (and what we are integrating with respect to), c = speed of light)

integral(C/r^2, 6.371*10^6, c/10) +
integral(C/r^2, c/10, c) +
integral(C/r^2, c, 10c) +
integral(C/r^2, 10c, 100c) +
integral(C/r^2, 100c, 1000c) +
integral(C/r^2, 1000c, 3600c) + (3600c = 1 light hour)
integral(C/r^2, 3600c, 3600c*24) + (3600c*24 = 1 light day)
integral(C/r^2, 3600c*24, 3600c*24*10) +
integral(C/r^2, 3600c*24*10, 3600c*24*100)+
integral(C/r^2, 3600c*24*100, 3600c*24*365.25) (3600c*24*365.25 = 1 light year)
= 6.256305944*10^10

Of course, easiest way is ∫ C/r^2 dr = -C/r + constant
With C=3.98589196e+17, and dr integral limit, a=6.371e6, b=9.4607304725808e+15

∫ (C/r^2 dr, r=a to b) = (-C/b) - (-C/a) ≈ 62563050656

Simpson's rule using your idea, we can automate it:

r = e^x → dr = e^x dx

∫ C/r^2 dr = ∫ C/e^x dx

dx integral (evenly spaced points) = dr integral (exponential scaled points).

Code:
n   Simpson's rule: ∫ C/e^x dx, x = log(a) to log(b)
2      220230813472
4      112353290079
8       71413173487
16      63433168508
32      62625715827
64      62567118731
128     62563307380
256     62563066741
512     62563051662
1024    62563050719
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Sharp EL-W506T vs. Sharp EL-W516T - Albert Chan - 01-30-2020 02:44 PM



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