nm

11353 Reputation

20 Badges

13 years, 20 days

MaplePrimes Activity


These are questions asked by nm

When making this call to dsolve

 

restart;
ode:=diff(y(x),x)=1:
stopat(dsolve);
dsolve(ode,y(x));

Then in the debugger, I see that dsolve signature is

dsolve := proc(ODEs::{anything} := NULL, 
                {atomizenames::truefalse := true, build::truefalse := false, type::name := 'none'})

When typing print(ODEs) inside the debugger, it gives "diff(y(x),x)=1" which is correct.

But where is the second argument I passed to dsolve in the above call, which is "y(x)" gone?  I also do print(_nparams) inside the debugger and Maple returns 1 and not 2.

I expected to see 2 since I passed in two arguments to dsolve.

dsolve actually works without passing y(x), as follows

dsolve(ode);

And it seems Maple figure inside what is the dependent variable.

But my question is, is the second argument being thrown away before calling dsolve? If not, why it does not show in the debugger?   Is there some other pre-processing being done between the time the user calls dsolve() and the time the debugger is called?

 

 

 

I found a case where pdetest fails when called after another call to pdetest. I am using Physics version 272 from the clould. Using Maple 2018.2.1 on windows 10

restart;
u:='u';x:='x';t:='t';
pde := diff(u(x, t), t) + diff(u(x, t),x) =0;
sol:=pdsolve(pde,u(x,t));
pdetest(sol,pde);
    #0  OK
   
#restart;
u:='u';x:='x';t:='t';
pde:=diff(u(x,t),t)+diff(u(x,t),x)=0;
bc:=u(0,t)=0;
ic:=u(x,0)=sin(x);
sol:=pdsolve([pde,ic,bc],u(x,t)) assuming x>0;
pdetest(sol,pde);
   
     #sol := u(x, t) = -sin(-x+t)*Heaviside(-t+x)   #OK
     
     #-Dirac(-t+x)*sin(x)*cos(t)+Dirac(-t+x)*cos(x)*sin(t)+
      Dirac(-x+t)*sin(x)*cos(t)-Dirac(-x+t)*cos(x)*sin(t)   #WRONG should be 0
 

 

If I run the above again, but with restart call in between active, so that all is cleared, then pdetest gives 0 as expected on the second pde, with the same solution

 

restart;
u:='u';x:='x';t:='t';
pde := diff(u(x, t), t) + diff(u(x, t),x) =0;
sol:=pdsolve(pde,u(x,t));
pdetest(sol,pde);
   #0   #OK
   
restart;
u:='u';x:='x';t:='t';
pde:=diff(u(x,t),t)+diff(u(x,t),x)=0;
bc:=u(0,t)=0;
ic:=u(x,0)=sin(x);
sol:=pdsolve([pde,ic,bc],u(x,t)) assuming x>0;
pdetest(sol,pde);
   
   #0   #OK !! 

can any one explain why this happens?  Is this a bug? It seems like pdetest caching problem. it remembers something from the last call and this affects the result it gives for the next call.

any work around?

I thought in Maple the standard was to use _C1, and _C2, etc... for constants in the solutions returned.

Sometimes Maple mixes _C1 and c[2] in the same result. Is this common, to be expected sometimes and is OK? I noticed this only recently. 

I was thinking may be some part of Maple code still was not updated to use _C1 notation? Here is an example

restart;
pde:=diff(u(x,t),t)+ diff( u(x,t),x )^3 + 6 * u(x,t)* diff(u(x,t),x) = 0;
sol:=pdsolve(pde,u(x,t));

which gives

sol := u(x, t) = -(3/2)*_C1^2+3*(t*_c[2]+x)*_C1-(3/2)*(t*_c[2]+x)^2-(1/6)*_c[2]

With latest Physics updates  268

Is there an option, like AllSolutions used with solve, so that pdsolve would return all solutions to a PDE when it is nonlinear?

I looked at pdsolve help and do not see a HINT that looks like might do this.

For example, this PDE, Maple returns one solution. But Mathematica returns 2 solutions

restart;
pde:= diff(u(x,t),t) = diff(u(x,t),x$5)+10*diff(u(x,t),x$3)*u(x,t)+25*diff(u(x,t),x$2)*diff(u(x,t),x)+
             20*u(x,t)^2*diff(u(x,t),x);
sol:=pdsolve(pde,u(x,t));

#sol := u(x, t) = -12*tanh(176*_C2^5*t+_C2*x+_C1)^2*_C2^2+8*_C2^2

But there is another solution

sol1:=u(x,t)=-(1/2)* _C1^2*(-2 + 3*tanh(x*_C1+ t*_C1^5 + _C2)^2)
pdetest(sol1,pde)
#0

Here is another example. Maple returns one solution and Mathematica 7 solutions

restart;
pde:= diff(u(x,t),t)= u(x,t)*(1-u(x,t))+ diff(u(x,t),x$2);
sol:=pdsolve(pde,u(x,t));

#sol := u(x, t) = (1/4)*tanh(-5*t*(1/12)+(1/12)*sqrt(6)*x+_C1)^2-
              (1/2)*tanh(-5*t*(1/12)+(1/12)*sqrt(6)*x+_C1)+1/4

But there are other solutions

pde = D[u[x, t], t] == u[x, t] (1 - u[x, t]) + D[u[x, t], {x, 2}];
DSolve[pde, u[x, t], {x, t}]

I've tested some (not all) of these 7 solutions in Maple using pdetest and Maple agrees they are solutions:

restart;
pde:= diff(u(x,t),t)= u(x,t)*(1-u(x,t))+ diff(u(x,t),x$2);
sol:=pdsolve(pde,u(x,t));
with(MmaTranslator);
sol2:=FromMma(`-(1/4) (-3 + Tanh[(5 t)/12 - (I x)/(2 Sqrt[6]) - C[3]]) (1 + 
   Tanh[(5 t)/12 - (I x)/(2 Sqrt[6]) - C[3]])`);
pdetest(u(x,t)=sol2,pde);
#0

I tried setting 

       _AllSolutions:=true

But it had no effect. Is there other options?

 

Maple 2018.2.1, using Physicsupdates 266.

I undertsand method=Fourier needs boundary conditions to work, but I do not think this error message is right. Compare

 

restart;
pde := diff(u(r, theta), r, r)+diff(u(r, theta), theta, theta) = 0;
iv := u(2, theta) = 3*sin(2*theta)+1;
pdsolve([pde,iv], u(r,theta), method = Fourier)

With

restart;
pde := diff(u(r, theta), r, r)+diff(u(r, theta), theta, theta) = 0;
pdsolve(pde, u(r,theta), method = Fourier)

Error, (in pdsolve/info) wrong extra arguments: {method = Fourier}
 

pdsolve should return no solution instead. The way it is above, I thought at first I had wrong syntax with the "method = Fourier" settings and I think this error message can be misleading to a user.
 

First 147 148 149 150 151 152 153 Last Page 149 of 199