awass

261 Reputation

10 Badges

16 years, 282 days

MaplePrimes Activity


These are replies submitted by awass

@Markiyan Hirnyk 

 

I noticed this also-more than 3 notifications and they happened after I had responded.

 

On the other hand many comments and replies  disappeared from my questions as saved.

@Alejandro Jakubi 

That makes sense. Is there a simple way to do the "heavy" work in the CLI and then transfer the results to the GUI version for display?

I was not familiar with the command line interface but I tried it and command period did stop the computation. (BTW, that is one fast interface!)

@Carl Love  Thank you for your reply.

 I did not think of using eval that way; it is easier yet.

@Carl Love  Thank you for your reply.

 I did not think of using eval that way; it is easier yet.

@Carl Love 

Thanks for the pointer to the documentation and the explanation. I am glad it all makes sense; I will let the subtleties pass me by.

By the way, is it considerd good practice to use the "use" command as follows?

>use d=3,a=5 in plot(x^d,x=0.1..a) end use;

I can see many situations where it is preferable to "subs" or "assuming"

@Carl Love 

Thanks for the pointer to the documentation and the explanation. I am glad it all makes sense; I will let the subtleties pass me by.

By the way, is it considerd good practice to use the "use" command as follows?

>use d=3,a=5 in plot(x^d,x=0.1..a) end use;

I can see many situations where it is preferable to "subs" or "assuming"

I wonder why you used the (to me, arcane) `+` construct to give an "elegant" solution. I cannot find any documentation on the use of the `f` notation except for f = + or *. Why not just use add or mul? They are much more intuitive e.g,

sqrt(mul(x,x in select(isprime, [$1..100])[]));




I imagine there might be other issues involved as well as maters of taste but I found add to be a tad faster than `*`.

 

 

I wonder why you used the (to me, arcane) `+` construct to give an "elegant" solution. I cannot find any documentation on the use of the `f` notation except for f = + or *. Why not just use add or mul? They are much more intuitive e.g,

sqrt(mul(x,x in select(isprime, [$1..100])[]));




I imagine there might be other issues involved as well as maters of taste but I found add to be a tad faster than `*`.

 

 

I can no longer reproduce the error. I copied the commands from a Maple 16 worksheet I was using and then executed them on a machine with only Maple 15 installed. The only commands I used were diff, solve and simplify. I was mystified by the appearance of both cos(f(y)) and cos f(y).

Hopefully, the problem will not arise again but if it does I will document it more carefully.

 

Thanks for your response.

Thanks for the timing and the explanation. It makes more sense now. I did not realize there was such overhead because, in general, dsolve is so fast.

Thanks for the timing and the explanation. It makes more sense now. I did not realize there was such overhead because, in general, dsolve is so fast.

Thank you. I found the example quite helpful. In particular, I see that when an event occurs and dsolve stops, it returns the values of all the variables at the stopping time. (The messages about stopping are not part of the return.)Secondly, one can use eventstop as you indicate to see which event occurred. That is all I need to do what I wanted.

The folks who answer questions on Mapleprimes do a great service to the community and I am very grateful to all of you. However, I have a couple of questions for the Maple people.

1) To find out about using "events" one must look up dsolve.numeric.Events; in particular, dsolve.numeric.events does not fetch anything. Why?

2) Eventstop, eventdisable, etc. do not turn up anything in the documentation for Maple 16; one must search the examples carefully to find an explanation of them. Why?

3) What would be wrong about changing the example given by Preben Alsholm to
restart;
P:=proc(p) local res,q,eq,sol;
eq:=diff(f(t),t,t)+f(t)=t/(t+p);
sol:=dsolve({eq,f(0)=1,D(f)(0)=0},numeric,events=[[f(t)-1.2,halt],[f(t)+0.2,halt]]):
    res:=op(subs(sol(15),[t,f(t),diff(f(t),t)]));
    q:=sol(eventstop);
    [p,res,q];
end proc:

P(1.4);
Warning, cannot evaluate the solution further right of 4.8443260, event #1 triggered a halt
[1.4, 4.84432605406979, 1.20000000000000, 0.695372548793804, 1]
Why is this approach deprecated?

Thanks for any answers.

Thank you. I found the example quite helpful. In particular, I see that when an event occurs and dsolve stops, it returns the values of all the variables at the stopping time. (The messages about stopping are not part of the return.)Secondly, one can use eventstop as you indicate to see which event occurred. That is all I need to do what I wanted.

The folks who answer questions on Mapleprimes do a great service to the community and I am very grateful to all of you. However, I have a couple of questions for the Maple people.

1) To find out about using "events" one must look up dsolve.numeric.Events; in particular, dsolve.numeric.events does not fetch anything. Why?

2) Eventstop, eventdisable, etc. do not turn up anything in the documentation for Maple 16; one must search the examples carefully to find an explanation of them. Why?

3) What would be wrong about changing the example given by Preben Alsholm to
restart;
P:=proc(p) local res,q,eq,sol;
eq:=diff(f(t),t,t)+f(t)=t/(t+p);
sol:=dsolve({eq,f(0)=1,D(f)(0)=0},numeric,events=[[f(t)-1.2,halt],[f(t)+0.2,halt]]):
    res:=op(subs(sol(15),[t,f(t),diff(f(t),t)]));
    q:=sol(eventstop);
    [p,res,q];
end proc:

P(1.4);
Warning, cannot evaluate the solution further right of 4.8443260, event #1 triggered a halt
[1.4, 4.84432605406979, 1.20000000000000, 0.695372548793804, 1]
Why is this approach deprecated?

Thanks for any answers.

I see. I must put the single quote around te f, not the f(j). Makes perfect sense.

 

Thank you!

4 5 6 7 8 9 Page 6 of 9