Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@emendes ListTools:-Classify appears to me to be well written. Nonetheless, I wrote a version of it specialized for your task. From theoretical considerations alone, I think that there's a good chance that this will be very slightly faster. The gain in speed may be too small to measure. Here it is:

RemoveSymmetricSolns:= proc(S::set(set(name= algebraic)))
#Condense equivalence classes of symmetric solutions to a single representative by
#temporarily ignoring the variable names on the left sides.
local class:= table();
    for local e in S do class[rhs~(e)][e]:= () od;
    op~(1, {entries}({indices}~(class, ':-nolist'), ':-nolist'))
end proc
:    
#Example use:
V:= {x,y}:
Sol:= {SolveTools:-PolynomialSystem}({x*(x^2 - 2), y*(y^2 - 2)}, V, explicit)
    minus {V=~ 0}
;
RemoveSymmetricSolns(Sol);

Both this procedure and the original ListTools:-Classify are threadsafe, even though Classify isn't listed in the index of threadsafe functions. That's simply an oversight.

If it's guaranteed that for each solution all of the other members of its symmetry equivalence class (i.e., all permutations) do appear, then perhaps this procedure can be vastly simplfied and made faster. Let me know.

My guess is that pdsolve does not consider the possibility of expanding any transcendental function.

@mmcdara There are a great many Questions here about fractional differential equations, but very few Answers.

@DJJerome1976 

The command heap has existed for over 20 years (as is apparent from its non-module interface). I've been aware of its existence for all that time, and I've always wanted to learn it, but I never had a good application. Indeed, I've never seen it used either in user code or in library code. Now I am happy that I finally got to use it and doubly happy that it worked so well, especially considering that it was a first-time use.

Heaps are one of the fundamental data structures of computer science. See the Wikipedia article about them: https://en.wikipedia.org/wiki/Heap_(data_structure). Reading the article, I see that the Maple implementation lacks a few of the standard features. In particular, my code above would benefit from the replace feature, which does an extract followed by an insert, but with only one rebalancing.

@mmcdara You are the one who introduced the concept of random sample to this thread. If this thread were about random samples, then your elaborately and correctly made points would be worth more consideration here. But this thread is just about choosing things at random. It can be done two ways: with replacement or without replacement. Both ways are totally valid. With replacement is the default, but without replacement is also very commonly used and it's totally valid to call it random even though you are correct that it doesn't give a random sample.

@emendes Solutions which are identical under symmetry (more precisely, under a permutation of the variables) can be removed like this:

V:= {x,y}:
Sol:= {SolveTools:-PolynomialSystem}({x*(x^2 - 2), y*(y^2 - 2)}, V, explicit)
    minus {V=~ 0}
;
op~(1, {entries}(ListTools:-Classify(rhs~, Sol), 'nolist'));

 

I should've said earlier that both of us made the same common-sense interpretation of the help page's phrase "partial solution", but our interpretation doesn't seem to be the reality! Indeed, the reality seems to be quite the opposite: The notzero option removes what we call partial solutions even though that's not desired. So, I'm just as confused as you are by the phrase. I don't know what should be considered to have a bug: the command, its help page, or our common sense.

My policy here on MaplePrimes is usually to primarily advise on how to use Maple as it is rather than as it should be. In this case, that means ignoring what the help page says about the option. Although that's not usually the right choice, I see no alternative in this case, unless someone else provides more details about the option.

@acer Yes, of course, the precedence issue makes no difference in an expression with only one infix operator. I merely pointed it out the because using the operators infix was usually at best awkward and at worst erroneous (in a hard-to-detect way) before the issue was fixed.

@emendes I forgot outer parentheses in my Answer above. It should've been:

({SolveTools:-PolynomialSystem}({x*(x^2 - 2), y*(y^2 - 2)}, {x, y}, explicit)
    minus {{x,y}=~ 0})[];

Of course, the only purpose of the (...)[] is to convert the set to its underlying sequence. If you prefer the results as a set, you might as well just not use the []. Either way, the fact that it had been a set at one point means that the duplicate removal has already happened, and that's irreversible.

I'm working out the details of a way to remove solutions that could be considered duplicates under symmetry.

 

@acer The ability to use those operators infix is as you say, but the precedence wasn't correctly set until 2020. I think that that may have been at my request.

@DJJerome1976 Okay, go to menu Tools => Options => Display. Select "Maple Notation" in the first box. Click "Apply Globally" or "Apply to Session" (doesn't matter). Now press Command-J. If things go as I hope, that pull-down box on the context bar should say "Maple Input". If it does, proceed with the copy and paste, and you should be good to go; if it doesn't, tell me what it does say.

Please respond as soon as possible!

@DJJerome1976 It's a bother simply that you or anyone uses 2D Input at all. It is by far the shoddiest piece of commercial scientific software that I've ever seen in my 42 years of using scientific software. I'm on the verge of totally refusing to help anyone who uses it.

Describe to me exactly what happens on your screen when you press Command-J: 

  • Where is your cursor? Is it blinking?
  • What is to the left of your cursor? What color is the thing to the left of your cursor?
  • Describe the first three items on your context-sensitive toolbar (the bottom-most of the toolbars). In particular, what does it say in the first pull-down box on that toolbar?

Please respond as quickly as possible.

@acer In Maple 2020 1D input, all the inert operators can be used infix, and they all have the same precedence as their non-inert "parent". So,

eq:= A %. X  = b;

@DJJerome1976 My code is already 1D input; it doesn't need to be converted to 1D input. To enter it as 1D input, press Ctrl-J to get a 1D input prompt (which looks like > ). Then copy and paste my code directly from the Answer and Replies above (do not recopy the now-corrupted 2D Input). That's all there is to it.

@DJJerome1976 None of syntax features added in Maple 2018 and 2019 (which are really really great features by the way) work in 2D Input. The features that I used above that won't work are embedded assignments, embedded local declarations, embedded do loops, arrow procedures with local variables, and the updating assignment operators minus=++, and --. 2D Input doesn't even recognize these as things that haven't been implemented yet; it simply perceives your input as total nonsense.

First 153 154 155 156 157 158 159 Last Page 155 of 709