MaplePrimes Commons General Technical Discussions

The primary forum for technical discussions.

 

The MRB constant is evaluated by

 

with(numtheory):

f := proc (x) options operator, arrow; sum((-1)^n*(n^(1/n)-1), n = x .. infinity) end proc

proc (x) options operator, arrow; sum((-1)^n*(n^(1/n)-1), n = x .. infinity) end proc

(1)

What are the quotients  ot the  continued fration of the sum of f(1)+f(2)+f(3)+f(4)+...

Here are the  quotients  of some partial sums.

``

cfrac(evalf(sum(f(x), x = 1 .. 2)), 'quotients')

[0, 2, 1, 1, 1, 21, 10, 4, 1, 4, 8, `...`]

(2)

cfrac(evalf(sum(f(x), x = 1 .. 3)), 'quotients')

[0, 6, 1, 2, 3, 1, 1, 2, 3, 3, 24, `...`]

(3)

cfrac(evalf(sum(f(x), x = 1 .. 4)), 'quotients')

[0, 2, 1, 2, 1, 4, 2, 1, 3, 1, 1, `...`]

(4)

cfrac(evalf(sum(f(x), x = 1 .. 5)), 'quotients')

[0, 5, 1, 99, 1, 1, 1, 6, 1, 3, 1, `...`]

(5)

cfrac(evalf(sum(f(x), x = 1 .. 6)), 'quotients')

[0, 2, 1, 6, 1, 2, 1, 2, 2, 1, 1, `...`]

(6)

cfrac(evalf(sum(f(x), x = 1 .. 7)), 'quotients')

[0, 5, 1, 1, 142, 1, 1, 1, 1, 19, 1, `...`]

(7)

cfrac(evalf(sum(f(x), x = 1 .. 8)), 'quotients')

[0, 2, 1, 47, 1, 1, 1, 1, 27, 4, 1, `...`]

(8)

cfrac(evalf(sum(f(x), x = 1 .. 9)), 'quotients')

[0, 5, 5, 3, 1, 7, 1, 1, 1, 2, 1, `...`]

(9)

cfrac(evalf(sum(f(x), x = 1 .. 100)), 'quotients')

[0, 3, 1, 1, 1, 11, 2, 2, 1, 1, 4, `...`]

(10)

cfrac(evalf(sum(f(x), x = 1 .. 200)), 'quotients')

[0, 3, 1, 2, 1, 1, 1, 11, 3, 4, 6, `...`]

(11)

cfrac(evalf(sum(f(x), x = 1 .. 400)), 'quotients')

[0, 3, 1, 3, 3, 3, 1, 18, 1, 2, 1, `...`]

(12)

cfrac(evalf(sum(f(x), x = 1 .. 800)), 'quotients')

[0, 3, 1, 3, 1, 4, 16, 14, 3, 23, 2, `...`]

(13)

cfrac(evalf(sum(f(x), x = 1 .. 1600)), 'quotients')

[0, 3, 1, 4, 7, 4, 436, 1, 1, 1, 2, `...`]

(14)

``

Here are the quotients of the  continued fration  of the sum. 

cfrac(evalf(sum(f(x), x = 1 .. infinity)), 'quotients')

[0, 3, 1, 4, 1, 1, 1, 1, 1, 9, 1, `...`]

(15)

With the exception of the leading 0, that is close to the integer squence of pi.

``evalf((65241/65251)*Pi)

3.141111191

(16)

The exponents of 2 that sum the numerator and denominator, in the following way, of that multiple of pi give rise to the integer sequences {0,1,2,3,8,16},numbers such that floor[a(n)^2 / 7] is a square, and {0,2,3,4,8,16},{0,3} union powers of 2.

evalf((2^16-2^8-2^5-2^2-2-2^0)*Pi/(2^16-2^8-2^4-2^3-2^2-2^0))

3.141111191

(17)

We can do the same thing for the first 20 quotients giving rise to the integer sequences {0,1,2,5,6,8,10,13,17,19,22,23,24,28,31} and {0,4,6,9,12, 14,15,16,18,22, 23,24,28,31}. What can be said of these sequences?

cfrac(evalf(sum(f(x), x = 1 .. infinity), 20), 20, 'quotients')``

[0, 3, 1, 4, 1, 1, 1, 1, 1, 9, 1, 3, 1, 2, 1, 1, 1, 5, 1, 3, 11, `...`]

(18)

evalf((1849023129/1849306543)*Pi, 20)

3.1411111913121115131

(19)

````

evalf((2^31-2^28-2^24-2^23-2^22-2^19-2^17-2^13-2^10-2^8-2^6-2^5-2^2-2-2^0)*Pi/(2^31-2^28-2^24-2^23-2^22-2^18-2^16-2^15-2^14-2^12-2^9-2^6-2^4-2^0), 20)

3.1411111913121115131

(20)

``


 

Starting from Maple 15, the useful ?plottools/getdata command is added. It tansforms a Maple plot to a Matrix. Unfortunately, the getdata command deals only with Maple plots. The question arises: "How to get a data from bmp, jpg, tiff, pcx, gif, png and wmf formats?" This is used in medicine and engineering. Such question was asked here

The*MRB*constant = sum((-1)^n*(n^(1/n)-1), n = 1 .. infinity) and sum((-1)^n*(n^(1/n)-1), n = 1 .. infinity) = sum((-1)^n*(n^(1/n)-1), n = 2 .. infinity)

But what can we say about

 (∏)(-1)^(n)*(n^(1/(n))-1)?

``

``

Maple does not evaluate it:

evalf(product((-1)^n*(n^(1/n)-1), n = 2 .. infinity))

product: Cannot show that (-1)^n*(n^(1/n)-1) has no zeros on [2,infinity] product((-1)^n*(n^(1/n)-1), n = 2 .. infinity)

(1)

And perhaps it should not because of the alternating sign;

evalf(product((-1)^n*(n^(1/n)-1), n = 2 .. 10^2))

-0.3908773173e-101

(2)

evalf(product((-1)^n*(n^(1/n)-1), n = 2 .. 10^3))

-0.7676360791e-1799

(3)

evalf(product((-1)^n*(n^(1/n)-1), n = 2 .. 10^3+1))

0.5316437097e-1801

(4)

``

 

Download 3232012.mw

If you use all the convergents of the simple continued fraction of the MRB constant as the terms of a generalized continued fraction, then likewise use the new convergents in another generalized continued fraction, and so on... you arrive at 0.5557531....  For more on this process see https://oeis.org/wiki/Convergents_constant .

If there are still doubts to support "long double" in evalhf then there is one more argument to implement them in at least those machines that support it:
CalcInEvalhfFast.mw

P.S. In that well-known holy war about long double supporting in compilers i'm rather on side of "to support them" than on side of (stupid) microsoft visual c++ compiler.

Suppose that you wish to animate the whole view of a plot. By whole view, I mean that it includes the axes and is not just a rotation of a plotted object such as a surface.

One simple way to do this is to call plots:-animate (or plots:-display on a list of plots supplied in a list, with its `insequence=true` option). The option `orientation` would contain the parameter that governs the animation (or generates the sequence).

But that entails recreating the same plot each time. The plot data might not even change. The key thing that changes is the ORIENTATION() descriptor within each 3d plot object in the reulting data structure. So this is inefficient in two key ways, in the worst case scenario.

1) It may even compute the plot's numeric results, as many times as there are frames in the resulting animation.

2) It stores as many instances of the grid of computed numeric data as there are frames.

We'd like to do better, if possible, reducing down to a single computation of the data, and a single instance of storage of a grid of data.

To keep this understandable, I'll consider the simple case of plotting a single 3d surface. More complicated cases can be handled with revisions to the techniques.

Avoiding problem 1) can be done in more than one way. Instead of plotting an expression, a procedure could be plotted, where that procedure has `option remember` so that it automatically stores computed results an immediately returns precomputed stored result when the arguments (x and y values) have been used already.

Another way to avoid problem 1) is to generate the unrotated plot once, and then to use plottools:-rotate to generate the other grids without necessitating recomputation of the surface. But this rotates only objects in the plot, and does alter the view of the axes.

But both 1) and 2) can be solved together by simply re-using the grid of computed data from an initial plot3d call, and then constructing each frame's plot data structure component "manually". The only thing that has to change, in each, is the ORIENTATION(...) subobject.

At 300 frames, the difference in the following example (Intel i7, Windows 7 Pro 64bit, Maple 15.01) is a 10-fold speedup and a seven-fold reduction is memory allocation, for the creation of the animation structure. I'm not inlining all the plots into this post, as they all look the same.

restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

plots:-animate(plot3d,[P,x=-5..5,y=-5..5,orientation=[A,45,45],
                       axes=normal,labels=[x,y,z]],
               A=0..360,frames=300);

time()-st,kernelopts(bytesalloc)-ba;

                                1.217, 25685408
restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

g:=plot3d(P,x=-5..5,y=-5..5,orientation=[-47,666,-47],
          axes=normal,labels=[x,y,z]):

plots:-display([seq(PLOT3D(GRID(op([1,1..2],g),op([1,3],g)),
                           remove(type,[op(g)],
                                  specfunc(anything,{GRID,ORIENTATION}))[],
                           ORIENTATION(A,45,45)),
                    A=0..360,360.0/300)],
               insequence=true);

time()-st,kernelopts(bytesalloc)-ba;

                                0.125, 3538296

By creating the entire animation data structure manually, we can get a further factor of 3 improvement in speed and a further factor of 3 reduction in memory allocation.

restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

g:=plot3d(P,x=-5..5,y=-5..5,orientation=[-47,666,-47],
          axes=normal,labels=[x,y,z]):

PLOT3D(ANIMATE(seq([GRID(op([1,1..2],g),op([1,3],g)),
                           remove(type,[op(g)],
                                  specfunc(anything,{GRID,ORIENTATION}))[],
                           ORIENTATION(A,45,45)],
                    A=0..360,360.0/300)));

time()-st,kernelopts(bytesalloc)-ba;

                                0.046, 1179432                            

Unfortunately, control over the orientation is missing from Plot Components, otherwise such an "animation" could be programmed into a Button. That might be a nice functionality improvement, although it wouldn't be very nice unless accompanied by a way to export all a Plot Component's views to GIF (or mpeg!).

The above example produces animations each of 300 frames. Here's a 60-frame version:


Let c=MRB constant -1/2

 

 

 

``

restart; Digits := 64

``

 

````Define s as the following function involving a divergent series.

s := proc (x) options operator, arrow; sum((-1)^n*n^(1/n), n = 1 .. x) end proc

proc (x) options operator, arrow; sum((-1)^n*n^(1/n), n = 1 .. x) end proc

(1)

``

``

 

 

``The upper limit point of the partial sums, of s is very slowly convergent.

evalf(s(100))

.211329543346941069485035868216520490712148674852018130412747187

(2)

evalf(s(1000))

.191323989712141370638688981469071803275457219110707245455878532

(3)

evalf(s(10000))

.188320351076950504638897789942367214051161086517598649780487746

(4)

 

``

Let mrb be tthe upper limit point of s as x goes to infinity.

``

mrb := evalf(sum((-1)^n*(n^(1/n)-1), n = 1 .. infinity))

.1878596424620671202485179340542732300559030949001387861720046841

(5)

``

``

``

 

Define f as the following function involving the divergnet series sum((-1)^n*(n^(a/n)-a), n = 1 .. infinity).NULL

``

``

f := proc (a) options operator, arrow; sum((-1)^n*(n^(a/n)-a), n = 1 .. infinity) end proc

proc (a) options operator, arrow; sum((-1)^n*(n^(a/n)-a), n = 1 .. infinity) end proc

(6)

``

``

 

 

``Let c be the value for a in the neighborhood of 26 such that f(a)=mrb.

c := fsolve(eval(f(x)) = mrb, x = 26)

25.71864739101744668471488151161460875040712539231550975094037406

(7)

``

``

 

``The average of the upper and lower limit points of the partil sums of f converges much faster than the  upper limit point of the partial sums of s.

evalf((sum((-1)^n*(n^(c/n)-c), n = 1 .. 100)+sum((-1)^n*(n^(c/n)-c), n = 1 .. 101))*(1/2))

.195238896203546569611605945649919224928195587923897718988014700

(8)

evalf((sum((-1)^n*(n^(c/n)-c), n = 1 .. 1000)+sum((-1)^n*(n^(c/n)-c), n = 1 .. 1001))*(1/2))

.187904922391719396683391551158554482265830937732923110694243700

(9)

evalf((sum((-1)^n*(n^(c/n)-c), n = 1 .. 10000)+sum((-1)^n*(n^(c/n)-c), n = 1 .. 10001))*(1/2))

.187860182910509428926222275077446745338505139578191116998518780

(10)

 

Download Jan72012.mw

If I'm not mistaken Maple already had technical interactive documents.  And Mathematica introduced cdf only in mid 2011, however why is there so much hype about cdf and media coverage about it replacing pdf's.  Of course it differs by one letter and probably done so by design.  And if pdf is so popular, then so might cdf be in the future.  Pretty slick and trick marketing by Wolfram if you ask me. 

Also Maple released the maple Player in...

 


NULL

NULL

Let f(c)= sum((-1)^n*(n^(c/n)-c), n = 1 .. infinity)

NULL

NULL

Then f(1) = the MRB constant:

evalf(eval(sum((-1)^n*(n^(c/n)-c), n = 1 .. infinity), c = 1)) = .1878596425NULL

NULL

NULL

What if we change the value of c and use Levin's u-transform to compute the values for the analytic extension of the sum?

Then can we find values for c such that f(c)=c?

 

evalf(eval(sum((-1)^n*(n^(c/n)-c), n = 1 .. infinity), c = -1.351776595077954)) = -1.351776595 

evalf(eval(sum((-1)^n*(n^(c/n)-c), n = 1 .. infinity), c = 7.020400867228059)) = 7.020400867

evalf(eval(sum((-1)^n*(n^(c/n)-c), n = 1 .. infinity), c = 25.58774196597964)) = 25.58880851

``

As an alalytic extension of the sum is there another value for c such that f(c) = the MRB constant? I haven't found one.

NULL

 

 

``


Download jan022012.mw

 

 

``

I wanted to set the background color of a plot to black (without axes shown) and figured I could add this to the PLOT structure: POLYGONS([[10,0],[0,0],[0,10],[10,10]],COLOUR(RGB, 0., 0., 0.))

And that worked fine. But I feel that it ought to be easier.

Here's an example exhibited by Nusc, which I have tweaked slightly to make it look more like your mathematica example.

### Reference: http://www.mapleprimes.com/questions/36580-Bifurcation-Diagram

### xexpr is the logistic function to be iterated (we always start off at x=1/2, which will eventually attract).
### [ra,rb] is the range of the parameter.
### acc is the number of points sampled in [ra,rb]

Bifurcation := proc(initialpoint,xexpr,ra,rb,acc)

It is possible to thicken the axes of 2D plots by adjusting the underlying data structure, since the appropriately placed THICKNESS() call within the PLOT() data structure is recognized by the Standard GUI. This does not seem to be recognized for PLOT3D structures, however.

The issue of obtaining thicker axes for 2D plots can then be resolved by first creating a plot, and then subsequently modifying the PLOT structure.

The same techniques could be used to thin...

First 9 10 11 12 13 14 15 Last Page 11 of 75