Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@max125 The manuals are good. You can find them here:

http://www.maplesoft.com/documentation_center/

@max125 When you do (in Maple input):

g(x):=x^2;

you are (implicitly) creating a procedure g with option remember and assigning to its memory table:

eval(g);
            
Notice that the body of this procedure i.e. just 'procname(args)' makes this procedure return unevaluated if the input is not in the memory table of g. The assignment you made has been saved in the memory table:

op(4,eval(g));
               

Here x is the index and x^2 is the entry.
Try one more assignment:
g(87):=56;
op(4,eval(g));
                  
To define a function g given by g(x)=x^2 for all x to:
g:=x->x^2;
# or use the more explicit version:
g:=proc(x) x^2 end proc;

@adel-00 The amplitude of the oscillations is very small. I commented on that in my answer above, where I ended the Maple code with the comment ##No perceptible wiggles.

Try replacing 0.9..1 by 0.99999..1 (as I did in my comment to vv above). Then you get:

@vv Yes using
dsol1(parameters=[10^6]);
plots:-odeplot(dsol1,[t,u(t)],0.99999..1,numpoints=10000);
## I get:


which seems to have the same period as sin(2*10^6*t), i.e. Pi*10^(-6) :
plot(sin(2*10^6*t),t=0.99999..1);

@adel-00 Answers to your questions:

1) the size option only works in recent versions of Maple. Just remove it.

2) Nothing wrong with setting omega=10^6 at the top, but then you loose the opportunity to analyze numerically what the effect of that extremely rapid oscillation has.
If you don't want to experiment with omega you should just use:
dsol1 :=dsolve({dsys1,ini1},numeric, abserr=1e-9, relerr=1e-8,maxfun=0);
plots:-odeplot(dsol1,[[t,u(t)],[t,v(t)],[t,w(t)]],0..1,numpoints=10000);

3) 20 minutes doesn't sound wrong. On my computer with Maple 2015.2 the last command took 48 seconds. You have an earlier Maple version and you may have a slower computer.

@Carl Love Yes, I wouldn't have thought of that, but isolating
 zip(solve, [(x-2)/3 , (y-1)/4 , (z-3)/3] =~ t, [x,y,z]);
made me understand.

@vv Certainly, yes. If this it not desirable then the first method should be chosen, i.e.

f:=proc(theta) proc(x) theta*x end proc end proc;

You have an initial value problem for the 1D wave equation. The solution is given by the result of
pdsolve({Eq1,u(x,0)=f(x),D[2](u)(x,0)=g(x)});

This is THE solution. So what more do you want?

@maple I edited my original answer above to include a shooting method. Take a look at that.
The conclusion I draw from that is that the original bvp solution is pretty good.

When I run your worksheet in Maple 2015 without trying to understand what is going on I don't get any unevaluated integrals.
I see that you have Maple 13 and from the output you show above you have some instances of Int (grey integrals), i.e. the inert version of int.
Try value on Vc[1](t) to turn Int into int.
Maple 2015 gives you:

@maple What do you mean by a good method? Is there anything wrong with the dsolve/numeric result I gave above:

ode:=diff(f(x),x,x,x)+f(x)*diff(f(x),x,x)+1-diff(f(x),x)^2=0;
bcs:=f(0)=0,D(f)(0)=0,D(f)(infinity)=1;
res:=dsolve(eval({ode,bcs},infinity=5),numeric); #Change to infinity=whatever if you like.

@maple Try setting (as Tom Leslie does) infinity=30 in dsolve. Then plot the result only on the interval x=0..5. Save the plot in p30, say.
Then set infinity=5 in dsolve. Plot the result on the interval x=0..5. Save the result in p5.
Now do
plots:-display(p30,p5);

You should see that the one is on top of the other, i.e. there is no visible difference, and visible difference is what matters if you are plotting (obviously).

@acer You are right about the need for protecting possible calls to Int within u.
But Diff and diff do accept the variables in a list, in fact in at least one case it is needed:
diff( x^2, []);

A revised version:
CollapseNestDiff:=proc(u::specfunc({diff,Diff,%diff})) local a,b,INT;
   a:=subs(Int=INT,diff=Int,Diff=Int,%diff=Int,u);
   b:=IntegrationTools:-CollapseNested(a);
   subs(Int=Diff,INT=Int,b)
end proc;
#One example:
u:=Diff(Diff(Diff(x^2*exp(x*y)*Int(sin(y)*x^3,x),x),x),y);
lprint(u);
value(%);
CollapseNestDiff(u);
lprint(%);
value(%);



@acer In the meantime, if there is a strong enough need for such a facility, then one could use IntegrationTools:-CollapseNested for this purpose:

CollapseNestDiff:=proc(u::specfunc({diff,Diff,%diff})) local a,b;
   a:=subs(diff=Int,Diff=Int,%diff=Int,u);
   b:=IntegrationTools:-CollapseNested(a);
   subs(Int=Diff,b)
end proc;

@John Fredsted That switching surprised me, but take a look at the lprint versions:

expr := Diff(f(x,y),x,y,y):
lprint(expr);
Diff(f(x, y), x, y, y)
expr1 := convert(expr,diff):
lprint(expr1);
diff(diff(diff(f(x, y), x), y), y)
expr2 := convert(expr1,Diff):
lprint(expr2);
Diff(Diff(Diff(f(x, y), x), y), y)


First 90 91 92 93 94 95 96 Last Page 92 of 231