Fractional Part - A Difficult Integral
06-29-2014, 11:36 AM
Post: #1
 Gerald H Senior Member Posts: 1,457 Joined: May 2014
Fractional Part - A Difficult Integral
Here some results for integrating FP from zero to 5.8:

Maple V Release 3.0

evalf(int(frac(x), x=0..5.8)) 2.820001887

Maxima 5.23.2

8,3171,0]

PARI 2.4.2

intnum(x=0,5.8,frac(x)) 2.770657207613055496607250297

WolframAlpha 2011-5-28

integrate(frac(x),x,0,5.8) 2.82

CASIO fx-9860GII (& fx-5800P)

∫_0^5.8▒〖Frac X〗 dx 2.72

HP 42S

Gauss-Lagrange 16 point:

Divisions: 1 2.32
2 2.71441362769
3 2.95110930932
4 2.84122268726
5 2.72066778956
6 2.8405122545

HP 50G

Inbuilt integration programme: ∫_0^5.8▒〖FP(X)〗 dX

FIX 6 2.820116 in 1,232.15 seconds

Gauss-Lobatto 4 point formula with 7 and 13 point Kronrod extensions:

FIX 2 2.80
3 2.819
4 2.8199
5 2.82000
6 2.820000 in 12.34 seconds

SHARP EL-9650

∫_0^5.8▒〖fpart X〗 dxX 2.419454779

TI-84 Plus 2.53MP

fnInt(fPart(X),X,0,5.8) 2.720014333

TI-86 (tol = 1E-5)

fnInt(fPart x,x,0,5.8) 2.71992436738

TI-89 (& voyage 200 & 92(plus))

∫_0^5.8▒〖fPart (x)〗 dx 2.72000000036
06-29-2014, 11:55 AM
Post: #2
 Massimo Gnerucci Senior Member Posts: 2,279 Joined: Dec 2013
RE: Fractional Part - A Difficult Integral
(06-29-2014 11:36 AM)Gerald H Wrote:  Here some results for integrating FP from zero to 5.8:

Another example (apart from WolframAlpha) where a pencil and paper approach is better.

Greetings,
Massimo

-+×÷ ↔ left is right and right is wrong
06-29-2014, 05:18 PM
Post: #3
 pito Member Posts: 127 Joined: Jun 2014
RE: Fractional Part - A Difficult Integral
(06-29-2014 11:36 AM)Gerald H Wrote:  Here some results for integrating FP from zero to 5.8:
WP34s:
2.819612562 after several minutes
06-29-2014, 06:17 PM
Post: #4
 kakima Junior Member Posts: 41 Joined: Dec 2013
RE: Fractional Part - A Difficult Integral
Change the upper limit to 6.4 and try evaluating with the built-in integrator on any HP calculator that has one.
06-29-2014, 06:47 PM
Post: #5
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: Fractional Part - A Difficult Integral
(06-29-2014 06:17 PM)kakima Wrote:  Change the upper limit to 6.4 and try evaluating with the built-in integrator on any HP calculator that has one.

Link for the lazy: Numerical Integration on the 35S.
This is another example where most HP-calculators fail.

Cheers
Thomas
06-29-2014, 07:57 PM
Post: #6
 Gerald H Senior Member Posts: 1,457 Joined: May 2014
RE: Fractional Part - A Difficult Integral
(06-29-2014 06:17 PM)kakima Wrote:  Change the upper limit to 6.4 and try evaluating with the built-in integrator on any HP calculator that has one.

HP 50G Gauss-Lobatto 4 point formula with 7 and 13 point Kronrod extensions:

3.0489 in 20.8 sec
06-29-2014, 09:40 PM (This post was last modified: 06-29-2014 10:36 PM by pito.)
Post: #7
 pito Member Posts: 127 Joined: Jun 2014
RE: Fractional Part - A Difficult Integral
(06-29-2014 06:47 PM)Thomas Klemm Wrote:
(06-29-2014 06:17 PM)kakima Wrote:  Change the upper limit to 6.4 and try evaluating with the built-in integrator on any HP calculator that has one.

Link for the lazy: Numerical Integration on the 35S.
This is another example where most HP-calculators fail.

Cheers
Thomas

What about to use a simple Monte Carlo method as a "pre-processor" to get a "rough estimate", ie.:

Code:
NIntegrate[x - Floor[x], {x, 0, 6.4},   Method -> {"MonteCarloRule", "Points" -> 1000}]

returns always nice results around 3.08. So we can see whether the specific "precise" integration method with some "difficult" integrands has failed or not..

PS: another example from above posts:
Code:
NIntegrate[  x*x*(x*x - 47*47)*(x*x - 88*88)*(x*x - 117*117), {x, -128, 128},   Method -> {"MonteCarloRule", "Points" -> 1000}]
gives for example results around 2.72*10^16..
06-30-2014, 01:17 PM
Post: #8
 ttw Member Posts: 229 Joined: Jun 2014
RE: Fractional Part - A Difficult Integral
Numerical integration of things like Frac(x)dx do not gain by using high-order rules (Simpson's, Gauss, etc.) because the first derivative is not continuous.

Monte Carlo (and quasi Monte Carlo) does no worse than its usual performance (which isn't that good anyway) as the variance (or variation) is small.

One QMC example is to use the points (2j-1)/2N for j=1,N as an N-point integration formula. Another is to use Frac(N*Sqrt(2)) as a sequence to integrate these types of functions.

The last sequence is easy to compute; just add Frac(Sqrt(2)) at each step and reduce below 1.
 « Next Oldest | Next Newest »

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