nm

11353 Reputation

20 Badges

12 years, 340 days

MaplePrimes Activity


These are questions asked by nm

Trying Maple on a textbook problem to verify my hand solution. 

But Maple pdsolve hangs with the mserver.exe tallomg almost 100% CPU and over 10 GB of RAM!

I waited for almost 20 minutes. Tried another time, same thing.

It is no problem if Maple can't solve this, but Maple seems to suffer from too many hangs when it is not able to solve a problem. I've had similar problems with dsolve also.

This is on windows 10, 64 bit with Maple 2018.2 With Physics updates version 218

restart;
PackageTools:-IsPackageInstalled("Physics Updates");

218

interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=A(t),eval(diff(u(x,t),x),x=1)=B(t);
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

then


* trying method "_Fn" for 2nd order PDEs
   -> trying "linear_in_xt"
   -> trying "BC_equal_0"
* trying method "_Cn_cn" for 2nd order PDEs
Trying travelling wave solutions as power series in tanh ...
Trying travelling wave solutions as power series in ln ...
Trying travelling wave solutions as power series in tanh ...
Trying travelling wave solutions as power series in ln ...
* trying method "Wave" for 2nd order PDEs
   -> trying "Cauchy"
   -> trying "SemiInfiniteDomain"
   -> trying "WithSourceTerm"
* trying method "Heat" for 2nd order PDEs
   -> trying "SemiInfiniteDomain"
   -> trying "WithSourceTerm"
* trying method "Series" for 2nd order PDEs
   -> trying "ThreeBCsincos"
   -> trying "FourBC"
   -> trying "ThreeBC"
   -> trying "ThreeBCPeriodic"
   -> trying "WithSourceTerm"
      * trying method "_Fn" for 2nd order PDEs
         -> trying "linear_in_xt"
         -> trying "BC_equal_0"
      * trying method "_Cn_cn" for 2nd order PDEs

And here is hangs. Notice that because both ends are Neumann, there is no unique solution to this problem.  So the solution will contain arbitrary constant. May be this is what made pdsolve hang? 

No it is not. Trying with only one end nonhomogeneous  Neumann, and the other end Dirichlet, it still hangs. The problem seems to be with one end is nonhomogeneous  Neumann, which is a function of time. So this hangs also (same place)

restart;
interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=A(t),eval(diff(u(x,t),x),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

And this also

restart;
interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=sin(t),eval(diff(u(x,t),x),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

But this does not hang

interface(showassumed=0);
infolevel[pdsolve]:=2;
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+Q(x,t);
ic  :=  u(x,0)=f(x);
bc  :=  eval(diff(u(x,t),x),x=0)=1,eval(u(x,t),x=1)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming t>0,k>0;

The issue seems to be when one end is nonhomogeneous  Neumann which is function of time. 

Is there a workaround so it does not hang? The complaint is that Maple hangs, and not that Maple unable to solve the PDE.

 

Why  

eval(diff(u(x,t),x),x=0)=A(t)

gives

But

eval(diff(u(x,t),x),x=L)=A(t)

gives

I was expecting the same syntax in both cases. It seems for numbers Maple uses the first syntax and for symbols it uses the second syntax.

Does one need to worry about this difference?

 

Maple 2018.2 generates wrong latex in this example. In Latex a space in command name is important. So "\tau L" is not the same as "\tauL".  Since in the later case, Latex will complain that there is no command "\tauL"

Maple generates "\tauL" in the latex, when it should be "\tau L" in the following example, so the latex fails to compile because there is no command called "\tauL" in Latex.

Here is screen shot showing the problem and the Maple command to reproduce it

 

 

restart;
interface(showassumed=0);
pde :=  diff(u(x,t),t)=k*diff(u(x,t),x$2)+(exp(-c*t)*sin(2*Pi*x/L));
ic  :=  u(x,0)=f(x);
bc  :=  D[1](u)(0,t)=0, D[1](u)(L,t)=0;
sol:=pdsolve({pde,ic,bc},u(x,t)) assuming L>0,t>0,k>0;

latex(sol)

Any chance Maplesoft could fix this?

Possible workaround for now is to use something like "\newcommand{\tauL}{\tau L}" in preamble for this specific case.

 

This code used to work OK in an earlier version of Maple 2018. I do not know what changed and if it some change in Physics package that caused it.

restart;
pde:=diff(u(r,theta),r$2)+1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0;
bc:=u(r,0)=0,u(r,Pi)=0,u(0,theta)=0,u(1,theta)=f(theta);
sol:=pdsolve([pde,bc],u(r,theta),HINT = boundedseries(r = 0));

Now it gives the error 

Error, (in assuming) when calling 'assume'. Received: 'invalid arguments'

Workaround is to remove the HINT above. So the following now works

restart;
pde:=diff(u(r,theta),r$2)+1/r*diff(u(r,theta),r)+1/r^2*diff(u(r,theta),theta$2)=0;
bc:=u(r,0)=0,u(r,Pi)=0,u(0,theta)=0,u(1,theta)=f(theta);
sol:=pdsolve([pde,bc],u(r,theta));

Should this error message show up when using the HINT option?

Maple 2018.2 with Physics package cloud version 205.

Here is screen shot showing it was working in Physics 170

 

 

When dsolve throws an error, is it always due to invalid user input, such as parsing error of some sort related to the input given to it, or could it throw an error not related to the parsing part? And if so, how would one know, in code, the difference between an error thrown due to parsing error, vs. something else?

For example, this will throw an error due to parsing

 

ode:=diff(y(x),x)+y;
try
   dsolve(ode,y(x));
catch:    
    print(StringTools:-FormatMessage( lastexception[2..-1] )); 
end try;

   "y(x) and y cannot both appear in the given ODE."

I want to check programmatically, if and when an error thrown by dsolve, if it is due to input itself being invalid, such as parsing error, or invalid initial conditions, and such bad input from the user, vs. other possible error that could be generated internally for other reasons when the input is valid.

I looked at help and there is no mention of what type of exceptions dsolve can throw, or how would would determine the type of exception, as Maple exceptions seem to be just strings and there is no actual identifier or type associated with them to use to check on.

I also looked at https://www.maplesoft.com/support/help/Maple/view.aspx?path=ErrorMessageGuideOverview  and seen nothing there that helps. It just says
 

There are three circumstances that would generate an error in Maple:

1. 	User Errors - the user has supplied incorrect input
2. 	No Solution - in some cases, a Maple routine will issue an error, indicating that the given problem has no solution
3. 	Maple Errors - Maple generates an error during internal computation in response to a problem with its own code

Great., But it does not say how a would a user know which is which when an error is thrown? (using code, not by looking at the screen and then using google).

In Mathematica for example, error messages have actual names, and one could check for the actual message tag itself in the code, to find what the error actually is, instead of using just a plain string of the error message. 

Does Maple have such a thing to use to help find what class of error was thrown out the above three classes shown in the above web page?

 

First 149 150 151 152 153 154 155 Last Page 151 of 199