acer

31344 Reputation

29 Badges

19 years, 117 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@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.

If this is a very large animation then I suggest that you try:
1) remove all output from the worksheet
2) export the animation to .gif, and attach that after the worksheet

Or, just do 1).

We might have to re-run it, but at least we can make progress on helping with additional aspects.

@salim-barzani You wrote, "you did a great job but why forget a code for finding the parameter automaticaly at the matrices, i didn't know where i should rename and say find thus parameter if you do that it will be so good and if you do odetest like this stuff just you can do it will be ultra hight level code".

I didn't "forget" anything. I may have not done all you hoped for, but I didn't forget.

Your phrases, "...finding the parameter automaticaly at the matrices" in unintelligible to me. How you want to use all this with odetest is unclear. I didn't do those additional things you see to want because your mere hints about their nature are insufficient for me to understand the precise goals.

It's not just that the explanation is insufficient. It's almost nonexistent.

If you properly and adequately explain what more you want to do with this then I might try it. Fragments of your own code which don't accomplish your task are not an adequate explanation.

Which two of names present in expression M are going to be used as the plotting variables in plot3d?

Note that (in addition to mistakenly trying to use B[1],B[2] as the procedure's parameters) your substitution list doesn't all match the actual names present in expression M. The number of them is not right. The pairings are not right.

We can't fix it properly without knowing/guessing which two are the dependent variables for the plot3d.

Do you want the spinning cube to get its snapshots with the same frame-rate as the traced objects (time-dependent spacecurves).

Without a specific example I'd be tempted to go for the third option.
[edit: when initally I wrote this I'd completely missed the detail that the OP was intending the spacecurves to arise from dsolve/numeric results. Sorry. With that knowledge I'd prefer the 2nd approach offhand, using odeplot for the portion involving such curves.]

Do you think that the time to construct the animation will be a concern?

@Jesús Guillera Please put any close followup queries on this here, rather than on a wholly separate new Question thread.

Duplicate threads get flagged as such, and may be deleted by a moderator.

@C_R Some results may be stored in commands below the level of the procedure(s) returned by dsolve, and that can even include evalf (which has its own special kind of remember table).

And there may also be procedures with option remember,system which means that there's a remember table but its results are more transient and can get cleared by a garbage-collection (which can be triggered by memory use amounts).

I put in that 2nd call that you've noticed, because the timing detail you've mentioned is interesting. It's not as much of a gain as one gets by slapping option remember on the very procedure(s) returned by dsolve.

It's been a while since I poked around those procs returned by dsolve, in a comprehensive study. I don't recall full details offhand, sorry.

ps. Side-topic: be super careful/wary of putting option-remember on the returned procs if you intend on using them with dsolve/numeric's parameters option. You'd need to use forget, when changing parameter values on the fly. (As someone here once joked: if you remember to remember then don't forget to forget.)

@Andiguys As that error message indicates, it cannot store the etemp result in M because it is actually and equation of the form,
   delta = some_float
instead of being just a floating-point number.

You probably have seen before that you can get the float value out of such an equation with,
   eval(delta, etemp)

So the problematic line could be changed to,
   M[rr, 1 .. 3] := <Cv | Ce | eval(delta, etemp)>;

Question_plot_cv_ac3.mw

A few comments, if I may:

1) This methodology requires making assignments for each of the "functions" that are needed from the system. For some examples that makes the set-up following dsolve just a bit more work.
2) The original initial conditions need some special handling if you want to see/re-use them after assigning to the names of the functions. Sometimes people use different names, eg. X,Y,etc instead of x,y,etc to avoid this clobbering, but in that case additional eval/subs substitution steps are needed if the desired dependent formulas use the original names.
3) Prof. Gould has re-entered the OP's example original dependent formula in r assigned directly as an operator. But the OP originally gave it as an expression. If one programmatically obtains it as output (from elsewhere) as an expression then the operator form must be constructed (eg. unapply) as another step.
4) The computation times are be different. For this approach the computation time may rise more with the number of instances of dependent calls like x(t),y(t),etc appearing in the desired dependent formulas, depending on the example. This may or may not matter to you, depending on the formula and the DEs in question. (Such a timing penalty can be mitigated by adding option remember to the separate operators, after the extraction. But it's additional steps and requires more skill.)

MaplePrimes_-_Extract_dsolve_output_ac.mw

Not all these points will matter for every example. But it's not always hands-down better to use the listprocedure output. It's not hard to come up with examples that make either way look better. That's why there are options. :) Sometimes "best" means the way that makes more sense to you.

ps. I often use listprocedure. I shy off from assigning to the names of the functions in my DEs. (I prefer to be able to re-execute without any additional hassle.)

Please stop posting wholly separate new Question threads on this topic.

Instead, please add the followup queries in Comment/Replies here, or Branch from here.

Duplicate Question threads get flagged as such, and may be deleted by moderators.

nb. The Branch button exists at the bottom of your Question(s). Please use it. Using it will create cross-reference links from this Question to your new Followup Question threads -- and that allows anyone reading it to see that it relates to previous details and responses. It's not helpful to otherwise have the details completely separated.

[edit] This has been mentioned to you a few times before, including. July 27.

@C_R If you would really like to utilize an expression form calling sequence (without the need for uneval quotes each time you reference it) such as,
   plot( fr(t), t=0..1)
rather than an operator form calling sequence like,
   plot( fr, 0..1)
then you could instead construct fr in one of these ways:

   R := unapply('eval(r,dsol1(t))',t,numeric):

   R := proc(t)
       if not t::numeric then return 'procname'(t); end if;
       eval(r,dsol1(t));
   end proc:

The effect there is that both of those return fr(t) as the unevaluated function call itself when argument t is not of type numeric (eg. here, a symbol).

I suppose you already know that the numeric solving of this system faces some quirks & difficulties. Perhaps you are trying to investigate the numeric DE solver itself. If not, then without details it's hard to know whether you'd run into situations in which you might 1) want to specify stepsize or another option to dsolve, 2) augment the system if looking for integrals|derivatives versus post-calculation via evalf@D or evalf@Int, etc, 3) other...

@bathudaide Feel free to provide a URL for the author's code site.

(You asked before, "Can I upload it for discussion?", where "it" really does seem to mean "source code" from the previous sentence. So, no, you can't upload a copy of his source code here without permission. But you can provide a link to it.)

First 6 7 8 9 10 11 12 Last Page 8 of 574