acer

32313 Reputation

29 Badges

19 years, 316 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@JAMET Since your libname is just a single location then your use of  libname[1]  looks wrong.

If you accept the idea of using your Maple installation's own lib folder, then try,
   cat(kernelopts(':-mapledir'),"/lib/Filters.mla")
or,
   cat([libname][1],"/Filters.mla")
instead.

Or hard code it without using cat at all.

 

@lekcha I've altered your Question, to mark it as Product: Maple 18.

I'll wait for you to properly explain, in adequate detail, what exactly you want to accomplish.

@Sauberschrauber If you know the identity of some particular Code-Edit Region then you can toggle it between visible and non-visible with commands. Eg,

DocumentTools:-SetProperty("CodeEditRegion1", visible, true);

DocumentTools:-SetProperty("CodeEditRegion1", visible, false)

That was the point of my original Answer above.

If you don't know the identity of the various Code-Edit Regions then you can discover them programmatically (within Maple) using the code in my followup comment.

Of course you could also use the right-click context-menu Component Properties to discover the identity of each, individually, but that's a manual act and not programmatic. Naturally you cannot do that unless the component is currently visible.

@MapleUser2017 It is possible that the extra package rebinds the plot command (name), which then tries to utilize the Compile command but does not adequately guard against the case that the user's machine does not have gcc installed.

I am not aware of the external compiler being accessed by the stock version of the plot command, whether dealing with its single or multiple expression calling sequences. But it may be used by some extra package that redefines/rebinds the plot command name, and it's possible that such a redefinition might be the source of the problem.

It might help if you could tell us the same and source of the extra Maple package which your students are using.

@MapleUser2017 I suggest trying it without that additional package "similar to Gym" installed.

It helps to narrow down the conditions-to-reproduce as far as possible. Thanks.

Can you provide an example of f,g,h for which this occurs?

What is the OSX version?

Does it happen if libname is not augemted by the user, and if no initialization file is used?

Are there extra packages (eg. Gym) loaded of in libname?

@tomleslie Your latter workaround can also be adapted for plot3d with style=point, which allows for multiple, differing symbols and symbolsizes. Eg,

restart;
with(geom3d):
point(A, [1, 2, 3]):
point(B, [-2, 3, -1]):
point(C, [0,-3, 1]):
plot3d( [ coordinates(A),
          coordinates(B), coordinates(C)
        ], style=point,
           color=[red, blue, green],
           symbolsize=[34,24,30],
           symbol=[soliddiamond,solidsphere,asterisk],
           axes=none
       );

@greatpet That is the same issue as in my example: a module export declaration following an assignment statement.

And your workaround is the same approach as in one (of the pair) that I gave.

@Oktopus If one of the alternatives that I suggested does not work for you then perhaps it's because you are using an older version. If that's so then you ought to provide us with the details.

Even better would be if you uploaded and attached an actual worksheet that showed exactly what you have done.

If the desired tickmarks are to be spaced evenly then a terser solution (in Maple 2020.1 at least), is something like:

   plot(x, x = 0 .. Pi/2, xtickmarks=spacing(Pi/10));

I've changed your Post to a Question.

(This is the second time I've done that for your queries. Please submit Questions rather than Posts, for queries, thank you.)

@paulor Look at the Praw plot, which consists of all the roots of H(k,i) for each horizontal "k" value, ie. vertically appear the various "i" values of the roots.

The plottools:-transform command returns a procedure which may then be applied to a plot in order to transform it.

My plot tranformation applies your formula to all the (k,i) points, ie. roots. In my Answer, the parameter names x and y appearing in the construction of the plot-transforming procedure transf are arbitrary dummy names that I happened to pick. But perhaps it might be a little more clear to you if I had constructed it instead with these procedural parameter names,

transf := plottools:-transform((k, i) -> [k, ln((w(k) - i)*(A*alpha)^beta*(p(i)*i)^(alpha*beta))]):

For every point (k,i) on the curves in a plot, that transformer transf obtains the new horizontal component as simply k itself, and obtains the new vertical component by using the k and i values in your formula.

By restricting the vertical range of the implicitplot one can restrict the range of the roots found, which happens to also allow you to "separate" them for this example. I did that in my followup Comment.

Let us know if that doesn't make it clear.

The same very fast approach is easily adapted to get, say, only a few of the portions plotted separately. Eg,

str := time[real]();
P[1] := plots:-implicitplot(H(k, i), k = 1 .. 2, i = 6 .. 7, color = red);
P[2] := plots:-implicitplot(H(k, i), k = 1 .. 2, i = 7 .. 15, color = blue);

(time[real]() - str)*'seconds';

                 0.008 seconds

plots:-display(seq(transf(P[i]), i = 1 .. 2));

(For comparison, using vv's rootfinding technique took my machine 532 seconds to produce the separate plots of just the portions n=2..4, whereas the above implicitplot approach takes only a fraction of a second.

For fun, here's another coarse rootfinding jab at it, taking about 70 seconds. I used default adaptive plotting, so the memoization is not a big help. With some twiddles it could be sped up, but likely not nearly as fast as the implicit plot, so I didn't put in the effort. Worksheet_1_implicit_ac.mw)

@lcz Here's the %P format that I meant, for printf. I believe it was added in Maple 2019.

If you use fprintf then you could have it write out directly to file.

restart;
kernelopts(version);
   Maple 2021.1, X86 64 LINUX, May 19 2021, Build ID 1539851

printf("%P", eval(GraphTheory:-PlaneDual));
proc(G::{GRAPHLN, listlist})
    local F, E, i, f, k, j, n, e, S;
    if type(G, GRAPHLN) and not IsPlanar(G, 'F') then
        error "1st argument must be a planar graph or a list of faces o\
            f a planar graph.";
    elif type(G, 'listlist') then
        F := G;
    end if;
    n := nops(F);
    if n < 2 then
        return Graph(n);
    end if;
    E := table();
    for i to n do
        f := F[i];
        k := nops(f);
        for j to k - 1 do
            e := {f[j + 1], f[j]};
            if assigned(E[e]) then
                E[e] := E[e] union {i};
            else
                E[e] := {i};
            end if;
        end do;
        e := {f[1], f[k]};
        if assigned(E[e]) then
            E[e] := E[e] union {i};
        else
            E[e] := {i};
        end if;
    end do;
    S := {entries(E, 'nolist')};
    if map(nops, S) <> {2} then
        error "list of faces is inconsistent.";
    end if;
    Graph(nops(F), S);
end proc

As for showstat, there are situations in which revealing the line numbers is desirable, eg. using stopat.

@The function One of your images has the correct syntax. One does not.

It looks like the book's correct syntax was incorrectly transcribed.

You claimed that your input was the same. The two images shown have different inputs.

I can't tell whether the book's own bundled example .mw files don't match its actual text (their mistake),  or whether you incorrectly transcribed some example.

First 124 125 126 127 128 129 130 Last Page 126 of 591