Post Reply 
Sharp EL-W506T vs. Sharp EL-W516T
02-02-2020, 03:25 AM (This post was last modified: 02-02-2020 04:00 AM by Mjim.)
Post: #37
RE: Sharp EL-W506T vs. Sharp EL-W516T
(02-01-2020 09:38 PM)Albert Chan Wrote:  "Integration length" does not matter. Only the shape of curve matters.
In other words, with the same shape, scaling does nothing to area convergence.

I guess what I was trying to get at was that the newer pink graph would still require a bigger change in x to cover the same area as green (that was what I was trying to show in the first picture), so you would have the same area spread over more Simpson divisions which should improve the accuracy.

Though the scaling thing you mentioned is something I wasn't aware of until you bought it up. After a few tests on the Sharp (\(\large e^\frac{x}{2}, e^{10x} \) and the normalized versions) I can see what you mean. Stretching, compressing or normalizing the graph doesn't change the algorithm accuracy at all. That came as a surprise, though makes more sense now seeing as the Simpson n-divisions still have the exact same portion of the graph regardless of the scaling on the x-axis.

Anyway, I appreciate the correction, I'll need to figure out what to do with the original post, or just mark the bits that are wrong or not clear.

(02-01-2020 09:38 PM)Albert Chan Wrote:  For fair comparison, we should normalize the plots with same base, say 0 to 1.

\(\int _a ^b f(x) dx = \int _0 ^1 (b-a) f(a + (b-a)x) dx \)

XCas> t(f, low, high) := (high-low) * f(low + x*(high-low))
XCas> t1 := t(x -> c/e^x, log(a), log(b))
XCas> t2 := t(x -> c*e^x / (e^x+a-1)^2, 0, log(b-a+1))
XCas> [a, b, c] := [6.371e6, 9.4607304725808e15, 3.98589196e17]
XCas> plot([t1,t2], x=0..1, color=[green, magenta])

If done correctly, both curve plots should have the same area.

My guess t2 converge faster is because it is flatter, curve get better quadratic fit.

I'm trying out that forum mathprint here after looking at your posts Smile

Variables:
\(a = 6.371*10^{6} m \)

\(b = 9.4607304725808*10^{15} m \)

\(C = 3.98589196*10^{17} \frac{kg*m^3}{s^2} (1000kg*Earths.mass*Gravity.constant ) \)

Original equation: \(\large \int_a^b \frac{C}{r^2} dr \)

1st log scale version: \(\large \int_{ln(a)}^{ln(b)} \frac{C}{e^x} dx \)

2nd (shifted) log scale version: \(\large \int_{0}^{ln(b-a+1)} \frac{C*e^x}{(e^x+(a-1))^2} dx \)

Normalized versions:

Original: \(\large \int_0^1 \frac{C(b-a)}{(a+z(b-a))^2} dz \)

1st log scale version: \(\large \int_{0}^{1} \frac{C(ln(b)-ln(a))}{e^{ln(a)+z(ln(b)-ln(a))}} dz \)

2nd (shifted) log scale version: \(\large \int_{0}^{1} \frac{C*ln(b-a+1)*e^{z*ln(b-a+1)}}{(e^{z*ln(b-a+1)}+(a-1))^2} dz \)

And here is the normalized graphs for the original equation, and the 1st and 2nd log versions (yeah, the first equation (black line) is a super thin and very tall):
[Image: luyT4Z3.png]
Since the height of the normalized original equation can't be seen, I got it's numerical value of the peak from x=0, which you can see at the bottom.

When placing the graphs like this, it still looks like the red graph (shifted & normalized) has its area a bit better spread out (which I think will still help a bit with the number of Simpson divisions required to converge), though with how quickly your second equation converges, it does makes sense that the quadratic curves used in the Simpson algorithm may fit the second graph a lot better, meaning less Simpson divisions are required to get similar accuracy.

If it seems like I'm finding this more interesting than expected, it is because I'm still learning, so it's all pretty new (I'm only a small way through Calculus 2). I didn't know how to normalize integrals until you showed me how to...and as a result I have a better understanding of what is actually meant by "normalizing".

Thanks once again for your input!
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-02-2020 03:25 AM



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