acer

32722 Reputation

29 Badges

20 years, 85 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@JacquesC Interesting. I only use the cloud to share stuff that needs Components, is otherwise worksheet-centric, or is less critical. It's... handy.

For serious code I use a revision control system (even at home). And that means Maple code too. But I want useful "diffs", and a revision control system in which I can resolve code differences in a text editor. These are super strong reasons for keeping my code in plaintext files, and not worksheets.

Of course, other important reasons to keep Maple code in plaintext files include the fact that only Maple's  GUI reads 'em. And, more crucial, that worksheets can get corrupted. (See recent posts here for examples of that.)

I see it that there are two things to share: GUI documents or apps with Components, and code/procedures. The tasks of sharing either of those two classes are quite different. I like the Cloud for the former.

On the other hand, I think that source code should be shared amongst individuals as plaintext and be multiply accessed amongst sessions via .mla archive or via $include directives. There have been no developments with code edit regions, inter-Worksheet referencing, etc, that have come even close to changing my opinion on that. I don't think that the worksheet should contain the best code since the best code should be easily re-usable elsewhere, safe from corruption, and editable outside of the GUI. I guess that I feel that better documentation and better tools for the great underlying mechanisms of re-using code via library archive would be better than more less-useful new mechanisms (like start-up, code-edit, and hidden block regions) for embedding code inside worksheets. These are important but contentious issues, which means they deserve the very best forethought.

acer

I tried that code, to get a rank 4 approximation from one of the posted images. But what I got was this,

acer

How far have you gotten with this so far, on your own?

What Maple procedures have you found in the help system, that deal with checking primality or generating primes?

Do you think that it would be easier to check whether the number which is two greater than a given prime is also prime (repeating that test for every given prime in your range), or to check which consecutive pairs of entries in the set of ordered primes in your range happen to be two apart?

Work out the basics of how you want your code to work, first (even if only in words to yourself or "pseudocode"), and then try writing it in Maple.

acer

I've been working on some blog post(s) on this topic, including some code, in a few spare moments. I intend it as a branched continuation of this interesting thread.

Pls stay tuned. I'll add a link here when I post.

The code consists of improving on the naive approach of doubling-Digits-until-it-stops-changing by using shake instead at each increase to the working precision (Digits). I started off focusing on constant expressions, but then got a little side-tracked with 2-argument `eval`.

Since I'm using `shake` then my approach relies on the existence of an appropriate `evalr` extension in order handle function calls. So it doesn't do anything for hypergeom, for counterexample.

To the original poster: Note that some numerical commands in Maple provide optional arguments to specify an error tolerance. Eg, dsolve/numeric or evalf/Int.

acer

I've been working on some blog post(s) on this topic, including some code, in a few spare moments. I intend it as a branched continuation of this interesting thread.

Pls stay tuned. I'll add a link here when I post.

The code consists of improving on the naive approach of doubling-Digits-until-it-stops-changing by using shake instead at each increase to the working precision (Digits). I started off focusing on constant expressions, but then got a little side-tracked with 2-argument `eval`.

Since I'm using `shake` then my approach relies on the existence of an appropriate `evalr` extension in order handle function calls. So it doesn't do anything for hypergeom, for counterexample.

To the original poster: Note that some numerical commands in Maple provide optional arguments to specify an error tolerance. Eg, dsolve/numeric or evalf/Int.

acer

@Axel Vogt Hey Axel.

It needs the Standard GUI of Maple 14 or later, since accessing Maple Cloud worksheets can only be done at present via a special "cloud" entry in the palette panel.

So yes, one can upload a .mws worksheet, once one has opened that in the Standard GUI. But when someone else downloads it then it doesn't seem to be either .mw or .mws until such time as it gets saved to a file.

cheers,
acer

Not as terse as may be done in APL, but still,

Vector(5,exp);

exp~(<($1..5)>);

exp~([$1..5]);

More seriously, could it be that the Original Poster's issue is related to exp(1), exp(2), etc being exact quantities rather than float approximations? If so, then just apply the command evalf to most of the earlier responses.

acer

Not as terse as may be done in APL, but still,

Vector(5,exp);

exp~(<($1..5)>);

exp~([$1..5]);

More seriously, could it be that the Original Poster's issue is related to exp(1), exp(2), etc being exact quantities rather than float approximations? If so, then just apply the command evalf to most of the earlier responses.

acer

You have not told us what platform or operating system you are using.

Can you use keyboard short-cuts instead? (Ie. on Windows, Ctl-v instead of right-click->Paste)

acer

restart:

Mnemosyne:=proc(x::posint)

  option remember;
  local Xc;

  if x=1 then return x,0; end if;

  if x=2 then Xc := 1,0;

  elif irem(x,2)=0 then Xc := procname(x/2);

  else Xc := procname(3*x+1);

  end if;
  x, Xc[2]+1;

end proc:

st:=time():

plots:-pointplot([seq(Mnemosyne(i),i=1..10000)]);

time()-st;

acer

restart:

Mnemosyne:=proc(x::posint)

  option remember;
  local Xc;

  if x=1 then return x,0; end if;

  if x=2 then Xc := 1,0;

  elif irem(x,2)=0 then Xc := procname(x/2);

  else Xc := procname(3*x+1);

  end if;
  x, Xc[2]+1;

end proc:

st:=time():

plots:-pointplot([seq(Mnemosyne(i),i=1..10000)]);

time()-st;

acer

How about applying it to a quasirandom sequence generated by Rule 30.

(nb. Rule 30 must be somebody's obsession, by rules 34 and 36.)

acer

FWIW, this is integer sequence A006577 from OEIS.

Wikipedia also has information on the Collatz Conjecture.

acer

FWIW, this is integer sequence A006577 from OEIS.

Wikipedia also has information on the Collatz Conjecture.

acer

A followup comment.

You can now find the Harmonic Analysis package on the Application Center.

The (slightly thin) documentation suggests a command for removing high frequency noise from a signal. Here's what I get when I apply that same call to the data M above.

MHA := HarmonicAnalysis:-AFT(M, 0.97, 0):
plots:-pointplot([seq([i, Re(MHA[i])],i=1..n)], style=line,view=[0..1000,-20..20]);

 

You can compare the above result with the very last plot in my Answer (which to my eye looked much like the completely straight line I expected for the main signal will all noise removed).

acer

First 456 457 458 459 460 461 462 Last Page 458 of 599