nm

10998 Reputation

20 Badges

12 years, 279 days

MaplePrimes Activity


These are questions asked by nm

Maple 2018.

I am surprised Maple pdsolve can't solve this basic heat PDE. it is heat PDE on bar, with left end boundary condition being time dependent is only difference from basic heat PDE's on a bar.

May be a Maple expert can find a work around? I tried all the HINTS I know about.

restart;
#infolevel[pdsolve] := 3:
pde:=diff(u(x,t),t)=diff(u(x,t),x$2);
bc:=u(0,t)=t,u(Pi,t)=0:
ic:=u(x,0)=0:
sol:=pdsolve([pde,bc,ic],u(x,t)) assuming t>0 and x>0;

 

I also hope this question of mine do not get deleted as well, like the question I posted last night asking why pdsolve ignores assumptions that showed number of examples, was deleted few hrs after I posted it. 

If this question gets deleted, I will get the message that posts showing any problem in Maple software are not welcome here by Maplesoft and I will stop coming here.

 

This is using Maple 2018.

I noticed when solving Laplace PDE on disk, that no condition is needed to tell Maple if one is asking for solution inside the disk or outside. So how does Maple know which one it is?

It turned out Maple gives the same solution for the PDE outside as inside, which is wrong.

The solution to Laplace PDE inside a disk of radius 1 is

Which Maple gives correctly. But it also give the same above solution for outside the disk. The solution outside the disk should have r^(-n) and not r(n).  Like this

Basically Maple ignores assumption on `r`. This is what I tried

restart;
pde := (diff(r*(diff(u(r, theta), r)), r))/r+(diff(u(r, theta), theta, theta))/r^2 = 0:
bc := u(1, theta) = f(theta), u(r, -Pi) = u(r, Pi), (D[2](u))(r, -Pi) = (D[2](u))(r, Pi):
sol_inside:=pdsolve([pde, bc], u(r, theta), HINT = boundedseries) assuming r<1;

restart;
pde := (diff(r*(diff(u(r, theta), r)), r))/r+(diff(u(r, theta), theta, theta))/r^2 = 0:
bc := u(1, theta) = f(theta), u(r, -Pi) = u(r, Pi), (D[2](u))(r, -Pi) = (D[2](u))(r, Pi):
sol_outside:=pdsolve([pde, bc], u(r, theta)) assuming r>1;

 

Both the above gives the same answer.

How then does one solve the Laplace PDE outside the disk using Maple? And why is assumptions on "r" seems to be ignored in the above?

 

 

(ps. there is no Maple 2018 product to select, so I selected Maple 2017 from the menu).

The new UNTIL keyword added to Maple 2018 seems to me to be confusing and a useless addition to the Maple language.

First of all, using it in a DO loop, one does not use an closing END DO as normal. This makes it harder to use, since one is used to seeing an END DO to close each DO. They align physically better, which makes the code easier to read.

In addition, I can't think of anything that can't be done using current language constructs that needs this new keyword. Can someone? 

Adding a whole new keyword to make one type maybe few less characters seems like  a bad language design. A language constructs should be orthogonal to each others for the language to remain simple and clean. Adding more keywords for the fun of it should be avoided if something can be written using exisiting language constructs.

n := 37:
do
  n := n + 1
until isprime(n);
n;

very confusing to read. It has no end do. At first, I did not see where the loop ends. And the above can be done in many other ways allready, one direct way could be

n := 37:
do
  n := n + 1;
  if isprime(n) then
     break;
  fi;
od;
n;

And it is more clear as well since the DO is aligned with the END DO and I find the logic clearer with no new keyword added. Another way could be

n:= 37:
found_prime := false:
while not found_prime do
   n:= n + 1;
   found_prime := isprime(n);
od:
n;

I am sure there are other ways to do this.

Could someone please show an example where UNTIL is really needed and will make the code much more clear that justifies adding it to the language?

 

 

I am having trouble getting Maple 2017.3 with latest Physics update to give solution to Burger's PDE for viscous fluid flow with the following initial condition. May be I am not doing something right. I tried different HINTS, but no luck.

Maple can solve the PDE without the initial conditions.

May be a Maple expert can find work around or show what I might be doing wrong.

restart;
pde := diff(u(x, t), t) + u(x, t)*diff(u(x, t), x) = mu*diff(u(x,t),x$2);
ic  := u(x,0) = PIECEWISE([0,x>=0],[1,x<0]);
sol := pdsolve({pde,ic}, u(x, t)) assuming mu>0;

Maple returns () as solution.

This PDE can be solved analytically. Here is Mathematica' solution

ClearAll[u,x,y,mu]
pde = D[u[x,t],{t}]+u[x,t]*D[u[x,t],{x}]==mu*D[u[x,t],{x,2}];
ic  = u[x,0]==Piecewise[{{1,x<0},{0,x>=1}}];
sol = DSolve[{pde,ic},u[x,t],{x,t},Assumptions->mu>0]

 

 

This is on Maple 2017.3 under windows

After obtaining solution from pdsolve(), I tried to see if Maple can convert it to hyperbolic trig functions by calling `convert(sol,trigh)`. 

 

I waited and waited and nothing happened. Then clicked on the `interrupt current operation` button at top of menu. 

But I found that mserver.exe has hanged in a loop. Taking 100% CPU and still running. So Had to terminate it from task manager.

Question is: It is ok if Maple can't do the conversion, but why does it hang? Maybe if I want for one hr it will finish, I do not know. But the important part, why does `interrupt current operation` does not work, in the sense that the mserver.exe is still running?

Is this common thing to happen? Should this be fixed? 

Here is example

 

restart;
interface(showassumed=0);
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0;
f:=x-> piecewise(x>0 and x<1/2, 2*x, x>1/2 and x<1, 2-2*x);
bc:=u(0,y)=0,u(1,y)=0,u(x,0)=f(x),u(x,2)=f(x);
sol:=pdsolve([pde,bc],u(x,y)) assuming x>0,y>0;

The above works OK and generates a solution. Now the next call hangs mserver.exe

convert(sol,trigh);

In case your Maple version can't solve the above PDE. Here is the solution obtained, so you can try this below without having to solve the PDE

 

sol := u(x, y) = Sum(8*sin((1/2)*n*Pi)*sin(Pi*x*n)*(exp(Pi*n*(3*y-2))-
         exp(Pi*n*(3*y-4))+exp(Pi*y*n)-exp(Pi*n*(y-2)))*exp(-2*Pi*n*(y-2))/(Pi^2*n^2*(exp(4*n*Pi)-1)),
            n = 0 .. infinity);
convert(sol,trigh);

I also tried convert(rhs(sol),trigh); but it made no difference.

 

First 157 158 159 160 161 162 163 Last Page 159 of 194