Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 319 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@bstuan The path need not be a straight line. I just woke up, so I haven't tested these yet, but my first guess is g1 = 0 and g2 = x-> x^(2/3) with the limits being and 1/2. Let me know how it goes.

@zenterix Yes, it works in 1D due to a recent syntax enhancement. (Code edit regions are 1D input.) It's an example of what I meant by "that distinction has been fading over the years." When I said "Your error is that you have an export declaration after the above statement," I meant that that's your error if you're using 2D Input, which seemed to be the intent of your Question. 

Nearly every (perhaps absolutely every) syntax enhancement made to 1D input in the last 4 years does not work in 2D Input. And there have been a huge number of such enhancements.

These are the first paragraph and the last paragraph of help page ?local_scopes:

  • Maple 2019 removes the requirement that all procedure and module local and global variables, and module exported variables, be declared at the beginning of the procedure or module before any executable statement.
  • This feature is currently not supported in 2-D math input in the Standard Interface. It is supported in 1-D math input in the Standard interface, as well as in the Command-line user interface.

@bstuan You wrote:

  • I thought that the limits of g1(x) and g2(x) must always be = 0(?)

Yes, we must have limit(g1(x), x= 0) = 0, and likewise for g2; but limit(f(x, g1(x)), x= 0) can be anything.

The simplest possible is 

g1:= x-> 0:

Visualized geometrically, this is approaching the origin along the y-axis. Using that, what do you get for the limit?

@zenterix There is a distinction that must be made between declarations and statements, although that distinction has been fading over the years. In a module, the declarations must come before the statements. All of these are declarations:

local defaultSeed;
local defaultSeed:= 100;
export getSeed;
export getSeed:= ()-> defaultSeed;

But this is a statement:

defaultSeed:= 100;

Your error is that you have an export declaration after the above statement.

By combining the declaration of the names and the assignment of their (initial) values, it's possible to write useful modules that are all declarations, no statements. The majority of modules that I write are like that, as is the example that I gave.

For reasons that I don't understand, I seem to be the only one who does it this way. One benefit is that you don't need to retype (and possibly misspell) the variable name.

The reserved words local and export only need to be used once, each followed by a comma-separated sequence of variables with their initial values (exactly like the example I showed). I always do it that way. Sure, you can put local or export in front of every variable, but why would I type any word more than once if I don't need to?

You wrote:

  • One thing you might note is that I am literally trying to learn about Maple from the official documentation. I simply use what is there. Initially I was reading Chapter 8 about Modules of the Programming Guide....

Likewise, my entire knowledge of Maple comes from reading the official documentation (including the Programming Guide), this forum, the fora that existed before this, and experimentation. I haven't learned from any teachers or books about it. I've looked through many third-party books with Maple in the title, and I have many on my shelves. While most of these books do do a decent job of teaching whatever type of math they're trying to teach, their Maple content is appalling. The only exception that I've seen is Calculus the Maple Way by Robert B. Israel, who used to be a frequent contributor here.

@bstuan I'm trying to not give away too much of the solution here, but if I choose the simplest possible examples for g1 and g2, then I get a limit of 0 for one of them, and 1 for the other.

And note that you should be calculating the limit of f(x, g1(x)), etc., rather than f(g1(x)) (which you've typed above).

@ecterrab You wrote:

  • I am forwarding the problem you posted to the people who take care of that, adding it to the database of issues too.

At this point, I don't see any "issue". Perhaps you should wait for clarification from the OP before forwarding. I've already asked for that clarification.

@acer An even better plot can be made by specifying adaptive=true (or, equivalently, simply
adaptive)[*1] and "anchoring" the zeros with sample:

plot(abs(sin(x)/x), x= -2*Pi..10*Pi, sample= Pi*~[$-2..10], adaptive);

[*1] A curiosity: Using a keyword option as an argument without specifying a value is equivalent to setting the keyword to true, regardless of the declared type or default value of the keyword. Example:
P:= proc({opt::anything:= ()}) opt end proc:
P(opt);

                             
true
One may debate the robustness of making use of this feature.

@one man Just 👨 😪 😢 ❤️ 😍 because there's no 👎 menu-based way to enter them pre-programmed into the MaplePrimes interface, that doesn't mean that they can't be entered. You can use character-based methods or a touch-screen 🔑 🗝 🔐 🔟 #️⃣ 3️⃣ keyboard app.🍁 (All the above were automatically generated suggestions by my Samsung keyboard app, which gives menu-based access to 1000s of emojis.)

I changed this from a Post to a Question. Please put questions in the Questions section from now on.

@ianmccr Thanks for responding. Okay, I'll need to update my mental list with yet another new 1D syntax that doesn't work in 2D (it's quite a long list). It can be made to work in 2D by replacing $nops(a) with $1..nops(a).

@moshill Thanks: The additional lecture notes helped a great deal. In that case, the procedures can be shortened to:

#Works in any input mode:
conjcl:= proc(kk::integer, p::prime, n::posint)
local q:= p^n-1, k:= kk mod q, L:= Array([k]), K:= k, t;
    for t do K:= K*p mod q; if K=k then break fi; L(t+1):= K od;
    [seq](L) 
end proc
:

#Only works in 1D input:
conjcl:= (kk::integer, p::prime, n::posint)->
local q:= p^n-1, k:= kk mod q, K:= k;
    [do K until (K:= K*p mod q) = k]
:


These procedures will run much faster for large values of p and n (such as might be used in cryptography) because they avoid direct exponentiation and because they avoid incremental list building.

@ianmccr So, I suppose that you consider what I wrote to be so foul and unworkable that it's not even worthy of comment?

@Anthrazit That's the way it was designed. It's not a bug. If I was redesigning it, I'd exclude the last name evaluation "feature" and handle the prettyprinting of tables, procedures, and modules akin to how rtables and objects are currently prettyprinted. But needing to use eval or entries doesn't seem like a big burden. 

@Jankel I use Maple 2022.2 on Windows 10 with a standard 17-inch HD display. My help Table of Contents font spacing looks exactly like what you showed in your original Question above.

@Ronan I think that it would be best to just write, edit, and store everything in plaintext files. It's fine to test and experiment with the GUI (using 1D input), but put the final work in plaintext files.

Regarding 2D Input: It's so corrupt and deviant at this point that to me it's a separate language, akin to an illiterate's gutter dialect. I don't think that a single syntax innovation made to Maple 1D input within the last 5 years has been incorporated into 2D Input. That includes do-until loops; multilevel break and next in do loops; embedded do loops, if and try statements; embedded assignment operators; updating assignment operators; double-indexed for loops; (the list goes on...). Since it seems that no-one is working on these and it's been so many years, I doubt that it'll ever be done.

First 67 68 69 70 71 72 73 Last Page 69 of 708