acer

32490 Reputation

29 Badges

20 years, 9 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Please attach your actual code to reproduce in full.

Your example works smoothly for me using Maple 2022.2 (no initialization file, no extra libraries...).

@mmcdara By the time it gets the `minimize/solve` the problem's been reformulated in exact rationals. However some RootOf's with float-range specifiers can still be generated.

The code-flow is slightly different, but in M2022 it's running into this (fwiw):

allvalues({x = 1/3*RootOf(7*_Z^3-279*_Z^2+2943*_Z-5049,14.92337354 .. 14.92337355), y = 1/3*RootOf(7*_Z^3-279*_Z^2+2943*_Z-5049,14.92337354 .. 14.92337355)},implicit)
Error, (in RootOf/RootOf:-algnum_in_range) invalid input: RootOf/RootOf:-rootof_in_range expects its 1st argument, rt, to be of type 'RootOf'(polynom(rational,_Z),identical(index) = posint), but received RootOf(7*_Z^3-93*_Z^2+327*_Z-187)

The _EnvExplicit=true makes it take a different code-path.

@mmcdara The Question was marked as Maple 2022.

fwiw, one may also use "" the empty string, i.e., a pair of double-quotes.

(I consider it a very slight advantage to use here something which might not be assigned a value.)

@Ronan That's right. I did not suggest placing the "\n" inside capitalized Typeset call.

As I mentioned, the lowercase typeset serves to allow math and text together (without a new comma visibly appearing to separate them). It doesn't even do anything by itself, but plotting commands turns its unevaluated function calls into a slightly differently named plotting substructure that the plot renderers (without added commas or text quote marks).

The "\n" is simply an example of such a string. It just happens to only contain a newline character in this example. Some other example might be, say,

  typeset("The integral is,\n", int(f(x),x=a..b))

In contrast a call Typesetting:-Typeset is one way to turn a name or math expression into a form that renders the same but won't later evaluate to some value. There are other ways to do that, eg. using the documented InertForm:-Display, or the undocumented `tools/gensym` to produce a new local instance of a name.

The lowercase word `typeset` was not a great design choice. It bothers me more that (by itself) it offers no evaluation prevention, and that it's Help page doesn't explain all this.

@Ronan Could you perhaps get some extra vertical spacing using newline characters, ie. with something simple like,

  typeset("\n", gamma2)

or,

  typeset(gamma2, "\n")

(or both above and below), though I'm away from a machine and forget whether the quote marks might show.

@Andiguys Sorry, I don't have time to fix so many worksheets.

I notice that several of your mistakes keep cropping up, despite previous corrections.

I suggest that you strive to properly understand what's been shown so far, so that you can correct most of these problems yourself.

You have,

exact_solution := (t, x_i) -> 2*Pi*p*sum(etan(n)*exp(-n^2*Pi^2*p*t)*n*sin(n*Pi*x), n = 1 .. infinity)/(eta0 + sum(etan(n)*exp(-n^2*Pi^2*p*t)*cos(n*Pi*x), n = 1 .. infinity))

What does the `x` mean in that, inside sin(n*Pi*x) and cos(n*Pi*x) ?

Did you instead intend, say,
   sin(n*Pi*x_i) and cos(n*Pi*x_i)
?

@janhardo 

expr := 2*sin(beta)^2+4*cos(alpha+beta)*sin(alpha)*sin(beta)+cos(2*(alpha+beta));

2*sin(beta)^2+4*cos(alpha+beta)*sin(alpha)*sin(beta)+cos(2*alpha+2*beta)

combine(expr);

cos(2*alpha)

@Scot Gould There is special code inside plots:-display to merge an "array" of 2D plots into a single PLOT construct. It serves this special case of wanting to export a collection like this in a single image file. Having the plot device set to an external image driver flips this on.

In order to do this the individual 2D plots are all shifted, and their tickmarks faked as textplots at mapped locations.

However, that shifting manipulation also turns the float tickmark values into names, eg, `-1.0` etc. And that makes them render in italics. That is likely why there is confusion about which fonts are being used.

Here's one workaround, using the previous code, to get usual upright Roman tickmark values instead. You also use the usual font option, see attached.

Note that I use .png image format for the export (which I find often like more).

I've used String@parse here, to turn those names-of-floats back into string text, but there are also Typesetting (or more careful) alternatives to re-manipulate those tickmark values (in TEXT substructures...).

restart;

with(plots):

P := seq(plot(x^n, x=-1..1, color=ColorTools:-Color([1/n, 1-1/n, 0]),
              size=[800, 400]), n=1..4):

Q1 := display(P[1], P[3]):
Q2 := display(P[2], P[4]):

here := cat(kernelopts(homedir), "/mapleprimes/example.png"):

plotsetup(png, plotoutput = here):
   G := display(< Q1 | Q2 >):
   #G := display(< Q1 | Q2 >, font=[Times,16]):
   subsindets(G,And(name,satisfies(u->parse(u)::numeric)),String@parse);
plotsetup(default);

restart;

here := cat(kernelopts(homedir), "/mapleprimes/example.png"):

img := ImageTools:-Read(here):
ImageTools:-Embed(img);

 

 

Download disp_ac.mw

ps. If you execute,
   display(G,axes=box);
after resetting the device with plotsetup(default) then you can see how the single PLOT is faked.

The server indicates that your first attachment is not accessible for download. I suspect that it's the filename. Could you reattach the first file, but using a different filename with no special characters like "+"?

Does it still go awry if you don't augment libname?

I can run it (with the libname change commented out).

note: the final plot uses `x` like a name, but at that point `x` is assigned a float value.

Are you trying to re-execute commands in the sheet out-of-order? If so we'd need to know the particular steps (presuming the issue is not due to something in your libname change...).

@Carl Love Yes, I more often think of it in terms of output effect in examples like for Factor.

It wouldn't normally occur to me to use it as an alternate terse input for a call that I'd expect to evaluate to something else -- as in the example given in this Question. I don't know whether the OP intends on using it in connection to generation of unevaluated function calls to aliased names.

@Carl Love I usually do the first of your alternatives, like,

    export XX:= Sqr1;

in order to get alternate spelling effects.

But then, I don't understand why anyone ever uses alias. It's like people playing the French Defense; I see how it works but I can't imagine ever wanting it.

First 36 37 38 39 40 41 42 Last Page 38 of 595