acer

18245 Reputation

29 Badges

14 years, 243 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

So perhaps people would prefer it if removal of a vote/acceptance did not subtract a value. (And, naturally, that would need a flag internally, so that any subsequent re-vote by the same member would note add any value a second time.)

@Carl Love So, I suppose that phaseportrait is calling dsolve for each of the initial conditions (like how DEplot does). Whereas this use of odeplot (with parameters) calls dsolve once. So there must be quite a bit of setup overhead.

[This old post comparing odeplot and DEplot -- in animation -- is nine years old. Even then I wondered whether DEplot should leverage the parameters functionlity in dsolve, for better performance for IVP problems with multiple ICs. I recall submitting an SCR on it.]

Thanks, I wasn't thinking very hard about theta in the fieldplot. Perhaps I was confusing with number of ICs, weirdly. (4am and insomnia) I updated it.

I cannot say "why", because I do not know. But, it is possible that someone (not me) undid a recent upvote.

Ok, this meld of local declaration and evalf-extension seems easier to use, and can be done with 2D Input.

restart;

local %:=`%`:

`evalf/constant/%` := proc(x) 0.01; end proc:

 

 

P := 45*%

45*%

evalf(P)

.45

evalf(123*P*(1/7))

7.907142857

 

Download percent_loc_evalf_2.mw

@Christopher2222 Well, I think we all know how to use subs already. I meant, something with a more natural or directed syntax and meaning, like evalf, convert, etc.

Unfortunately the OP did not tell how he intended on using the %. For example, he did not state whether he wanted it to appear in input, or output, or both, etc. If he only needed it for input then he might as well do,
   local % := 0.01:
up front (or the exact 1/100). For example,

restart;
local % := 0.01:

foo:

45*%;

            0.45

45*% * 123/7;

         7.907142857

@Christopher2222 And how would you teach Maple to compute with that, as an actual percentage?

@vv The substitution for 2*Pi into the procedure works. And it's... somewhat easy to work with, sometimes. (I didn't think much, before, about all cases of using it like a shade-between.)

But I suspect that he does not want the disk closing off the top of the cylinder that one of his calls is generating.

@Christopher2222 As I said before, it is tricky not to be misled by the internal state and/or plot persistance. As just one possible example of trickiness, one may have to remove output from any Execution Group and re-execute just to clear some of the internal state markers in play -- not doing so can mean that the current attempt is utterly invalidated. And there seem to be additional markers in play, meaning that it's even trickier to get a clean slate.

There is no mechanism inside plots:-display which guarantees the successful rendering of the projection. But that doesn't stop anyone from getting lucky.

@Jean-Claude Arbaut Another example of interest,

restart;
Digits:=20:
seq( ((n+1.)/n)^(n+1.), n=3..3);

         3.1604938271604938268

restart;
Digits:=20:
seq( evalf(((n+1)/n)^(n+1)), n=3..3);

         3.1604938271604938272

And, yes, here is the result of the single call to procedure u that was made in construction of the a list by using $. As you've subsequently noted, it contains the float 1. (which induces float contagion, so as to get the final float results in list a).

restart;
u:=proc(n) evalf(((n+1)/n)^(n+1)) end proc:

u(n);

         ((n+1.)/n)^(n+1.)

[Edit] My original Answer demonstrated (as intended) that the crucial difference was between results due to float contagion versus results due to ten separate evalf calls. However I originally utilized n=3.0 instead of the evalf'd expression involving name n -- since both induce that float contagion. I figured that was adequate to explain the phenomenon, but I see now that I ought to have been precise. I updated my Answer -- to make it more precise -- as I reinstated it after accidental deletion by someone else.

@Christopher2222 No, that does not always work (partially for the reasons I gave above).

I just tried it in Maple 2020, and it failed the very first time, in a fresh Worksheet. Sometimes it works, and sometimes it does not.

You did not test your suggestion carefully enough. The order in which the PROJECTION and ORIENTATION substructures appear in the result can vary, even with your suggested use of plots:-display.

I got it to pass/fail by using execution-line-by-line-Enter versus !!! from the menubar. I got it to pass/fail according to what went on earlier in the session. (The order generated by the stock commands seem to be session dependent.)

 

@Melvin Brown Ahh, perhsps you would like to have the saved image files be used as the `background` of the very plot on which you click. Yes, you can do that with a single Plot Component. You could also do it with Explore markers, I think.

I'll try to cook up an illustrative example.

@Melvin Brown 

As Valerie has described, you can utilize Embedded Components for this.

Its still not 100% clear to me whether your PDE solutions are previously computed as plots (in the same Maple session) or as saved external image files.

You can have one Plot Component with some "action" code that discerns where you clicked (or the nearest point on a curve to the click point, etc). So then you have, programmatically, [xi,S(xi)].

You can have another Embedded Component for displaying the assciated PDE solutions. If the PDE solutions are actual Maple plots in the session (previously computed, or computed on the fly) then you could utilize a second Plot Component to show them. If the PDE solutions are external image files then you could utilize a Label Component to render them.

The "action" code of the first Plot Component could also programmatically put the associated PDE solution into the second component (whichever was suitable).

It's difficult to provide fuller details without having the actual full example at hand.

What do you mean by, "opens up a graphical file which is parameterised by (xi, S(xi))"?

Do you mean that clicking on/near the point (xi,S(xi)) in one plot would cause another plot to be constructed (and possibly displayed either beside or in lieu of the original)? That is quite straightforward to do, using Plot Components.

Of by "file" did you really mean that you already have some premade graphical format files (.jpg, etc, on your machine), and that that you want the click action to somehow open on of those somehow?

Or perhaps you want some combination of those? Please explain.

@schapplm Yes! Very good. This is the main point that I put in my Answer (composed while you were submitting your Comment). Avoid naming conflicts up front, rather than trying to manage them by kludges.

@schapplm I believe that you'll find that your workaround simplify3 does not work. Try it with an expression within Matrix v, such as was assigned to your earlier T. Ie. the l1,l2 within v(1) will get evaluated.  You could call simplify2(v[1,1]) instead.

3 4 5 6 7 8 9 Last Page 5 of 414