Question: why does one need to convert piecewise function to piecewise for pdsolve?

UPDATE

Thanks for checking. I verify I get the error and made screen shots below

When I add the convert() command, the error goes away. Here is screen shot

 

I am using Maple 2017, student version, on windows 7, 64 bit, home edition.

 

Original post

This is using Maple 2017 on windows.

With the following input, Maple pdsolve gives an error

pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1](u)(0,t)=0,D[1](u)(L,t)=0:
assume(L>0):
ic:=u(x,0)=piecewise(0<x and x<=L/2,0,L/2<x and x<L,1):
sol:=pdsolve([pde,bc,ic],u(x,t)):

However, if I add one line to convert the piecewise function above to piecewise, then pdsolve no longer gives an error. So the following input works

restart;
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1](u)(0,t)=0,D[1](u)(L,t)=0:
assume(L>0):
ic:=u(x,0)=piecewise(0<x and x<=L/2,0,L/2<x and x<L,1):
ic:=convert(ic,piecewise,x):
sol:=pdsolve([pde,bc,ic],u(x,t)):

 

Notice the extra line. Why does one have to convert piecewise to piecewise to make pdsolve accept the input?

sorry did not write down the error message and I am writing this from school library PC. But if you try the first case, you'll see the error.

 

Please Wait...