Carl Love

Carl Love

28015 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@ If you remove the colon from the end of the dsolve command, then what is its output?

Did you try paying for it?

I see that you just asked a followup Question, about an error in a plot command. But the worksheet shows the same error as this Question is about. There's no sense in continuing until the first error is corrected, and so I am about to delete that new Question.

The error in the plot command is caused by a missing right parenthesis at the end of the first odeplot command.

@vv Where is the square root? The that I see is a polynomial. Perhaps it has been changed from the original posting.

@vs140580 It's more than a "small" tweak, but it seems doable. It'll require some thought and may take me a few days.

@MaPal93 You asked:

  • Given your experience, is it reasonable that the execution is stuck at the evala@:-Norm step for such a long time?

No, that's completely unreasonable. Using the system of 6 equations that you provided, the commands

P:= indets(Eq, name) minus V;
EqN:= ((numer@evala@:-Norm@numer)~@eval)(Eq, P=~ 1):

take 2 seconds total on my computer. (And in another 2 seconds or less I was able to verify that all 6 were indeed converted to degree-14 polynomials.) It's only the SolveTools:-PolynomialSystem command that should take any significant amount of time.

My first choice was triade because it's the more-modern algorithm, and I've met the man who wrote it. But I told you to use groebner because it seems to use parallel processing whereas triade does not. Given your massive computer, the parallel algorithm should finish in less "real" time even if it's theoretically much less efficient.

You should kill the triade computation, restart and re-execute the worksheet, and use engine=groebner. I have no idea how long it will take or how much memory. I wouldn't be surprised if it took several days. I would expect the memory usage to reach a plateau, as you observed. It's just luck that that plateau was under 1TB. But parallel processing will likely use more memory.

You can use the command kernelopts(numcpus) anytime, before or after the rest; you could even do it in a separate Maple session. It's just to check whether Maple will have access to all your processors for parallelism.

The few extra processors that you see working are probably just doing "garbage collection" (the recycling of memory that's no longer needed).

 

@ijuptilk Try replacing rand(0. .. 1.) with rand()/1e12

@acer engine= triade was my first choice, but I didn't see any evidence of parallelization happening via Windows Task Manager. Do you know if that's different under Linux?

@MaPal93 I just posted some ideas for easy parallelization in a Reply to my Answer below. I don't have a massive computer with which to fully test those ideas, but you do.

I agree with acer that your modified system is not different enough to warrant a new Question thread. And I agree totally with his statement that splitting the threads would make it "unnecessarily difficult for the readership if a derivative followup query is separated from its parent, since that obscures connections amongst the information and details given by the original poster as well as the responders."

@MaPal93 This might work given that massive computer that you have. My plan:

1. Once again, we let Eq be the equations (actually expressions implicitly equated to 0), and let be the variables being solved for (I'll call them decision variables from now on).
2. Once again, we set all other variables (I'll call them parameters) to 1. This'll make the system much easier to solve, and I want to do this proof-of-concept before substantially more effort is expended on solving with the parameters.
3. New idea:  Since the expressions are algebraic functions, they can be converted to polynomials, which are much easier to solve, and Maple can do the conversion in 2 seconds. This usually introduces extra solutions, but all the original ones are preserved. The extras can be filtered out by checking if they satisfy the original system.
4. The details of converting to polynomial form are

  • extract the numerators, discard the denominators (command numer)
  • command evala@:-Norm does the heavy algebra
  • extract numerators again, because there were denominators under square roots that weren't touched by the first extraction.

5. Use the Groebner-basis method to solve the polynomial system. In Maple 2022 (and perhaps some earlier versions) this uses parallel processing. I got near 100% CPU utilization on my 4x2 hyperthreaded computer.

The degree of all the polynomials is 14, much lower than I was expecting.

Here are the commands:

P:= indets(Eq, name) minus V; #extract parameters
EqN:= ((numer@evala@:-Norm@numer)~@eval)(Eq, P=~ 1):
SolE:= CodeTools:-Usage(
    [SolveTools:-PolynomialSystem](
        EqN, V, engine= groebner, backsubstitute= false, preservelabels
    )
):
(length, length~, nops)(SolE);

Let that run either until it's finished, your memory is nearly full, or you can't take it anymore. Use operating system tools (such as Windows Task Manager) to keep an eye on processor utilization. It should start out strong. If not, kill it, and give the command 

kernelopts(numcpus);

and report the result here.

@Ronan Not true; a^b is positive for any positive a and real ba^b is a uniquely defined complex number for any complex numbers a and b other than a and both 0. Finally, it is not the primary purpose of the sign command to determine whether something is positive or negative.

Yes, of course it's true that x^2 = 3 has two roots, one positive and one negative, but only the positive one is called "the square root of 3".

It's especially weird that sign has no problem with the I; it's the square root that it objects to:

sign(I);
             1
sign(3^(1/2));
Error, unable to evaluate sign

@lcz Here's a one-liner for all k-cliques:

AllCliquesFixedSize:= (G::Graph, k::And(posint, Not(1)))->
    select(nops=k, (op~)~(combinat:-choose(GraphTheory:-Edges(G), k*(k-1)/2)))
:
AllCliquesFixedSize(K4, 3);
          {{1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}}

The complexity is, of course, O(binomial(n, k*(k-1)/2)), where n is the number of edges (rather than vertices).

@jalal Like this:

df:= DataFrame(
    subsindets[flat](
        Matrix(`~`[Vector@F](C)),
        {undefined, And(complexcons, Not(realcons))},
        ()-> dne
    ), 
    columns = C, rows = F(x)
);

 

This is the other set operation that I mentioned: 

FixedSizeBlocks2:= (S::set, L::nonnegint)-> local p, r, q:= iquo(nops(S), L, r), k;
    {seq}(
        {seq}(S[[seq](p[(k-1)*L+1..k*L])], k= 1..q),
        p= Iterator:-SetPartitionFixedSize([L$q, r])
    )
:
GT:= GraphTheory:
K4:= GT:-CompleteGraph(4):
FixedSizeBlocks2(GT:-Edges(K4), 3);
    {{{{1, 2}, {1, 3}, {1, 4}}, {{2, 3}, {2, 4}, {3, 4}}}, 
      {{{1, 2}, {1, 3}, {2, 3}}, {{1, 4}, {2, 4}, {3, 4}}}, 
      {{{1, 2}, {1, 3}, {2, 4}}, {{1, 4}, {2, 3}, {3, 4}}}, 
      {{{1, 2}, {1, 3}, {3, 4}}, {{1, 4}, {2, 3}, {2, 4}}}, 
      {{{1, 2}, {1, 4}, {2, 3}}, {{1, 3}, {2, 4}, {3, 4}}}, 
      {{{1, 2}, {1, 4}, {2, 4}}, {{1, 3}, {2, 3}, {3, 4}}}, 
      {{{1, 2}, {1, 4}, {3, 4}}, {{1, 3}, {2, 3}, {2, 4}}}, 
      {{{1, 2}, {2, 3}, {2, 4}}, {{1, 3}, {1, 4}, {3, 4}}}, 
      {{{1, 2}, {2, 3}, {3, 4}}, {{1, 3}, {1, 4}, {2, 4}}}, 
      {{{1, 2}, {2, 4}, {3, 4}}, {{1, 3}, {1, 4}, {2, 3}}}}

The number of partitions produced by the procedure is n!/(L!^q * q! * (n-L*q)!), where n = nops(S) and q = floor(n/L).

First 76 77 78 79 80 81 82 Last Page 78 of 708