acer

32495 Reputation

29 Badges

20 years, 10 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@John Fredsted Yes, sorry, lazy cut & paste. Fixed.

@John Fredsted In Kitonum's code the name F is assigned the list of anonymous procedures, and loop index name i takes integer values. But none of the names in play are ever assigned any procedure as value, so last-name-evaluation doesn't come into play.

Last-name-evaluation (LNE) serves a few useful purposes. It allows you to pass the name of a procedure as an argument (to some other procedure), without that name being evaluated to the procedure body of its value. Under normal evaluation rules arguments are evaluated.

Similarly, LNE allows you to pass the name of a table as an argument to a procedure, without that table being copied. Hence you can do in-place operations on tables (or other mutable data structures like the now-deprecated array/matrix/vector which are table-based under-the-hood).

While LNE is a rather brilliant solution (IMO) to the technical issue of allowing these beasts to be passed -- without copying and full evaluation -- as arguments to procedures, it can sometimes require explicit eval calls, as in your example. Sometimes it gets you into a mild muddle, from which the term last-name-evaluation-disease (LNED) was coined. Older users will remember the burden of using evalm when handling array/matrix/vector.

LNE is an important piece of the puzzle of Maple evaluation rules, as worth learning as special-evaluation-rules, and the fact that assigned locals and parameters of a procedure get only 1-level evaluation within the procedure body (following normal full eval of the arguments). For the last of those, see subsection "Statement Sequence Interpretation" of section 6.6 of the Programming Guide.

@John Fredsted A problematic case, for your particular candidate procs, would be when y had been assigned a value of 0. But the following tweak to the select predicate protects against that. Eg,

y:=0:

select(proc(f) local y; f(y)<>y; end proc,
       [x->x, x->2*x, x->3*x]);

               [x -> 2 x, x -> 3 x]

So that protects against y being assigned at the higher level. You might still need to consider whether it matters that f(y) might simplify to just y (which would matter equally in any of the other approaches suggested). I'll leave it to you whether you want or need a comparison stronger than just the implied evalb.

If that condition holds then x-y=0 for some x in the domain of integration, no?

It may be obvious to others, but to me it's not clear whether you are asking how to make all plots get left-aligned in a worksheet (wherever they are output, singly or otherwise), or how to get just one plot left-aligned (leaving some others centrally aligned).

My answer below relates to the second scenario -- where alignment of each single output plot is wanted independent.

When I do the Tools->Check for Updates->Download and Install on my 64bit Windows 7 Pro then, after it downloads, Maple's Standard GUI throws up a pop-up dialogue titled "Maple is running".

That pop-up offers me the choices of Exit/Cancel, Retry, Ignore, etc. I don't recall your mentioning such a dialog box, John. Did you see that? What's your platform?

I've never tried that pop-up's "Ignore" choice. But if I do quit/close the running Maple GUI instance (while that pop-up menu is left there), then I can then choose "Retry" in the pop-up dialog and the Installer progress pop-up appears and it updates from 2017.0 to 2017.1.

I wonder whether you might not be seeing that popup because, say, it's hidden behind your Maple GUI window, or perhaps because you're using OS X? But I don't recall your mentioning seeing that dialog.

@Markiyan Hirnyk The question posed is about a particular example. Your continual grasping for one-upmanship is sad.

`tar` is a Unix/Linux/OSX shell utility for unpacking archives.

`tar xzvf foobar.tar.gz` is a call to uncompress and unpack the archive whose filename is foobar.tar.gz .

The instructions almost certainly don't tell you to use "tar xzvf" in any filename or path. You are likely misreading and conflating separate steps in the instructions.

Similarly, there will likely not be a directory named blahblah.tar.gz to add to libname. Instead, after you unpack the archive, you'll see a new directory containing the unpacked contents, and that's what you should use instead.

`tar` is to MS-Windowz `zip` like archive file `foo.tar.gz` is to MS-Windows archive file `foo.zip`. 

@kuwait1 You can do what I said by running the second attachment I added before, the one named ANALYTIC_1_M13.00.mw . That works, in Maple 13.00. And one of the included ways runs reasonably quickly.

@Markiyan Hirnyk He is using Maple 13.00, and in that version RootFinding:-Analytic does not do so well as can be easily achieved using Calculus1:-Roots . 

Also, if you had bother to see my previous attachments you'd see that for this example the performance using Calculus1:-Roots can be much improved by first combining and (optionally) applying fnormal.

In my Maple 13.00, if I call Analytic(ee,phi=0-I..10+I) on ee the original expression it produces the 12 roots between 0 and 10 (as well as 0.+0.*I) in 10.8 seconds. But calling Calculus1:-Roots on fnormal(combine(ee)) produces those same 12 real roots in 1.4 seconds, while calling Analytic on fnormal(combine(ee)) produces and error message about "too many levels of recursion" after 72 seconds.

ANALYTIC_2_M13.00.mw

@Markiyan Hirnyk I had already considered that aspect when I made my Answer.

I still believe that the `timelimit` command best addresses the actual Question asked, which was about simple stopping of a subcomputation taking too long. There's no other action that would interrupt during a kernel built-in rather than an interpreted (e.g. Library) call, so it doesn't bear on the choice of mechanism.

I would hope the OP would read the Help page of the command I suggested.

@gaurav_rs I do see both the superscript "2" and the rest bolded, but the weighting effect on the superscript is less (because it's at a smaller size).

What seems to look better is to explicitly bold only the superscript (exponent) while leaving the rest unbolded.

See below for a screenshot, using labelfont=[Time,N] and only the superscript bolded.

The details are in this revised attachment. cust_label_2.mw

Also, the relative size of the superscript can be adjusted. For example you could experiment with ceil(0.67*N) instead of ceil(0.5*N), etc.

I produced the above screenshot in Linux. On MS-Windows or OSX the font might render slightly differently. My revised attachment shows both fonts "Times" and "Helvetica", and on MS-Windows you could also try, say, "Tacoma".

@9009134 I only changed it from fprintf to printf to show that my other edits/corrections made it work.

Just change that printf back to a suitable fprintf and it'll write to a file instead.

Your problem was mostly that F53 was set up wrongly.

I don't see why that's so hard to understand.

@9009134 Did you notice that I changed the fprintf to printf, to illustrate that it produces the numeric results?

@sand15 FYI, you might also find this old thread of interest.

There, maple is the installed Linux shell script that launches Maple Command Line Interface (CLI) in a shell (while you might be using cmaple.exe).

First 279 280 281 282 283 284 285 Last Page 281 of 595