acer

31297 Reputation

29 Badges

19 years, 111 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Next time could plese use the Branch button right below your previous Question's body?

That automatically inserts cross-reference URLs into both the new and the old Question. It's not so helpful if readers of either Question thread don't know that it's part of a multi-thread discussion.

Can all your unknowns be taken as being purely real-valued? If so then can you apply the evalc command to your expression.

Note that you have as yet given no explanation of what it is that you're trying to accomplish.

@Scot Gould Sorry to repeat it, but there is also that same Vector/sum example with explanation on the sum,details Help page.

You can put close followups to this here, instead of spawning wholly separate new Question threads on it.

If the material is on the same topic, but significantly different, then you could use the Branch button at the bottom of your Question's main body, to spawn a new Question that automatically includes cross-reference links. (Without the links, knowledge and details and attempts are hidden from unsuspecting readers, which is not at all useful.)

Duplicate un-branched Questions get flagged as such and may be deleted.

@AHSAN Well, I'd already seen the y=h=k+(1-k)*x related stuff in your sheet even before your last comment. It wasn't making full sense to me even with that knowledge. I don't know why you chose that full paramSet earlier, and how it's justified to pass those equations to dsolve and now (apparently, according to you) utilize that dsolve solution in this x<>0, y=k+(1-k)*x situation. I was wondering whether possibly you wanted/intended a dchange in the formula (or the DE passed), or to call dsolve again, or... soemthing else. Also, using the range 0..1 for both y and (apparently) x also seems unclear to me.

Your worksheet has almost no explanation of justification of its steps. Your previous two Replies' comments don't make the details clear to me.

You wrote, "...we now need to use the solution of u(y) in Eq. (1) and plot the solution for diff(p(x), x), against x=0..1". Now, your formula in Eq.1, which you equate to dpdx, is a function of y, not of x. Is dchange what you want!? Or...!?

What of the range?

And why use the earlier solution from dsolve, when you say that relates to x=0? What did that mean?

Are there not infinitely many solutions, with x9 arbitrary and the others all zero?

What other ranges do you know, which have roots?

Download question1118_ac.mw

@AHSAN I don't see how you've explained anything. You get the same plot as before (in two ways) if instead you use the LHS of your eq1.

Help_Numeric_Solution_ac3.mw

Again, you don't need to "extract" the parts of the dsolve result to do that; the odeplot command handles such a formula automatically.

But now I've shown you one way with the extracted procedures from dsolve (correcting you attempt), and also two ways without having do do that more complicated approach.

All three produce the same plots. If that doesn't match your expectation for the plots then I suggest you look for another kind of cause.

For example: what is the role that you imagine to be played by the name x? You write of dpdx. But the independent variable in your differential equations is y. What exactly (and in proper detail, please), in your mind, is the relationship between y and x? I think that your posting is unclear on this.

Also, I've merely corrected your faulty substitution and the dsolve return. I'm just following your approach to the same dpdx formula -- except I've had to guess that the y vs x muddle because you haven't explained it. Perhaps you've made some miscalculation?

@Christopher2222 Setting Digits:=5 is a bad idea. Doing that in one's init file is a very bad idea.

One might use items like interface(displayprecision) instead (including that in an init file), although they're not quite as flexible as the Numeric Formatting.

I'm not sure that I completely understand your dpdx formula.

But, in terms of using the dsolve return and the parameter values, could the following be something like what you'e trying to accomplish!? You'll also need something like output=listprocedure along with your scheme of substituting the returned dsolve procs into the dpdx formula.

Help_Numeric_Solution_ac.mw

Note that odeplot itself is quite capable of accepting that dpdx formula without your having to manually substitute from the dsolve return. That substitution of the returned procs is not necessary, just to use those functions (in y) and their derivatives in odeplot. So here I just pass the straight formula involving derivative expressions (no extracted procs), which also means I didn't need to use listprocedure.

Help_Numeric_Solution_ac2.mw

Note that in both appoaches those new plots appear flat. You could check that aspect, the dpdx formula, etc. (What does "x" mean to you, in that context?)

@dharr I missed the manual re-insertion, sorry.

In my experience, combine brings constant factors inside an integrand, whilst simplify usually does the opposite.

(vote up, of course)

@dharr A negative sign seems to have disappeared.

(You might instead use combine(inte_eq) in the first step.)

@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:
4 5 6 7 8 9 10 Last Page 6 of 574