acer

32333 Reputation

29 Badges

19 years, 320 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@tarik_mohamadi You could divide out that multiplicative factor Bi-1, although I don't see what mathematical justification you have for doing so. The results of that are no longer identically zero when Bi=1, but only you would know what meaning they'd provide.

Determinant_ac.mw

@PsiSquared I see the same problematic effect when exporting to PDF in Maple 2021.0 for 64bit Linux.

@nm I do not understand why you would not provide one of your actual LaTeX string examples when originally submitting the Question.

Here is some more, trying to represent multiple x-y pairs across various numeric E-values.

Once the roots for a fixed set of E values are computed (first plot with that numpoints) then repeated calls are quick for those same E-values, allowing easier customiztion of view, slicing/dicing,etc. Hence the use of adaptive=false and common numpoints.

There is a simple approach, putting all x-red and y-blue together. This shows some ostensible curves, but loses the x-y groupings.

There is also an attempt at "tracking", keeping the colors but using different point symbols. A similar thing could be done with, say, 3 shades of red, and 3 shade of blue. This kind of identification of roots is difficult. The differing scales don't help. Sorting is an alternative scheme. But all schemes can be defeated by some example.

If you know the expected ranges for x and y then this is the time to say so,,,

Error_John2020_acc.mw

 

@John2020 You have attempted to utilize the name Z as a dummy variable, for the plot call.

But you have already assigned a numeric value to Z, as one of the parameters in your equations set up. So your call to plot is invalid.

So you could try unassigning to Z just before plotting, or use another dummy variable name for the plot call, or use operator-form calling sequence of the plot command, etc. In the attachment I show one simple alternative.

Error_John2020_a.mw

I do not make any effort for efficiency through memoization in this attachment. It can be done, and it ought to be done, but first you need to figure out how you want to handle the fact that your equations might have multiple x-y solution pairs for each E value in your domain. Do you how to "track" solution pairs that appear to be along curves, or point-plot them all together (but still with x=red and y=blue), etc, etc.

@John2020 Please don't submit it as another, separate Question thread.

@Carl Love I do not prefer that mechanism using ToInert,specfunc,pointto because it has less direct connection to the nature (or location or details) of the mystery procedure.

Your comment about reliance on opaquemodules=false is not really an accurate description of that code. I favor a mechanism, where that doesn't setting come into play if unrelated; it's not needed for the routine to be accessed at runtime, so a mechanism to reveal it independent of that setting is less kludgey.

Also, your comment about results from LibraryTools is not very on target here, since it describes far more usual procedures than the very special case considered here for partition1.

Please don't repost this in an entirely separate thread. If you still want an iterative process then you can put any followup details or worksheets in Replies/Comments here.

@vv The procedure can be part of the lexical table because of how Maple internally stores procedures and references.

An example of how this might arise, for fun:

restart;

M := module() export foo;

   # The following is an anonymous module, that is
   # neither a local nor an export member of M.
   #
   module() local hidden1;
      
      # Here is an assignment to foo, an export of M.
      #
      foo := proc(x) cos(x) + hidden1(x); end proc:

      # Here is an assignment to hidden1, a local of
      # this anonymous module.
      #
      hidden1 := proc(x) sin(x)^2; end proc;

   end module;

end module:

M:-foo(77);

cos(77)+sin(77)^2

eval(M:-foo);

proc (x) cos(x)+hidden1(x) end proc

eval(hidden1);  # nope

hidden1

kernelopts(opaquemodules=false):
eval(M:-hidden1);  # nope

Error, module does not export `hidden1`

#dismantle(eval(M:-foo));

blah := [op(7, eval(M:-foo))]

[_thismoduledefinition, module () local hidden1; end module, hidden1, hidden1]

map(eval, blah[3..4]);

[hidden1, proc (x) sin(x)^2 end proc]

 

Download moduleanonfun.mw

I don't know why combinat:-partition and partition1 are organized as they are. It might be a coding choice of whoever converted combinat from an older table-based package to the more modern module-based package. But I don't know whether that was a stylistic choice or based on some functionlity/compatibility need.

@vv The partition1 procedure called inside the combinat:-partition procedure is referred to in the lexical table of the latter. It can be  by examined via the 7th operand of the procedure assigned to combinat:-partition. Eg,

interface(verboseproc=3):
foo := [op(7, eval(combinat:-partition))];
map(eval, foo[3..4]);

You could also step into partition1 by running a call to combinat:-partition in the debugger and then issuing the debugger command list 1..10 to see all its lines of code.

If you'd like I can show a small example of a way to construct such an "anonymous" reference.

@tomleslie I used Maple 2020.2 for 64bit Linux. I did that because one of the OP's very recent Questions was marked as Product=Maple 2020.

That code runs and takes 3.5sec to produce the animation and a separate and additional 45sec to render its first frame -- in a fresh GUI session with no prior output -- in Maple 2020.2 for 64bit Linux.

If I rerun without first removing prior output then it takes about 100sec for the additional rendering to appear, as measured by the time[real]() difference in a later, separate Exceution Group as well as my wristwatch. This also emits errors to the terminal from which I launched the GUI, including "java.lang.OutOfMemoryError: Java heap space" and "GC overhead limit exceeded". That's where I got my reported timing from.

If I rerun yet again it gets then it appears to stall, and the animation does not appear even after a very long amount of time. Eventually I have to kill the GUI process. The launching terminal is filled with repeated "Java heap space" messages.

If I do the whole experiment in Maple 2021.0 for 64bit Linux then it takes 3.8sec to construct and only an additional 9.4sec to render the first frame in a fresh session with no prior output. Upon repeat, with prior output present, it then takes 9.2sec for the first render.

The JRE bundled with Maple was updated for Maple 2021.0. The Maple Standard Java GUI performance in the this example is improved. But 9sec is still far from acceptable as time to render the first frame. And it gets worse still, as the grid size is increased past the quite modest [91,91].

So I stand by what I wrote before, about high resolution densityplot animations being an inferior methodology if the number of frames is not small.

Java memory performance and management might have improved in Maple 2021.0, but whether at 3 or 4 or 9 seconds for rendering it's still very poor for this modest resolution densityplot animation example. A good system would render the first frame in less than 1/10th of a second.

Tom, there is no need for aggressive statements of disbelief, just because someone else's experience differs from yours.

In the absence of code or a worksheet that can fully reproduce the problem it is not possible for anyone else to discern exactly what was going on.

@mmcdara Yes, the original error message is clear, as it shows,

   0 = 0 = .. (1/2)*Pi

so theta on the LHS evaluated to 0.

The OP may not have properly unassigned and rerun, except after also trying evalf (a red herring except possibly in ancient versions).

The OP also writes lowercase pi a few times in this thread. Such typos hint that extra care might be needed.

 

@Earl This is not the cause of the user's problem.

It is not necessary to evalf the range's end-points.

They can be of type realcons, and if not already of type numeric then the animate command will do the evalf automatically.

You should inform us precisely as to how you want the "cells" to be colored.

Should they each have a distinct color but be individually shaded uniformly? Should there be a pattern, across the whole? Or should they be shaded in some gradient manner?

First 133 134 135 136 137 138 139 Last Page 135 of 591