Carl Love

Carl Love

28150 Reputation

25 Badges

13 years, 351 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@nm Please stop deleting your Answers! You do this very often. In this case, there was nothing wrong with your Answer. It did the same thing as my Answer in a different way. It's likely that for some readers your way would be more understandable than my way, or that the combination of Answers would reinforce the learning.

@DJJerome1976 The lprint is not needed to do the job; it's merely there to help you understand the next line of code. That next line of code will work in all cases; it's not specific to your case.

It's despicable that you've deleted your Question after one of our volunteer experts went through the trouble of answering it for you. And to top it off, you've left this ugly and meaningless name "1111..." in our index.

@MapleEnthusiast I've been following that other thread. Unfortunately, I don't have any constructive input at this time.

@michele The symbol interactive has no predefined value when a Maple session is started. That changes when you use with(plots) because the plots package has an interactive command. So, when you use the symbol interactive for DrawGraph, you need remove any value that it has acquired. Prefixing any symbol with : - means that the reference is to the global symbol rather than to any package's symbol. Enclosing it in single forward quotes means to ignore any value that has been assigned to the symbol.

@acer Oh my, I have a feeling that this will become a FAQ.

@mthkvv It's not possible to calculate a middle coefficient of the product without fully scanning all coefficients of the multiplicands. But for leading or trailing coefficients, the simple fact that you"ve converted the multiplicands to lists already means that you've ruined any possibility of efficiency. To be efficient, the algorithm must only access the necessary coefficients of the multiplicands. 

I agree that it would be useful to have an efficient stock method under modp1 to compute the first n leading or trailing coefficients of a polynomial multiplication. An algorithm to do this is straightforward and elementary. It may be possible to implement this using only Maple-level code (meaning no need to touch compiled code), so one of us may be able to do this.

@vv Unfortunately, there are a few structures whose constructors have names that are different from their zeroeth operand. The zeroeth operand of a set is set, but the constructor is `{}`. This is an oversight because the only reasonable reason to use op(0, expr) as a function prefix is to access the constructor. What would be the point of avoiding a large set by returning an even larger function? 

Surely this is a bug in Grid. The set(...) appears to be an "escaped" internal intermediary format used before conversion to an ordinary Maple set. It's hard to imagine any good reason that it was programmed like this even if it worked correctly. It seems like a huge waste of memory that could make it impossible for Grid:-Map to return the multi-million-element sets of lists of tuples that you require.

By the way,  CodeTools:-Usage, when applied to a Grid command, doesn't return meaningful numbers, except possibly for the real time. The other numbers only apply to the master process.

 

@nm The command-line options are documented on help page ?maple. I don't have access to a computer at the moment, so I can't check whether standalone is mentioned there.

@coopersj In addition to Tom's cabbages example, I'd guess that LinearAlgebra is more commonly used for error computations where the infinity norm is most appropriate.

You can change the default, like this:

origNorm:= eval(LinearAlgebra:-Norm):
unprotect(LinearAlgebra:-Norm):
LinearAlgebra:-Norm:= proc(v, p:= 2) origNorm(v, p) end proc:
protect(LinearAlgebra:-Norm, origNorm);

LinearAlgebra:-Norm(<3,4>);
                               5

Something like this could be put into an initialization file.

@Muhammad Usman If it's known that the integrals are always 0 or Pi^(-3/2), then crude numeric integration at 1-digit precision can distinguish those cases. One of the "Cuba" methods of numeric integration could be used.

@dim____ Make sure that you're using rhs~ instead of plain rhs.

@Carl Love The answer above uses features introduced in Maple 2019. The following is almost as short, and will work in older Maple:

P:= [0,0]: R:= rand(1..4): 
plot(ListTools:-PartialSums([P, seq([[-1,0],[1,0],[0,-1],[0,1]][R()], 1..10000)]));

 

First 158 159 160 161 162 163 164 Last Page 160 of 711