acer

32647 Reputation

29 Badges

20 years, 57 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@C_R Yes, the Java GUI can really struggle (in internal memory management?) with 3D animations that are modestly large.

Sometimes I've resorted to Explore, intsead. That command can animate, but only puts one frame at a time in the GUI's PlotComponent.

There's even a variant I've tried where I precompute all the frames up front, in a list L, and then Explore the frames L[i], w.r.t. a posint-valued parameter `i`. That parameter can be animated via an Explore option.

@sidyly1211 

Do you mean something like one of these?

enfonction_p_2_cas1_acP.mw
 

 

 

ps. If anyone's interested why I extracted the data for the curves from the 3D surfaces plot structure, instead of simply animating w.r.t. `t` the 2D plots of the original functions of `a`, my reasons are as follows: In Maple 2019 it was noticeably slower to do so. This has come up before, in some past discussion threads on this forum.

It is better to compute the values for all `t`, given each `a` value in turn. Picking a particular parameter `t` value and then asking the solver to compute the result at all `a` values can be markedly slower. That makes the solver repeatedly compute/throw-away the earlier (in time `t`) numeric DE results. There is a performance difference in the orderings in which `a` and `t` are used as independent variables here.

So, having constructed the 3D surfaces in the more efficient ordering, I then extracted the height data from the 3D plotting structures as a sequence of Vectors, to build the alternate ordering's 2D curves.

This approach can be faster without even striving for all optimizations (eg. I didn't even both to extract the data Matrix just once, up front).

Are you seeing this as new behavior?

If so, then were you seeing it before the Maple 2024.2 point-release? Etc.

This sounds like something for a bug-report, including worksheet, OS details, version details, etc. Try support@maplesoft.com

Could you not make a smaller edit to your original, rather than have two conditional branches in which X can attain?

F:=proc(X::anything,x::symbol)
    local la,y,n;
    if patmatch(X, (y::anything)^(n::'nonunit'(anything)) ,'la')
      and eval(y,la)<>1 then
        f(eval(n,la));
    else
        X;
    end if;
end proc:

@Scot Gould 

I started out just trying to mention that using odeplot is generally better that plotting extracted procedures/functions via the plot command. I'm pretty sure that that generally true, even if in practice it's just means that it's faster.

And then I digressed about the output choices, sorry! I'm sure there's no issue with our disagreeing about how hard or error prone manual use of the default output=procedurelist might be. Comparing those two output choices is a sidebar here.

I wonder whether it might be nicer if odeplot could use pi-ticks automagically on a relevant axis, say if either component of the "view" (eg. [x,y(x)] or [y(x),x)]) were simply the independent variable and the supplied range involved multiples of Pi.

@Scot Gould The dsolve,numeric command does not return a "solution module". That's not correct nomenclature, sorry. (It is pdsolve,numeric which does that.)

By default (output=procedurelist) it returns a procedure which when called with a numeric value then returns a list of the results.

Using output=listprocedure it returns a list of procedures which when each called with a numeric value return the corresponding result.

Extracting final values from either approach can be done using eval, with strong similarities. Eg, for a single value of the independent variable,

de := {diff(y(t),t,t)=cos(t),y(0)=1,D(y)(0)=0}:

solsPL := dsolve(de, numeric, output=listprocedure):

eval(y(t), solsPL)(2.4);
                        2.73739313285275

solLP := dsolve(de, numeric): # default output=listprocedure

eval(y(t), solLP(2.4));
                        2.73739313285275

One difference is that with output=listprocedure the extraction (eval) can be done just once (per dependent function), up front, and then utilized for multiple values of the independent variable. For some people that's an advantage, since in contrast the output=procedurelist return needs extraction (eval) for each value of the independent variable.

As for procedures which one could pass to the plot command and get the pi-tickmarks on the first axis due just to the choice of supplied range, well, that too can be done for either output form. It's only slightly more effort to build such a "function" from the dsolve return in the output=procedurelist case. But stand-alone procedures can be had from both approaches.

YPL := eval(y(t),solsPL):
YPL(2.4);
plot(YPL, 0..4*Pi);

YLP := s->eval(y(t),solsLP(s)):
YLP(2.4);
plot(YLP, 0..4*Pi);

I'm not sure that I understand why the latter of those might be taken as significantly harder to remember than the first. It's a little more effort.

Note that with either of these output choices the odeplot command will more generally produce a better plot, and more quickly, that will another plotting command such as plot. For the OP's simple example there may be no easily discernable difference.

So I would say that in general it is better to specify the pi-ticks in odeplot then it is to utilize the plot command and get any pi-ticks just be virtue of the particular supplied range.

There are some alternatives which deal specifically with each axis separately.

For the horizontal (first) axis,

  xtickmarks = piticks

or,

   axis[1] = [tickmarks = piticks]

See also the Help page for tickmarks.

I got the impression that this talk was by a member of a team that is working on enhancements to that package's functionality, and that the video is showing current results of that. In other words, it seemed to me like a report on current progress, which might have attained since the last major Maple release.

This supposition seems (to me) to be borne out by the speech and text appearing between 33:00 and 37:00 in the video.

ps. The presenter works with ORRCA, and there are tie-ins between that group and development of Maple's RegularChains, etc. This is one of a few research groups which contribute to Maple. It's quite common for such conference talks to show current development.

@Eunsang 

1) You write of problems when you make the step timestep too large. You also write of wanting, "higer [sic] spacestep". Are you sure that you don't mean smaller?

1) What is the specific desired spacestep that you want?

2) Do you know what timestep you want to use? Or do you just want the smallest timestep for which the computation is quick enough, when using your target spacestep? How fast is fast enough?

3) Are you seeing aspects in the plot that seem qualitatively wrong to you, due to, say, overly coarse step sizes?

4) You wrote, "I tried to find the optimal plotting points by adjusting the timestep while maintaining the desired spacestep...". What does "optimal plotting points" mean, exactly?

5) Do you have concerns about the scaling in your system, or suspect numeric difficulties due to inadequate working precision?

6) Your constant values contain floats like 0.33 and 3.14.  Are those coarse approximations of 1/3 and Pi? Do your have more accurate values for any of the floats and, if so, any reason not to use them?

@Blanc 

restart;

kernelopts(version);

`Maple 2023.2, X86 64 LINUX, Nov 24 2023, Build ID 1762575`

f := (x, n) -> 2^n/(1 + n*2^n*x^2) - 2*x^2*(2^n)^2*n/(1 + n*2^n*x^2)^2;

proc (x, n) options operator, arrow; 2^n/(1+n*2^n*x^2)-2*x^2*(2^n)^2*n/(1+n*2^n*x^2)^2 end proc

Eq := factor(f(x,n));

-2^n*(n*2^n*x^2-1)/(1+n*2^n*x^2)^2

solve(Eq>0, x) assuming  n>0;

{x < 1/(n*2^n)^(1/2), -1/(n*2^n)^(1/2) < x}

solve(Eq>0, x) assuming  n=0;

x

solve(Eq>0, x) assuming  n<0;

{x < -1/(-n*2^n)^(1/2)}, {x < 1/(-n*2^n)^(1/2), -1/(-n*2^n)^(1/2) < x}, {1/(-n*2^n)^(1/2) < x}

Download s_k_2023.mw

@Gabriel Barcellos And yet you seem to be asking how you might make something occupy a common physical distance on different screens regardless of their respective resolution settings.

Your request contains a contradiction.

@Gabriel Barcellos Do you believe that you can control the resolution of other people's computer screens?

@Ronan The Vector(n) is also a call to the Vector constructor, as well as a type.

If you want to use it as a type, in an argument to the type command, then you need to keep it as that (literal) unevaluated function call and prevent it from evaluating and becoming an rtable data structure.

Try it instead as either
   ''Vector''(n)$1    # 2 nested pairs of single right-ticks, not quotation marks
or,
   'Vector'(n)
so that type receives the unevaluated function call in the argument.

Ronan_tp_ex.mw

@C_R When you first wrote your Question (and I replied) I overlooked the mention at its end about dsolve,numeric. Sorry.

If I'd realized that then I would not have suggested your 3rd approach offhand. I'd almost always prefer using odeplot rather than the extracted procedures -- if time/memory efficiency were especially needed, or if animations were the result. It's not just how odeplot efficiently uses/re-uses dsolve's the constructed piecewise interpolants; it's also basic stuff like not bouncing around to poll independent (time) values (that 1D plotting can do) without any the right constrained purposes, or crudely forcing regular spacing even when it doesn't help (ie. ignoring curvature) when using spacecurve + extracted dsolve procs, etc.

@C_R 

In your attachment the two animated portions don't interleave rightly, in the sense that both were created for t=0..10, and presumably are wanted by you as sync'd when combined. That's because they don't have the same number of frames; only one has 150 frames. The one with fewer frames is crammed into the front portion of the other. Are you aware of this?  Is that your question/problem?

Also, is there a reason not to use the background option of animate?

Is it a problem that the overall construction is too large in memory or structure size? Or for any of the three portions? If so then can you bear to have a slightly less smooth curve, as t gets large? If you don't need to export then could you animate via Explore instead, so that only one frame is constructed at a time and memory usage is reduced?

I'm not sure what exactly is your question now.

First 28 29 30 31 32 33 34 Last Page 30 of 597