Joe Riel

9660 Reputation

23 Badges

20 years, 4 days

MaplePrimes Activity


These are replies submitted by Joe Riel

Even better, use anames('user'), which returns the user-assigned names (sort of; read the help page of anames for details). Thus one could do
proc() save args, "session.mpl" end proc(anames(user)):
For those wondering why I'm enclosing the call to save in a procedure, the reason is that, as mentioned earlier in this thread (I think), save is a Maple keyword and not a command. More significantly, it doesn't expand its arguments (though it does expand the final "argument"). One cannot do
save anames(user), "session.mpl";
because the call to anames won't be expanded to a sequence of names. Instead, an error is raised.
Even better, use anames('user'), which returns the user-assigned names (sort of; read the help page of anames for details). Thus one could do
proc() save args, "session.mpl" end proc(anames(user)):
For those wondering why I'm enclosing the call to save in a procedure, the reason is that, as mentioned earlier in this thread (I think), save is a Maple keyword and not a command. More significantly, it doesn't expand its arguments (though it does expand the final "argument"). One cannot do
save anames(user), "session.mpl";
because the call to anames won't be expanded to a sequence of names. Instead, an error is raised.
At one time, long ago, the save command could save the entire session. It no longer has that capability, you now have to specify the variables to save. You can simulate it with something along the lines of
proc() save args, "mysession.mpl" end proc(anames()):
however, that will save a lot of stuff that isn't necessary (assignments from archives). What you really want is a transcript of your input.
At one time, long ago, the save command could save the entire session. It no longer has that capability, you now have to specify the variables to save. You can simulate it with something along the lines of
proc() save args, "mysession.mpl" end proc(anames()):
however, that will save a lot of stuff that isn't necessary (assignments from archives). What you really want is a transcript of your input.
Some might say that the choice of input method is, indeed, religious. The 2D input method does provide some nice shortcuts—e.g. using primes when working with differential equations—and generally looks better. Alas, because I'm accustomed to and reasonably adept with the 1D input, I haven't made a serious effort to relearn the 2D mode; consequently, I haven't yet figured out all its idiosyncracies. Because I use worksheet mode (in the standard gui), I find it convenient to switch to 2D input (using F5 or Ctrl-R) to take advantage of its functionality when it provides a definite advantage. It's a lot faster to type, say
  y' + y = sin(x)
in 2D input then the equivalent
  diff(y(x),x) + y(x) = sin(x)
in 1D input.
Some might say that the choice of input method is, indeed, religious. The 2D input method does provide some nice shortcuts—e.g. using primes when working with differential equations—and generally looks better. Alas, because I'm accustomed to and reasonably adept with the 1D input, I haven't made a serious effort to relearn the 2D mode; consequently, I haven't yet figured out all its idiosyncracies. Because I use worksheet mode (in the standard gui), I find it convenient to switch to 2D input (using F5 or Ctrl-R) to take advantage of its functionality when it provides a definite advantage. It's a lot faster to type, say
  y' + y = sin(x)
in 2D input then the equivalent
  diff(y(x),x) + y(x) = sin(x)
in 1D input.
If that works, then so will
read "TestProc.mpl";
The parentheses are unnecessary. In Maple, read is not a command, but a keyword of the language, like save and proc. See ?keyword for a list of Maple keywords.
If that works, then so will
read "TestProc.mpl";
The parentheses are unnecessary. In Maple, read is not a command, but a keyword of the language, like save and proc. See ?keyword for a list of Maple keywords.
How did viewing the source help? All I see (in the html source) is a link to a gif file. Never mind, I see that the source is embedded, it just continues to the right, without wrapping, so I missed it on a quick scan.
I wasn't aware of that. I knew about lists, but didn't realize that the empty list was the identity (the help page clearly explains this). Very nice, and better, I think, then my "proposal". And congratulations, Jacques, for obtaining the red leaf. I didn't see the post when it changed colors, but have noted that it's been red for a (short) while.
I wasn't aware of that. I knew about lists, but didn't realize that the empty list was the identity (the help page clearly explains this). Very nice, and better, I think, then my "proposal". And congratulations, Jacques, for obtaining the red leaf. I didn't see the post when it changed colors, but have noted that it's been red for a (short) while.
On Linux (don't know about Windows) Ctrl-R changes to 2D input, Ctrl-M changes to 1D. The F5 key toggles between them, but I don't use function keys. You mentioned that you don't like the red color of the 1D (Maple Input). You can change that with Format > Styles.
What you are seeing is the time it takes for the Maple gui to parse the 2D input. If you had entered the procedure in 1D input, rather than 2D input, you would not notice any delay. I measured the actual elapsed timed using a compiled program I've written. In Maple 11, the 2D input takes about 1.4 seconds, the 1D input about 0.073.
What do you mean by compile? The worksheet you uploaded doesn't do any compilation. The time that it appears (incorrectly) to measure is the load time of that procedure, however, your worksheet only displays the start and end times, which (as I would expect) are identical (0.546). What do you observe taking six seconds?
As acer hints, the reason is that, for sufficiently large sums, it is quicker to compute the symbolic formula and plug in the limits than to actually sum the terms. However, if you were actually doing that in a procedure, it would be better to enter the symbolic formula directly rather than have Maple compute it (you can use Maple to compute the formula, then enter it into the procedure). Thus, you'll find that eval(1/2*k*(k+1),k=10^6) is faster than sum(k,k=1..10^6).
First 172 173 174 175 176 177 178 Last Page 174 of 195