acer

32460 Reputation

29 Badges

20 years, 2 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Do you work with interface(typesetting) as extended, or standard? It can make a difference, for some workarounds.

@weidade37211 I've added a few faster approaches to my Question, now edited.

One key problem in your original was coding it so as to perform the symbolic integration  int(f(x),x=0..y)  where y is a nonnumeric symbolic name. Your 2D Input of the integral is pretty-printed in black in your original, denoting the active int command.

Using a restricted range can also help the numeric root-finder (ie. fsolve).

@nmacsai I also added an alternative workaround, using a wrapping call to plots:-display.

The approach of altering the Histogram procedure is easier only if you put the preamble code in an initialization file (which would be done just once). After that the Histogram command handles your example directly.

But if you don't mind the little extra bit of typing then the plots:-display approach is also an easy way to handle your example.

@mmcdara Your comment doesn't pertain to the OP's example. And so I removed the additional, concocted example to which you objected -- which was only a sidebar here and didn't demonstrate the OP's problem.

You might discuss the new format=stacked functionality elsewhere. That's not the main subject of this Question thread.

@Guimzo Have you considered describing exactly what you want?

@David Sycamore 

Here is a worksheet. Does it run ok for you (without your making any edits to it)?

If not then you should tell us what version of Maple you are using. You should also upload and attach you'r problematic worksheet using the green up-arrow in the Mapleprimes editor.

So far you've only told us that you cannot get what you want, without actually providing us with exactly whatever you've been trying.

restart

ina := proc (n) false end proc:

L := [seq(a(n), n = 1 .. 100)];

[1, 3, 5, 7, 2, 9, 11, 13, 4, 15, 17, 19, 8, 21, 23, 25, 16, 27, 29, 31, 10, 33, 37, 41, 14, 39, 43, 47, 20, 49, 51, 53, 22, 35, 57, 59, 26, 55, 61, 63, 32, 65, 67, 69, 28, 71, 73, 45, 34, 77, 79, 75, 38, 83, 89, 81, 40, 91, 97, 87, 44, 85, 101, 93, 46, 95, 103, 99, 52, 107, 109, 105, 58, 113, 121, 111, 50, 119, 127, 117, 62, 115, 131, 123, 56, 125, 137, 129, 64, 133, 139, 135, 68, 143, 149, 141, 70, 151, 157, 153]

plots:-listplot(L, style = point);

plots:-listplot(L, style = point, axis[1] = [mode = log], axis[2] = [mode = log]);

plots:-loglogplot([seq([i, L[i]], i = 1 .. nops(L))], style = point);

 

Download ptplot.mw

@Preben Alsholm I wasn't paying close attention, sorry -- it could have been as short as 10 minutes, and I doubt it took longer than 3/4 of an hour. I did it on Maple 2022.0 on Linux.

@bobtom Do you mean output like this?

[seq([seq([a[i,j],b[(9/2-j/2)*j-i+1]],
          i=5-j..1,-1)],
     j=1..4)];

   [[[a[4, 1], b[1]], [a[3, 1], b[2]], [a[2, 1], b[3]], [a[1, 1], b[4]]],

    [[a[3, 2], b[5]], [a[2, 2], b[6]], [a[1, 2], b[7]]],

    [[a[2, 3], b[8]], [a[1, 3], b[9]]], [[a[1, 4], b[10]]]]

Another way to consider that is as the following, when N=4,

[seq([seq([a[i,j],b[j*(2*N-j+1)/2-i+1]],
          i=N-j+1..1,-1)],
     j=1..N)];

@Lennaert van Veen Is there a reason to not make the (free) upgrade to the point-release 2021.2?

Does the problem persist if you close both the left panel (palettes), and the right panel (context-actions)?

Are you using Maple version 2021.0 or the (free upgrades to) versions 2021.1, or 2021.2?

It's good that the errant setting of that environment variable has been identified.

It might even be appropriate if the shell script that launches Maple were itself to set,
    export MKL_INTERFACE_LAYER=LP64
or similar. I'm not sure. I will submit a query. (I don't recommend it, as yet.)

But it's still a mystery why the error message you received indicates the presence of that shared library in your Maple installation's subdirectory. You showed the error message as,

   INTEL MKL ERROR: /home/jet08013/maple2022/bin.X86_64_LINUX/libmkl_gf_lp64.so: undefined symbol: mkl_blas_cdgmm_batch_strided.

But if that shared library isn't actually present in that directory then the message could be expected as,

   INTEL MKL ERROR: /home/jet08013/maple2022/bin.X86_64_LINUX/libmkl_gf_lp64.so: cannot open shared object file: No such file or directory.

Is that shared object library actually present in your Maple's bin.X86_64_LINUX subdirectory? If so, then I wonder how it got there. (I don't think that any of the new Maple 2022 python/jupyter setup adds that on purpose.)

@Iza If the color or align options appear outside of any list of the items then it acts like a default for that call to textplot. But each sublist item can have its own instance of those options.

This explained (briefly, without a later, accompanying example AFAICS) in the following bullet point in the Description section of the Help page for the textplot command:

   The align, color, font and rotation options may be included
   within a text point list, in which case they apply only to that
   particular point.

That makes it act a little differently from some other plotting commands, where multiple items get handled by allowing each option to be given in the form optionname=list.

For example,

restart;

with(plots):

p1,p2 := [0.5,1], [1.5,1]:

 

display(
  pointplot([p1,p2],symbol=solidcircle),

  # These share color and alignment
  textplot([ [p1[], "zebra"], [p2[], "coal"] ],
           'color'="Green",
           'align'=['above','right']),

  # These have individual color and alignment
  textplot([ [p1[], "boot", 'color'="Red",
             'align'=['above','left']],
             [p2[], "seed", 'color'="Blue",
             'align'=['below','left']] ]),

  background="#c0c0c0",
  view=[0..2,0.5..1.5], size=[500,300], scaling=constrained
);

 

Download textplot_ex.mw

@Iza With a correction to the second example, the two end-effects are visually similar.

In the second example you don't need to invoke
  display(plot1);
because plot1 is already the animation. You can show it simply by typing,
  plot1;
or even,
  print(plot1);
The plots:-display command is for merging plots and adding effects. You don't need to invoke it simply to get the result shown. In fact your second example's last line is not correct; if plot1 is already an animation (and, it is) then you'd want to invoke that last line instead as,
  display(plot1, 'insequence');
Otherwise you'll get all the frames shown individually in a GUI Table. But, as mentioned, you don't even need to call display in that last line.

All else being equal, and if the individual animations are not needed separately, then I prefer the second example. Merging separate animations (like the first example) works but sometimes there are "gotchas" and quirks. There's no reason for doing it that way, and I think it is kludgy.

Done right, the two approaches can produce similar visual results. The resulting two final animation structures are not identical. Your first example's final result takes a bit more memory to store. And, as written, your first example consumes more memory since it also has both individual animations stored separately.

@Iza Please see my previous comment's attachment. I think that it demonstrates a basic approach.

I think that trying to use the animate command directly with its animating parameter being the same `a` as in your expressons will be less basic, and considerably more complicated, for you. That is due to using compound plots (ie. plots:-display of curves, text, pointplots, etc). Evaluation rules will require you to utilize right-tick unevaluation quotes (even doubles of those, if you proceed as in another recent Question thread of yours). That is far more tricky and complicated for a newer user than is my approach of using a simple procedure as I did here.

By using a procedure I got rid of all need to protect (by quoting) against premature evaluation. I also got to compute the heights y1,y2 just once, and then reuse them as need in several kinds of plot parts -- that adds legibility/simplicity as well as some minor efficiency.

In contrast to the procedure approach in my answer, the following involves a more complicated and tricky call to the animate command, as well as even more uneval-quoting -- which is error-prone for the newer user. And it also lacks the convenient means of testing just a single frame.

restart;
with(plots):
f1 := x->a*x^2:
f2 := x->a*x^2 + 0.3:
x1,x2 := 1.0, a/2;
y1 := eval(f1(x),[x=x1]);
y2 := eval(f2(x),[x=x2]);

animate(display,
        ['plot'([f1(x),f2(x)], x = -1 .. 1,
                'color' = ["Green","Red"], 'thickness' = 3),
         'pointplot'([[x1,y1],[x2,y2]],
                     'symbolsize'=15, 'color' = ["Green","Red"]),
         'textplot'([[x1, y1, 'sprintf'("f1(1.0)=%.4f",y1)],
                     [x2, y2, 'sprintf'("f2(a/2)=%.4f",y2)]],
                    'align'=[':-below',':-right'])],
        a = 0.2 .. 1.2);

 

I'll mention another convenience of the procedural approach in my Answer: it makes it very easy to work with Explore as well as plots:-animate. You only have to change,
   plots:-animate(F, [a], a = 0.2 .. 1.2);
to,
   Explore(F(a), a = 0.2 .. 1.2);

But without that procedure F, the followup code (in this very response) needs various edits to change bracketing and remove some quotes, in order to be passed into Explore. Those edits are not so easy for every new user.

@Iza Here is a single frame, without a procedure, using a fixed value A:=0.5 . You can change that value, and get a different frame.

plotting_param_textplot.mw

My point is that using A (in this manner) makes it more organized and thus easer to put into a procedure, and thus more straightforward to animate.

The parameter named A is distinct from the name `a` in your expressions so that it can all be put directly into a procedure.

You are not forced to accept my point of view. To me, your stated task is quite simple; but of course I understand that it might not be simple for everyone. That's fine. And that's why I've tried to make it more organized in terms of how it uses a parameter by which it could be animated. If something isn't easy for you, then more organization can help.

First 110 111 112 113 114 115 116 Last Page 112 of 594