acer

32343 Reputation

29 Badges

19 years, 327 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

If you have a followup question about this example then please add it here in a comment, instead of posting a separate Question thread and splitting the content.

Also possibly worth mentioning:

restart;

kernelopts(version);

   Maple 2021.1, X86 64 LINUX, May 19 2021, Build ID 1539851

ode_orginal:=1/3*(-2*x^(5/2)+3*y(x)^(5/3))/x^(3/2)*diff(y(x),x)/y(x)^(5/3)
             +1/2*(2*x^(5/2)-3*y(x)^(5/3))/x^(5/2)/y(x)^(2/3) = 0:

dsolve(expand(ode_orginal),y(x));

                          (3/2)
              y(x) = _C1 x     

Here is a result. Let us know if it's acceptable. (I made up ranges for lambda and a, as parameters.)

WB_Fractional_Derivative_ac.mw

 

@luthfiirsyad26 Thanks for that.

I changed your Question from Maple 2018 to Maple 18, since that is the version in which your attachment was last saved.

Do you have candidate ranges for lambda and a, which I suppose are your parameters?

@mapleatha The animate command passes a float to the plotting command (according to the current frame number and the numeric range). That is what happens. It doesn't have special behavior for the special case that that all such values happen to be integers.

You can also utilize a larger value for the frames options, and you could also utilize ceil or floor instead of trunc. It depends on on what kind of effect you want.

The key thing is that -- when the animating parameter theta gets instantiated with a numeric value -- the index is valid (ie. a natural number).

[edit] A simple alternative, for your example, is to utilize plots:-display of a sequence of plots generated directly from the list. Eg,

plots:-display(seq(F(theta), theta=L), insequence);

As yet another alternative, the Explore command allows for a sequence of integers to be passed, without need for trunc (or an other mechanism to convert from float to integer, to make a valid index into the list). Eg, for comparison,

restart;
F := theta -> plot(sin(x*theta), x=0..2*Pi,
                   caption=typeset("theta =",theta)):
L := [seq(sqrt(i),i=1..20)]:

plots:-animate(F, [L[trunc(i)]], i=1..nops(L),
               paraminfo=true, frames=nops(L));

Explore(F(L[i]), i=1..nops(L), numframes=nops(L), animate);

or even,

Explore(F(theta), theta=L, animate, placement=bottom);

or,

Explore(F(theta), parameters=[[theta=L, controller=slider]],
        animate, numframes=nops(L), placement=bottom);

You could show us what you have got so far. You can upload (and attach a link!) your worksheet using the green up-arrow in the Mapleprimes editor.

@Rouben Rostamian  I see now, thanks.

I'll file the examples below, and also yours using setoptions up front.

Fwiw, you may be able to get by with " " the single black space. You could also use `` the empty name, but since that isn't protected it would more safely be used as ':-``' though even that can get accidentally evaluated. The empty string case is more robust, terse, and ideally would work.

In the following (without any setoptions call in an initialization file) the first two look wrong.

restart;

plots:-display(plot(x^2, x=-1..1),
               labelfont=[TIMES,16], labels=["",""]):
indets(%,specfunc(anything,AXESLABELS));

   {AXESLABELS(x, "", FONT(TIMES, 16))}

plots:-display(plot(x^2, x=-1..1),
               labels=["",""], labelfont=[TIMES,16]):
indets(%,specfunc(anything,AXESLABELS));

   {AXESLABELS(x, "", FONT(TIMES, 16))}

plots:-display(plot(x^2, x=-1..1),
               labels=["",""]):
indets(%,specfunc(anything,AXESLABELS));

         {AXESLABELS("", "")}

plots:-display(plot(x^2, x=-1..1),
               labelfont=[TIMES,16], labels=[``,``]):
indets(%,specfunc(anything,AXESLABELS));

   {AXESLABELS(``, ``, FONT(TIMES, 16))}

plots:-display(plot(x^2, x=-1..1),
               labels=[``,``], labelfont=[TIMES,16]):
indets(%,specfunc(anything,AXESLABELS));

   {AXESLABELS(``, ``, FONT(TIMES, 16))}

plots:-display(plot(x^2, x=-1..1),
               labels=[``,``]):
indets(%,specfunc(anything,AXESLABELS));

         {AXESLABELS(``, ``)}

ps. These examples are supposed to work without need of overrideoption. That is intended to force clobbering of options which get set "locally" inside plotting substructures which designate curves, surfaces, etc. The AXESLABELS substructure is "global" in the sense that it gets uniquified within the whole plotting structure, and it exists outside the plotting substructures which designate curves, surfaces, etc. I suppose that you were demonstrating merely that it did not help here.

@mapleatha You're very welcome. I'm sorry that I didn't think of the discrepency until I saw your followups.

(I suspect that Kitonum realized what the problem was, and gave his working equivalent, before I did.)

@mapleatha In Maple 13 the plots:-animate command did not automatically (graciously) invoke plots:-display in your case that the animating procedure returned a sequence of plotting structures.

Try this,

restart;

F := proc(t)
plots:-display(
plottools[line]([-2,0], [cos(t)-2, sin(t)], color=blue,thickness=3),
plottools[line]([cos(t)-2, sin(t)], [t, sin(t)], color=blue,thickness=3),
plot(sin(x), x=0..t, view=[-3..7, -5..5],thickness=3));
end proc:

plots:-animate(F,
               [theta],theta=0..2*Pi,
               background=plot([cos(t)-2,sin(t),t=0..2*Pi],thickness=3),
               scaling=constrained,axes=none);

Note that the example on the Online Help webpage is designed for current Maple. Hence it does not contain the (now unnecessary, in Maple 2021) extra call to plots:-display. But if you look at the example in Maple 13.01 it actually contains this variant,

with(plots):
# followed further by the following...

F := proc(t)
     plots[display](
plottools[line]([-2,0], [cos(t)-2, sin(t)], color=blue),
plottools[line]([cos(t)-2, sin(t)], [t, sin(t)], color=blue),
plot(sin(x), x=0..t, view=[-3..7, -5..5])
     );
end proc:
animate(F,[theta], theta=0..2*Pi,
        background=plot([cos(t)-2, sin(t), t=0..2*Pi]),
        scaling=constrained, axes=none);

So it appears that you may have mistakenly copied the example from the Online Help instead of from your Maple 13's own Help page.

@mapleatha Please upload and attach the worksheet which reproduces the problem.

Your last Reply contained a typo. That may not be the cause  but it's a hint that it's not productive to guess what code you are actually executing.

@Rouben Rostamian  If I rerun the followup example in your attached Worksheet in my Maple 2021.1 for Linux with the same Build ID, then the label "x" does not appear.

That happens for me, whether I execute line by line with the Enter key, or use the menubar's !!! button.

@nm The given syntactic/structural query will not consider 1/exp(z) the same as exp(-z). Nor would it consider exp(z/2)^2 the same as exp(z).

Perhaps you might consider some attempt at canonicalization prior to making your type queries. Eg,
  expr:=A*exp(z/2)^2*sqrt(h)+a*exp(z)*sqrt(h)+exp(z)*sqrt(h)+1/(3*exp(z)*sqrt(h));
  new := combine(expr,exp);

etc. Also of interest might be combine(...,power) .

There may be other cases that require attention. For example, would you ever want that some subexpr^(3/2) treated similarly to the handling of "sqrt"s?

And what about other equivalent forms? How about the following forms?
   1/3*(3*a*exp(z)*h+3*h*exp(z)+exp(-z))/h^(1/2)
   1/3*(3*a*exp(z)^2*h+3*exp(z)^2*h+1)/exp(z)/h^(1/2)

If you would want only some specific kinds of canonicalization but never certain others then the onus would be on you to be very specific in detailing the complete requirements.

@Rouben Rostamian  In which version, platform, and input environment are you getting that?

You can put your followup examples here, if someone's Answer's code here doesn't handle the additional cases which you forgot or couldn't be bothered to mention here in the first place.

But don't submit further followup examples in separate Question threads. (You've been told this several times before.)

This is a very good question.

Unfortunately, I don't know a way to completely prevent the AXEXLABELS substructure from being present (without forcibly removing it, as you already showed).

You are right that it is a waste of space, around the plots. And a smaller plot (eg. 200x200 or so pixels for the plot widow...) clearly reveal the wasted space.

As the author of several applications which utilize animated plots within PlotComponents I will say that this is the kind of sloppy GUI handling of plots that really gets in the way of producing better quality results. Jitter in the axes frame, loss of valuable space, lack of symmetry in the visible rendering, and trouble with aligning axes of stacked plots, are just some of the difficulties that application authors encounter that really ought all to be avoidable.

Here is another worksheet that demonstrates the problem. (Uncomment the plots:-display calls for yet another view of the wasted space.) This demonstrates, unfortunately, that Kitonum's suggestion to simply omit the labels option is wholly inadequate and does not fix the underlying issue.

wasted_label_space.mw

I am going to submit a bug report, not so much gainst the GUI's plot drivers for rendering the wasted space as against the Library-side plot constructors for including AXESLABELS("","")  when not requested. (Sometimes the latter kind of silliness gets introduced as a band-aid for irritations with GUI "plot persistence". But I get fed up with dealing with the ensuing difficulties of patches for patches...)

First 131 132 133 134 135 136 137 Last Page 133 of 592