acer

32343 Reputation

29 Badges

19 years, 328 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Using either Explore (or plots:-animate) a polar plot can be zoomed dynamically.

For fun,

Explore(plots:-polarplot([seq([j, (2*j*Pi)/10], j = 1 .. 10)],
                         style = pointline, color = "green",
                         symbol = solidbox, gridlines, size = [500, 500],
                         coordinateview=[0..11*(1-0.9*(N-1)/(200-1)), default]),
        parameters = [[N = 1 .. 200, width = 400]], frames = 300, width = 600):

Other options can be added to the Explore call, to animate or adjust the number of frames, etc. Or, zooming "out"...

Explore(plots:-polarplot([seq([j, (2*j*Pi)/10], j = 1 .. N)],
                         style = pointline, color = "green",
                         symbol = solidbox, gridlines, size = [500, 500]),
        parameters = [[N = 1 .. 50, width = 400]], animate, frames = 600,
        width = 600):

@mmcdara I don't have any strict preference about what you post.

I was responding to your query, "...why is the possibility of receiving a vote or being selected as the best answer (ok, this rarely happens) no longer proposed in my replies?"

The reason is because Replies cannot take on votes or thumbs-up, or be selected as best Answer (cup icon). Only Answers can get such things, via the current mechanisms of this site.

Please add very close followup queries to this topic here, as Comment/Reply, rather than start a separate Question thread without branching (close-referenceing links). It helps to keep the content together.

@dnaviaux This is why I added +- as an example in my Answer to one of your previous Questions.

@jalal You can turn off the rendering of the borders for the vertex labels. That should hide the ellipses, which are elongated around the accented labels.

For example, in Maple 2020, you could add this line (before calling DrawGraph),

   StyleVertex(G, Vertices(G), border=false);

With that added in appropriately, I get this in Maple 2020.1,

@dnaviaux You can construct a larger table of symbols, and use it with printf.

Eg,

Symbols:=table(["inf"=`∞`]):

printf(" %s   %s\n", Symbols["inf"], "inf");
 ∞   inf

You could make the indices in the table whatever you choose, eg, "inf" or "infty" or  "\infty" or escaped "\\infty" or what have you.

You can also have more than one key index into the same value. Eg,

Symbols:=table(["inf"=`∞`, "+-"=`±`,
                "plusminus"=`±`]):

printf(" %s   %s\n", Symbols["inf"], "inf");
 ∞   inf

printf(" %s   %s\n", Symbols["+-"], "+-");
 ±   +-

printf(" %s   %s\n", Symbols["plusminus"], "plusminus");
 ±   plusminus

@Carl Love Your code does not account for the two choices for lowercase sigma, and so produces incorrect lowercase letters for tau to omega.

restart;
Greek_uppers:= [
    "Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", 
    "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron",
    "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi",
    "Omega"
]:
Greek_lowers:= StringTools:-LowerCase~(Greek_uppers):   
Greek:= table([
    (Greek_uppers =~ [$145..145+16, $145+18..145+24])[],
    (Greek_lowers =~ [$145+32..145+32+23])[]
]):
Convert:= proc(x)
local r,q; 
    r:= irem(3*256+x, 64, q);
    cat(StringTools:-Char~([192+q, 128+r])[])
end proc
: 
Greek:= Convert~(Greek):

seq(printf(" %s  %s   %s\n", Greek[g], Greek[StringTools:-LowerCase(g)], g),g=Greek_uppers[18..24]);
 Σ  ς   Sigma
 Τ  σ   Tau
 Υ  τ   Upsilon
 Φ  υ   Phi
 Χ  φ   Chi
 Ψ  χ   Psi
 Ω  ψ   Omega

@student_1 Yes, I did in fact understand what you meant before. You can get that "legend" effect for the pointline style (as well as the particular placement), through a construction of the whole legend-thing via segments and textplots.

@student_1 Using various other symbols is easy and straightforward. See the symbols option in the plot,options Help page. Simply replace the symbol=solidcircle in the above code with your choices from the documented symbols.

Maple's legend and caption options don't support the location your last Reply's image shows. The inlined location of that "legend" in your image is possible if you programmatically build it up through use of carefully placed smaller plot segments and textplots. But those all have to be placed with some care/fiddling -- its construction and placement is not automatic.

[edit] Just to be clear: when constructing the short line segments in such a construction the style=pointline could be used, or two segments with style=line and style=point could be overlaid. It's not difficult, but it is extra effort to set up.

If you have in mind such a specific kind of plot then it would have been more helpful and useful to have shown it when you first asked the original Question.

@snowman If you have an older version of Maple then you can specify that at in the header of your Question. That often saves time, avoiding back-and-forth fiddling.

I'd like to clarify that at no point have I suggested that dismantle produces the desired tree described by the OP. Some comments above seem to have confused that, and muddied distinctions between internal DAG structure and functional form.

I mentioned dismantle only because it uses a vertical rather than horizontal layout. I think that vertical layout can be a useful alternative.

The OP has now clarified the class of examples to be covered. Even for a meaningfully wider class the computations can be done easily with the op command (perhaps using lists as intermediate representation). This sort of thing has been done several times before. Using ToInert for the given task involves considerable unnecessary additional effort.

I don't recall anyone suggesting before that this functionality be made into a new command. That's a nice idea.

@mmcdara I didn't write that documentation phrase, so I cannot state what its author meant precisely.

I could suggest that the main difference is that ToInert produces something which can be programmatically manipulated, as opposed to dismantle which is more for a purely printing/display effect.

But I don't know what kinds of expression you wish to cover, and how. Certainly there is more work to be done in order to manipulate structures returned by ToInert. In many cases using op directly on the original expression seems simpler and easier. (Recall my response in another recent thread of yours, using both op(0,...) and [op(...)] .) But that won't serve for everything... It depends on what kinds of expression and structure are to be covered.

@nm That looks like showing the result of applying FullSimplify to the result from Rubi, rather than showing the result from Rubi. Are they the same?

Such graphs can become unmanageable when they get too wide, as nesting deepens.

You might consider a vertical orientation, on grounds of practical visibility.

On that note, and in a similar vein for displaying the nested structure of an expression, there is the dismantle command. (Much of it now implemented in a Library module, which can be viewed as source.) That is just a plaintext way of presenting the tree.

dismantle( (x+1)/(x-1)^2+sqrt((exp(-x^2)-1)/(x+1)) );                                

SUM(5)
   PROD(5)
      SUM(5)
         NAME(4): x
         INTPOS(2): 1
         INTPOS(2): 1
         INTPOS(2): 1
      INTPOS(2): 1
      SUM(5)
         NAME(4): x
         INTPOS(2): 1
         INTNEG(2): -1
         INTPOS(2): 1
      INTNEG(2): -2
   INTPOS(2): 1
   PROD(3)
      PROD(5)
         SUM(5)
            FUNCTION(3)
               NAME(4): exp #[protected, _syslib]
               EXPSEQ(2)
                  SUM(3)
                     PROD(3)
                        NAME(4): x
                        INTPOS(2): 2
                     INTNEG(2): -1
            INTPOS(2): 1
            INTNEG(2): -1
            INTPOS(2): 1
         INTPOS(2): 1
         SUM(5)
            NAME(4): x
            INTPOS(2): 1
            INTPOS(2): 1
            INTPOS(2): 1
         INTNEG(2): -1
      RATIONAL(3): 1/2
         INTPOS(2): 1
         INTPOS(2): 2
   INTPOS(2): 1

@J F Ogilvie Yes, the call to `simplify` prevents the crash (for those posint values of j).

I put in the `unapply` to gain speed, by preventing potentially expensive discontinuity checks on the integrand.

I had edited my response above, to indicate that I'd submit a bug report. The crash is due in part to the handling of the special functions, I believe. It is a regression bug.

First 143 144 145 146 147 148 149 Last Page 145 of 592