Post Reply 
Sharp EL-W506T vs. Sharp EL-W516T
02-01-2020, 12:20 PM (This post was last modified: 02-01-2020 12:44 PM by Mjim.)
Post: #35
RE: Sharp EL-W506T vs. Sharp EL-W516T
(01-31-2020 12:46 PM)Albert Chan Wrote:  How about shifting the curve, for any integrand, say f(x)

\(\int _a ^b f(x) dx = \int _1 ^{b-a+1} f(y + (a-1)) dy = \int _0 ^{\log(b-a+1)} f(e^z + (a-1)) e^z dz \)

XCas> [a, b, c] := [6.371e6, 9.4607304725808e15, 3.98589196e17]
XCas> f(r) := c/r^2
XCas> integrate(f(e^z + (a-1)) * e^z, z = 0 .. log(b-a+1))         → 62563050656.3

Try plotting this. It look like normal distribution curve ! Smile

Code:
n       simpsons
2       88521044629
4       23319253438
8       55920947081
16      66807272619
32      62510235388
64      62563085106
128     62563050656
256     62563050656
512     62563050656
1024    62563050656

It took me a bit of time to see why what you did resulted in a much better result. Looks like a pretty good fit for this equation, and I'm guessing any big number integral where you have a sharp downward slope near the start.

I found this pretty educational, so thanks for the work you did!

My fx-CG50 got it's first real usage since purchasing it December last year:
[Image: pk8FYag.png]

Just if anyone else is interested (and also to help myself process it a bit better), this is my take on why these changes Albert made worked so well.

First the graphs don't look like what you expect (well the 2nd one especially), because Albert used substitution of the integral to turn the x-axis logarithmic instead of linear. Both of these graphs give a much better result than the original equation, but I'll look at why I think the 2nd log equation does much better than the 1st log equation.

The shaded areas represent the energy required to lift a 1000kg mass from the surface of the earth to 2 radius's out (0 -> 6371km above the surface), assuming a really simple model with no atmosphere or any other forces aside from the gravity of earth. If we were to shade the pink graph in fully and the green graph from 15.667 to the end, this would represent the energy needed to move that mass ~ 1 light year.

The green shaded area represents the e^x integral substitution without shifting the equation, while the pink shaded area represents the e^x integral substitution after first shifting the graph to the left so that 0 represents being on the surface, rather than 6,371km (Earth's radius).

As can be seen shifting the graph results in a normal distribution looking curve, but as a nice benefit the pink area, is spread out over a much larger domain (0 -> 15.667), than the same area of green (15.667 -> 16.36), meaning that more Simpson integration divisions cover the same amount of area on pink, improving the algorithms accuracy with this problematic equation.

I *think* that the big change in the pink (aka shifted) graph is mostly due to moving the earths radius (equivalent to e^15.667) into the denominator and squaring it. Since we are starting at 0, e^x starts at 1 initially. This makes the denominator much larger and so the output from this equation is much smaller than the green graph (which goes well above and out of view of what is shown here). By the time you get to ~20 on the x-axis (or a bit further than the moon), the e^15.667 that is squared is no longer a significant contributor in the denominator compared to e^x squared, so we see both graphs become more and more similar towards the end.

From this you can see why this equation is a problem for the Simpson method of integration used in the Sharp. Most of the energy is needed during a very small portion of the overall distance, and so using the Simpson algorithm results in a very low accuracy if we use say, 512 divisions over 1 light year, which equates to a single division being used to cover the distance travelled from the surface of the earth to ~3x the distance of Pluto, leading to those crazy figures that were many magnitudes off, as seen on some of the earlier posts in this thread.

Both equations integrate to around 36/37 (this is the natural log of 1 light year in metres), the reason there isn't much variation at the end is that subtracting the earth's radius and adding 1 metre doesn't make much of a dent on 1 light year.

The shifted equation though starts at 0 though instead of 15.667 (natural log of earths radius). Technically you are spreading the divisions used for the Simpson algorithm over nearly twice the integration length, but it appears to me likely that if you were to squash that area into the same integration length as the first green area equation, the peak would still only probably reach about half the height of the non-shifted equation, and the area would still be better distributed.

I'm still not quite sure exactly how it all fits together, this is just my own explanation to myself of what is happening, so errors are expected as well as mistakes and misinterpretations!
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 - Mjim - 02-01-2020 12:20 PM



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